Allow the same account to be passed multiple times to a single instruction (#7795)

This commit is contained in:
Jack May
2020-01-22 09:11:56 -08:00
committed by GitHub
parent d854e90c23
commit 023074650f
33 changed files with 1392 additions and 765 deletions

View File

@@ -196,14 +196,20 @@ mod tests {
nonce_account
.nonce_initialize(&authorized, &recent_blockhashes, &Rent::free())
.unwrap();
assert!(verify_nonce(&nonce_account.account, &recent_blockhashes[0]));
assert!(verify_nonce(
&nonce_account.account.borrow(),
&recent_blockhashes[0]
));
});
}
#[test]
fn verify_nonce_bad_acc_state_fail() {
with_test_keyed_account(42, true, |nonce_account| {
assert!(!verify_nonce(&nonce_account.account, &Hash::default()));
assert!(!verify_nonce(
&nonce_account.account.borrow(),
&Hash::default()
));
});
}
@@ -221,7 +227,7 @@ mod tests {
.nonce_initialize(&authorized, &recent_blockhashes, &Rent::free())
.unwrap();
assert!(!verify_nonce(
&nonce_account.account,
&nonce_account.account.borrow(),
&recent_blockhashes[1]
));
});