diff --git a/Cargo.lock b/Cargo.lock index c86179b..8363a68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -496,7 +496,7 @@ dependencies = [ [[package]] name = "ethereum-consensus" version = "0.1.0" -source = "git+https://github.com/datachainlab/ethereum-light-client-rs?rev=v0.1.7#4645ecd3cd2d5e1515826ecb6f81f7801888e51a" +source = "git+https://github.com/datachainlab/ethereum-light-client-rs?rev=v0.2.0#51a10e62d7fec3b7ae5a796fdc1b838393ed3e2b" dependencies = [ "displaydoc", "hex", @@ -528,7 +528,7 @@ dependencies = [ [[package]] name = "ethereum-ibc" version = "0.1.0" -source = "git+https://github.com/datachainlab/ethereum-ibc-rs?rev=v0.0.19#06864ca06431906fdad149839cda52ba43da48d2" +source = "git+https://github.com/datachainlab/ethereum-ibc-rs?rev=v0.1.0#27e63e8581ecd848946709fa7dad677367bbcf69" dependencies = [ "bytes", "displaydoc", @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "ethereum-ibc-proto" version = "0.1.0" -source = "git+https://github.com/datachainlab/ethereum-ibc-rs?rev=v0.0.19#06864ca06431906fdad149839cda52ba43da48d2" +source = "git+https://github.com/datachainlab/ethereum-ibc-rs?rev=v0.1.0#27e63e8581ecd848946709fa7dad677367bbcf69" dependencies = [ "prost", "serde", @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "ethereum-light-client-verifier" version = "0.1.0" -source = "git+https://github.com/datachainlab/ethereum-light-client-rs?rev=v0.1.7#4645ecd3cd2d5e1515826ecb6f81f7801888e51a" +source = "git+https://github.com/datachainlab/ethereum-light-client-rs?rev=v0.2.0#51a10e62d7fec3b7ae5a796fdc1b838393ed3e2b" dependencies = [ "displaydoc", "ethereum-consensus", diff --git a/Cargo.toml b/Cargo.toml index 48afb48..b358da7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,11 +9,11 @@ displaydoc = { version = "0.2", default-features = false } tiny-keccak = { version = "2.0.2", default-features = false } light-client = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.12", default-features = false, features = ["ibc"] } -ethereum-ibc = { git = "https://github.com/datachainlab/ethereum-ibc-rs", rev = "v0.0.19", default-features = false } +ethereum-ibc = { git = "https://github.com/datachainlab/ethereum-ibc-rs", rev = "v0.1.0", default-features = false } [dev-dependencies] hex-literal = "0.4.1" lcp-types = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.12", default-features = false, features = ["std"] } store = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.12", default-features = false } -ethereum-consensus = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.1.7", default-features = false, features = ["prover"] } -ethereum-light-client-verifier = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.1.7", default-features = false, features = ["test-utils"] } +ethereum-consensus = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.2.0", default-features = false, features = ["prover"] } +ethereum-light-client-verifier = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.2.0", default-features = false, features = ["test-utils"] } diff --git a/src/client.rs b/src/client.rs index 6bafbb2..94fe43b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -520,7 +520,7 @@ mod tests { config::minimal::get_config(), keccak256("genesis_validators_root"), U64(1578009600), - Fraction::new(2, 3), + Fraction::new(2, 3).unwrap(), SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap() @@ -557,7 +557,7 @@ mod tests { ibc_commitments_slot: H256(hex!( "1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900" )), - trust_level: Fraction::new(2, 3), + trust_level: Fraction::new(2, 3).unwrap(), trusting_period: Duration::from_secs(60 * 60 * 27), max_clock_drift: Duration::from_secs(60), latest_execution_block_number: 1.into(), diff --git a/src/state.rs b/src/state.rs index b1fe36d..5a89324 100644 --- a/src/state.rs +++ b/src/state.rs @@ -5,12 +5,13 @@ use light_client::commitments::{gen_state_id_from_any, StateID}; use light_client::types::proto::google::protobuf::Any as IBCAny; // canonicalize_client_state canonicalizes some fields of specified client state -// target fields: latest_execution_block_number +// target fields: latest_execution_block_number, frozen_height pub fn canonicalize_client_state( client_state: ClientState, ) -> ClientState { let mut client_state = client_state; client_state.latest_execution_block_number = 0u64.into(); + client_state.frozen_height = None; client_state }