charlycst / tendermock Goto Github PK
View Code? Open in Web Editor NEWA mocked Tendermint node for integration testing of IBC protocol.
Home Page: https://charlycst.github.io/tendermock/tendermock/
A mocked Tendermint node for integration testing of IBC protocol.
Home Page: https://charlycst.github.io/tendermock/tendermock/
Hi,
I just noticed that proofs for keys that are overwritten twice are incorrect and fail to verify using verify_membership()
.
Here's a failing test ->
fn key_overwrite() {
let mut tree = AvlTree::new();
tree.insert("K", [1]);
tree.insert("K", [0]);
tree.insert("K", [2]);
assert!(check_integrity(&tree.root));
let root = tree
.root_hash()
.expect("Unable to retrieve root hash")
.as_bytes()
.to_vec();
let proof = tree
.get_proof("K")
.expect("Unable to retrieve a proof for 'K'");
let spec = get_proof_spec();
assert!(verify_membership(
&proof,
&spec,
&root,
"K".as_bytes(),
&[0]
));
}
Use a relayer configuration file, similar to relayer/tests/config/fixtures/relayer_conf_example.toml.
Start two instances of ibc-mock
It is important to use the same ports as the relayer will be using, specifically 26657/9090 for first chain and 26557/9091 for the second chain:
ibc-mock $ cargo run -- -c config/config.example.json -v -j 26657 -g 9090
ibc-mock $ cargo run -- -c config/config.example.json -v -j 26557 -g 9091
ibc-rs
, do the following:# remove any lingering data
rm -rf data0/*
rm -rf data1/*
# remove all light clients for each chain, the '-c' parameter must correspond to the chain identifier in the relayer_conf_example.toml file:
cargo run --bin relayer -- -c relayer_conf_example.toml light rm -c chain_A --all -y
cargo run --bin relayer -- -c relayer_conf_example.toml light rm -c chain_B --all -y
# setup primary light client peers for each chain
cargo run --bin relayer -- -c relayer_conf_example.toml light add localhost:26657 -c chain_A -f -p -s data0 -y
cargo run --bin relayer -- -c relayer_conf_example.toml light add localhost:26557 -c chain_B -f -p -s data1 -y
# setup witness peers for the light clients (note: the precise peer ids are not important here):
cargo run --bin relayer -- -c relayer_conf_example.toml light add localhost:26657 -c chain_A -s data0 -y --peer-id 5CD00153B35C4811D29736BF7C1B825056BED454
cargo run --bin relayer -- -c relayer_conf_example.toml light add localhost:26557 -c chain_B -s data1 -y --peer-id 8C16EEB6C01698F62E2359C6250FDB965FC2A89B
# register the key seed files for each chain
# download the file from https://gist.github.com/adizere/f17ea650de7d9256edfeee248fe22b18 and save as 'key_seed.json'
# we'll use the same key seed for both chains
cargo run --bin relayer -- -c relayer_conf_example.toml keys add chain_A key_seed.json
cargo run --bin relayer -- -c relayer_conf_example.toml keys add chain_B key_seed.json
cargo run --bin relayer -- -c relayer_conf_example.toml tx raw create-client chain_A chain_B
cargo run --bin relayer -- -c relayer_conf_example.toml tx raw update-client chain_A chain_B {CLIENT_ID}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.