SDK: Add versioning to nonce state (#8607)
This commit is contained in:
@ -500,7 +500,9 @@ fn test_nonced_stake_delegation_and_deactivation() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -523,7 +525,9 @@ fn test_nonced_stake_delegation_and_deactivation() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -714,7 +718,9 @@ fn test_stake_authorize() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -763,7 +769,9 @@ fn test_stake_authorize() {
|
||||
};
|
||||
assert_eq!(current_authority, online_authority_pubkey);
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let new_nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -997,7 +1005,9 @@ fn test_stake_split() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -1248,7 +1258,9 @@ fn test_stake_set_lockup() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account_pubkey).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -1362,7 +1374,9 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -1410,7 +1424,9 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
@ -1451,7 +1467,9 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
|
||||
|
||||
// Fetch nonce hash
|
||||
let account = rpc_client.get_account(&nonce_account.pubkey()).unwrap();
|
||||
let nonce_state: nonce::State = account.state().unwrap();
|
||||
let nonce_state = StateMut::<nonce::state::Versions>::state(&account)
|
||||
.unwrap()
|
||||
.convert_to_current();
|
||||
let nonce_hash = match nonce_state {
|
||||
nonce::State::Initialized(_meta, hash) => hash,
|
||||
_ => panic!("Nonce is not initialized"),
|
||||
|
Reference in New Issue
Block a user