Skip to content

Commit 1a321b2

Browse files
committed
fixup! Merge branch 'tiago/outdated-eth-nonces' (#2035)
1 parent a21b0fd commit 1a321b2

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

apps/src/lib/node/ledger/shell/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,7 @@ mod shell_tests {
24102410
// sent transfers to namada nonce to 5
24112411
.transfers_to_namada = InnerEthEventsQueue::new_at(5.into());
24122412

2413-
let (protocol_key, _, _) = wallet::defaults::validator_keys();
2413+
let (protocol_key, _) = wallet::defaults::validator_keys();
24142414

24152415
// only bad events
24162416
{
@@ -2432,7 +2432,10 @@ mod shell_tests {
24322432
.sign(&protocol_key, shell.chain_id.clone())
24332433
.to_bytes();
24342434
let rsp = shell.mempool_validate(&tx, Default::default());
2435-
assert!(rsp.code != 0, "Validation should have failed");
2435+
assert!(
2436+
rsp.code != ErrorCodes::Ok.into(),
2437+
"Validation should have failed"
2438+
);
24362439
}
24372440

24382441
// at least one good event
@@ -2459,7 +2462,10 @@ mod shell_tests {
24592462
.sign(&protocol_key, shell.chain_id.clone())
24602463
.to_bytes();
24612464
let rsp = shell.mempool_validate(&tx, Default::default());
2462-
assert!(rsp.code == 0, "Validation should have passed");
2465+
assert!(
2466+
rsp.code == ErrorCodes::Ok.into(),
2467+
"Validation should have passed"
2468+
);
24632469
}
24642470
}
24652471

apps/src/lib/node/ledger/shell/prepare_proposal.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ mod test_prepare_proposal {
13931393
// sent transfers to namada nonce to 5
13941394
.transfers_to_namada = InnerEthEventsQueue::new_at(5.into());
13951395

1396-
let (protocol_key, _, _) = wallet::defaults::validator_keys();
1396+
let (protocol_key, _) = wallet::defaults::validator_keys();
13971397
let validator_addr = wallet::defaults::validator_address();
13981398

13991399
// test an extension containing solely events with
@@ -1418,12 +1418,12 @@ mod test_prepare_proposal {
14181418
.sign(&protocol_key, shell.chain_id.clone())
14191419
.to_bytes();
14201420
let req = RequestPrepareProposal {
1421-
txs: vec![tx],
1421+
txs: vec![tx.into()],
14221422
..Default::default()
14231423
};
14241424
let proposed_txs =
14251425
shell.prepare_proposal(req).txs.into_iter().map(|tx_bytes| {
1426-
Tx::try_from(tx_bytes.as_slice()).expect("Test failed")
1426+
Tx::try_from(tx_bytes.as_ref()).expect("Test failed")
14271427
});
14281428
// since no events with valid nonces are contained in the vote
14291429
// extension, we drop it from the proposal
@@ -1466,12 +1466,12 @@ mod test_prepare_proposal {
14661466
.sign(&protocol_key, shell.chain_id.clone())
14671467
.to_bytes();
14681468
let req = RequestPrepareProposal {
1469-
txs: vec![tx],
1469+
txs: vec![tx.into()],
14701470
..Default::default()
14711471
};
14721472
let proposed_txs =
14731473
shell.prepare_proposal(req).txs.into_iter().map(|tx_bytes| {
1474-
Tx::try_from(tx_bytes.as_slice()).expect("Test failed")
1474+
Tx::try_from(tx_bytes.as_ref()).expect("Test failed")
14751475
});
14761476
// find the event with the good nonce
14771477
let mut ext = 'ext: {

apps/src/lib/node/ledger/shell/process_proposal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ mod test_process_proposal {
21362136
// sent transfers to namada nonce to 5
21372137
.transfers_to_namada = InnerEthEventsQueue::new_at(5.into());
21382138

2139-
let (protocol_key, _, _) = wallet::defaults::validator_keys();
2139+
let (protocol_key, _) = wallet::defaults::validator_keys();
21402140

21412141
// only bad events
21422142
{

0 commit comments

Comments
 (0)