Consolidate Nonce state under one struct (#8624)

automerge
This commit is contained in:
Trent Nelson
2020-03-04 09:51:48 -07:00
committed by GitHub
parent 8f60f1093a
commit 1cc7131bb7
12 changed files with 180 additions and 163 deletions

View File

@ -413,7 +413,7 @@ fn test_nonced_pay_tx() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -437,7 +437,7 @@ fn test_nonced_pay_tx() {
.unwrap()
.convert_to_current();
match nonce_state {
nonce::State::Initialized(_meta, hash) => assert_ne!(hash, nonce_hash),
nonce::State::Initialized(ref data) => assert_ne!(data.blockhash, nonce_hash),
_ => assert!(false, "Nonce is not initialized"),
}

View File

@ -504,7 +504,7 @@ fn test_nonced_stake_delegation_and_deactivation() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -529,7 +529,7 @@ fn test_nonced_stake_delegation_and_deactivation() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -722,7 +722,7 @@ fn test_stake_authorize() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -773,7 +773,7 @@ fn test_stake_authorize() {
.unwrap()
.convert_to_current();
let new_nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
assert_ne!(nonce_hash, new_nonce_hash);
@ -1009,7 +1009,7 @@ fn test_stake_split() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -1262,7 +1262,7 @@ fn test_stake_set_lockup() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -1378,7 +1378,7 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -1428,7 +1428,7 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -1471,7 +1471,7 @@ fn test_offline_nonced_create_stake_account_and_withdraw() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};

View File

@ -138,7 +138,7 @@ fn test_transfer() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
@ -162,7 +162,7 @@ fn test_transfer() {
.unwrap()
.convert_to_current();
let new_nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};
assert_ne!(nonce_hash, new_nonce_hash);
@ -183,7 +183,7 @@ fn test_transfer() {
.unwrap()
.convert_to_current();
let nonce_hash = match nonce_state {
nonce::State::Initialized(_meta, hash) => hash,
nonce::State::Initialized(ref data) => data.blockhash,
_ => panic!("Nonce is not initialized"),
};