Skip to content

Commit

Permalink
fixup! Merge branch 'yuji/ibc-rs-0.47.0' (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 authored and tzemanovic committed Nov 11, 2023
1 parent dbc0f98 commit b02bb6a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 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.

2 changes: 1 addition & 1 deletion apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ mod test_finalize_block {
let pkh1 = get_pkh(validator.address.clone(), Epoch::default());
let votes = vec![VoteInfo {
validator: Some(Validator {
address: pkh1.clone(),
address: pkh1.clone().into(),
power: u128::try_from(validator.bonded_stake)
.expect("Test failed") as i64,
}),
Expand Down
8 changes: 4 additions & 4 deletions benches/native_vps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ fn ibc_vp_validate_action(c: &mut Criterion) {
// Connection handshake
let msg = MsgConnectionOpenInit {
client_id_on_a: ClientId::new(
ClientType::new("01-tendermint".to_string()).unwrap(),
ClientType::new("01-tendermint").unwrap(),
1,
)
.unwrap(),
Expand Down Expand Up @@ -1033,7 +1033,7 @@ fn ibc_vp_validate_action(c: &mut Criterion) {
actions.set_validation_params(ibc.validation_params().unwrap());

let module = TransferModule::new(ctx);
actions.add_transfer_route(module.module_id(), module);
actions.add_transfer_module(module.module_id(), module);

group.bench_function(bench_name, |b| {
b.iter(|| actions.validate(&tx_data).unwrap())
Expand All @@ -1050,7 +1050,7 @@ fn ibc_vp_execute_action(c: &mut Criterion) {
// Connection handshake
let msg = MsgConnectionOpenInit {
client_id_on_a: ClientId::new(
ClientType::new("01-tendermint".to_string()).unwrap(),
ClientType::new("01-tendermint").unwrap(),
1,
)
.unwrap(),
Expand Down Expand Up @@ -1131,7 +1131,7 @@ fn ibc_vp_execute_action(c: &mut Criterion) {
actions.set_validation_params(ibc.validation_params().unwrap());

let module = TransferModule::new(ctx);
actions.add_transfer_route(module.module_id(), module);
actions.add_transfer_module(module.module_id(), module);

group.bench_function(bench_name, |b| {
b.iter(|| actions.execute(&tx_data).unwrap())
Expand Down
2 changes: 1 addition & 1 deletion benches/txs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ fn ibc(c: &mut Criterion) {
// Connection handshake
let msg = MsgConnectionOpenInit {
client_id_on_a: ClientId::new(
ClientType::new("01-tendermint".to_string()).unwrap(),
ClientType::new("01-tendermint").unwrap(),
1,
)
.unwrap(),
Expand Down
40 changes: 23 additions & 17 deletions tests/src/e2e/ibc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ fn setup_two_single_node_nets() -> Result<(Test, Test)> {
// epoch per 100 seconds
let update_genesis =
|mut genesis: templates::All<templates::Unvalidated>, base_dir: &_| {
genesis.parameters.parameters.epochs_per_year = 315_360;
genesis.parameters.parameters.epochs_per_year = 31536;
setup::set_validators(1, genesis, base_dir, |_| 0)
};
let test_a = setup::network(update_genesis, None)?;
Expand Down Expand Up @@ -1402,16 +1402,19 @@ fn check_balances(
) -> Result<()> {
// Check the balances on Chain A
let rpc_a = get_actor_rpc(test_a, &Who::Validator(0));
let query_args = vec!["balance", "--token", NAM, "--node", &rpc_a];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
// Check the escrowed balance
let expected = format!(
": 100000, owned by {}",
Address::Internal(InternalAddress::Ibc)
);
client.exp_string(&expected)?;
let escrow = Address::Internal(InternalAddress::Ibc).to_string();
let query_args = vec![
"balance", "--owner", &escrow, "--token", NAM, "--node", &rpc_a,
];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
client.exp_string("nam: 100000")?;
// Check the source balance
let expected = ": 880000, owned by albert".to_string();
let query_args = vec![
"balance", "--owner", ALBERT, "--token", NAM, "--node", &rpc_a,
];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
let expected = "nam: 880000".to_string();
client.exp_string(&expected)?;
client.assert_success();

Expand Down Expand Up @@ -1466,16 +1469,19 @@ fn check_balances_after_back(
) -> Result<()> {
// Check the balances on Chain A
let rpc_a = get_actor_rpc(test_a, &Who::Validator(0));
let query_args = vec!["balance", "--token", NAM, "--node", &rpc_a];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
// Check the escrowed balance
let expected = format!(
": 50000, owned by {}",
Address::Internal(InternalAddress::Ibc)
);
client.exp_string(&expected)?;
let escrow = Address::Internal(InternalAddress::Ibc).to_string();
let query_args = vec![
"balance", "--owner", &escrow, "--token", NAM, "--node", &rpc_a,
];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
client.exp_string("nam: 50000")?;
// Check the source balance
let expected = ": 930000, owned by albert".to_string();
let query_args = vec![
"balance", "--owner", ALBERT, "--token", NAM, "--node", &rpc_a,
];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
let expected = "nam: 930000".to_string();
client.exp_string(&expected)?;
client.assert_success();

Expand Down
2 changes: 1 addition & 1 deletion wasm/Cargo.lock

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

2 changes: 1 addition & 1 deletion wasm_for_tests/wasm_source/Cargo.lock

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

0 comments on commit b02bb6a

Please sign in to comment.