Skip to content

Commit

Permalink
Merge branch 'tomas/tx_redel_test_fix' (#2224)
Browse files Browse the repository at this point in the history
* tomas/tx_redel_test_fix:
  test/tx_redelegate: filter out invalid redelegations
  deps: upgrade ledger-namada version
  • Loading branch information
tzemanovic committed Nov 28, 2023
2 parents a07a3b2 + 7303dfe commit 8d56419
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ index-set = {git = "https://github.com/heliaxdev/index-set", tag = "v0.8.0", fea
itertools = "0.10.0"
k256 = { version = "0.13.0", default-features = false, features = ["ecdsa", "pkcs8", "precomputed-tables", "serde", "std"]}
lazy_static = "1.4.0"
ledger-namada-rs = { git = "https://github.com/heliaxdev/ledger-namada", rev = "7e861c440de0fdabaf51e30d97f5c8736be348f3" }
# branch = "murisi/ledger-v0.27.0"
ledger-namada-rs = { git = "https://github.com/heliaxdev/ledger-namada", rev = "4fd882b84af7c93a1332c32a4e3d705fd63f09ab" }
ledger-transport-hid = "0.10.0"
libc = "0.2.97"
libloading = "0.7.2"
Expand Down
2 changes: 2 additions & 0 deletions wasm/wasm_source/proptest-regressions/tx_redelegate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cc 90825d666558e208bb8f4f46c746177abf8bf9499114dcdac1525ab600b7c6ce

22 changes: 14 additions & 8 deletions wasm/wasm_source/src/tx_redelegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,21 @@ mod tests {
address::testing::arb_non_internal_address(),
token::testing::arb_amount_non_zero_ceiled(max_amount),
)
.prop_map(
.prop_filter_map(
"Src and dest validator must not be the same",
|(src_validator, dest_validator, owner, amount)| {
let src_validator = Address::Established(src_validator);
let dest_validator = Address::Established(dest_validator);
transaction::pos::Redelegation {
src_validator,
dest_validator,
owner,
amount,
if src_validator == dest_validator {
None
} else {
let src_validator = Address::Established(src_validator);
let dest_validator =
Address::Established(dest_validator);
Some(transaction::pos::Redelegation {
src_validator,
dest_validator,
owner,
amount,
})
}
},
)
Expand Down

0 comments on commit 8d56419

Please sign in to comment.