SDK: Add versioning to nonce state (#8607)

This commit is contained in:
Trent Nelson
2020-03-03 19:39:09 -07:00
committed by GitHub
parent be0cc0273f
commit 1cb6101c6a
9 changed files with 188 additions and 107 deletions

View File

@ -3261,18 +3261,14 @@ mod tests {
// Nonced pay
let blockhash = Hash::default();
let data = nonce::state::Versions::new_current(nonce::State::Initialized(
nonce::state::Meta::new(&config.signers[0].pubkey()),
blockhash,
));
let nonce_response = json!(Response {
context: RpcResponseContext { slot: 1 },
value: json!(RpcAccount::encode(
Account::new_data(
1,
&nonce::State::Initialized(
nonce::state::Meta::new(&config.signers[0].pubkey()),
blockhash
),
&system_program::ID,
)
.unwrap()
Account::new_data(1, &data, &system_program::ID,).unwrap()
)),
});
let mut mocks = HashMap::new();
@ -3292,15 +3288,14 @@ mod tests {
let bob_keypair = Keypair::new();
let bob_pubkey = bob_keypair.pubkey();
let blockhash = Hash::default();
let data = nonce::state::Versions::new_current(nonce::State::Initialized(
nonce::state::Meta::new(&bob_pubkey),
blockhash,
));
let nonce_authority_response = json!(Response {
context: RpcResponseContext { slot: 1 },
value: json!(RpcAccount::encode(
Account::new_data(
1,
&nonce::State::Initialized(nonce::state::Meta::new(&bob_pubkey), blockhash),
&system_program::ID,
)
.unwrap()
Account::new_data(1, &data, &system_program::ID,).unwrap()
)),
});
let mut mocks = HashMap::new();