Skip to content

Commit

Permalink
only use the namada sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 25, 2024
1 parent 7e7672d commit 2ab89fd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 25 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ tendermint-rpc = { version = "0.38.1" }
tendermint-testgen = { version = "0.38.1" }

# Namada dependencies
namada_ibc = { git = "https://github.com/anoma/namada", branch = "main" }
namada_parameters = { git = "https://github.com/anoma/namada", branch = "main" }
namada_sdk = { git = "https://github.com/anoma/namada", branch = "main" }
namada_token = { git = "https://github.com/anoma/namada", branch = "main" }

# Other dependencies
abscissa_core = "=0.6.0"
Expand Down
3 changes: 0 additions & 3 deletions crates/relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ humantime = { workspace = true }
humantime-serde = { workspace = true }
itertools = { workspace = true }
moka = { workspace = true, features = ["sync"] }
namada_ibc = { workspace = true }
namada_parameters = { workspace = true }
namada_sdk = { workspace = true }
namada_token = { workspace = true }
num-bigint = { workspace = true, features = ["serde"] }
num-rational = { workspace = true, features = ["num-bigint", "serde"] }
once_cell = { workspace = true }
Expand Down
18 changes: 9 additions & 9 deletions crates/relayer/src/chain/namada.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use alloc::sync::Arc;
use tendermint_rpc::HttpClient;
use core::str::FromStr;
use std::thread;
use tendermint_rpc::HttpClient;
use tracing::debug;

use core::time::Duration;
Expand Down Expand Up @@ -36,24 +36,24 @@ use ibc_relayer_types::core::ics24_host::path::{
};
use ibc_relayer_types::signer::Signer;
use ibc_relayer_types::Height as ICSHeight;
use namada_ibc::core::host::types::path::UPGRADED_IBC_STATE;
use namada_ibc::{storage, COMMITMENT_PREFIX};
use namada_parameters::{storage as param_storage, EpochDuration};
use namada_sdk::address::{Address, InternalAddress};
use namada_sdk::borsh::BorshDeserialize;
use namada_sdk::ibc::core::host::types::path::UPGRADED_IBC_STATE;
use namada_sdk::ibc::{storage, COMMITMENT_PREFIX};
use namada_sdk::io::NullIo;
use namada_sdk::io::{Client, NamadaIo};
use namada_sdk::masp::fs::FsShieldedUtils;
use namada_sdk::parameters::{storage as param_storage, EpochDuration};
use namada_sdk::proof_of_stake::storage_key as pos_storage_key;
use namada_sdk::proof_of_stake::OwnedPosParams;
use namada_sdk::state::ics23_specs::ibc_proof_specs;
use namada_sdk::state::Sha256Hasher;
use namada_sdk::storage::{Key, KeySeg, PrefixValue};
use namada_sdk::token::storage_key::{balance_key, denom_key, is_any_token_balance_key};
use namada_sdk::token::{Amount, DenominatedAmount, Denomination};
use namada_sdk::wallet::Store;
use namada_sdk::wallet::Wallet;
use namada_sdk::{rpc, Namada, NamadaImpl};
use namada_sdk::io::{NamadaIo, Client};
use namada_token::storage_key::{balance_key, denom_key, is_any_token_balance_key};
use namada_token::{Amount, DenominatedAmount, Denomination};
use tendermint::block::Height as TmHeight;
use tendermint::{node, Time};
use tendermint_light_client::types::LightBlock as TMLightBlock;
Expand Down Expand Up @@ -689,7 +689,7 @@ impl ChainEndpoint for NamadaChain {
.upgrade_height
.decrement()
.map_err(|_| Error::invalid_height_no_source())?;
let key = namada_ibc::storage::upgraded_client_state_key(height);
let key = namada_sdk::ibc::storage::upgraded_client_state_key(height);
let (value, proof) =
self.query(key, QueryHeight::Specific(query_height), IncludeProof::Yes)?;
if let Some(proof) = proof {
Expand Down Expand Up @@ -721,7 +721,7 @@ impl ChainEndpoint for NamadaChain {
.upgrade_height
.decrement()
.map_err(|_| Error::invalid_height_no_source())?;
let key = namada_ibc::storage::upgraded_consensus_state_key(height);
let key = namada_sdk::ibc::storage::upgraded_consensus_state_key(height);
let (value, proof) =
self.query(key, QueryHeight::Specific(query_height), IncludeProof::Yes)?;
if let Some(proof) = proof {
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer/src/chain/namada/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ use ibc_relayer_types::core::ics23_commitment::merkle::convert_tm_to_ics_merkle_
use ibc_relayer_types::core::ics23_commitment::merkle::MerkleProof;
use ibc_relayer_types::events::IbcEvent;
use ibc_relayer_types::Height as ICSHeight;
use namada_ibc::storage::{ibc_trace_key_prefix, is_ibc_trace_key};
use namada_sdk::address::{Address, InternalAddress};
use namada_sdk::borsh::BorshDeserialize;
use namada_sdk::events::extend::Height as HeightAttr;
use namada_sdk::events::Event as NamadaEvent;
use namada_sdk::ibc::storage::{ibc_trace_key_prefix, is_ibc_trace_key};
use namada_sdk::io::Client;
use namada_sdk::io::NamadaIo;
use namada_sdk::queries::RPC;
use namada_sdk::rpc;
use namada_sdk::storage::{BlockHeight, Epoch, Key, PrefixValue};
use namada_sdk::tx::data::ResultCode;
use namada_sdk::tx::event::{Batch as BatchAttr, Code as CodeAttr};
use namada_sdk::io::NamadaIo;
use tendermint::block::Height as TmHeight;
use tendermint::Hash as TmHash;

Expand Down
1 change: 0 additions & 1 deletion tools/test-framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ibc-relayer-types = { workspace = true }
ibc-relayer = { workspace = true }
ibc-relayer-cli = { workspace = true }
ibc-proto = { workspace = true, features = ["serde"] }
namada_ibc = { workspace = true }
namada_sdk = { workspace = true }
tendermint = { workspace = true }
tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] }
Expand Down
4 changes: 2 additions & 2 deletions tools/test-framework/src/ibc/denom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn derive_namada_ibc_denom<ChainA, ChainB>(
..
} => {
let path = format!("{port_id}/{channel_id}");
let ibc_token_addr = namada_ibc::trace::ibc_token(format!("{path}/{raw_address}"));
let ibc_token_addr = namada_sdk::ibc::trace::ibc_token(format!("{path}/{raw_address}"));

Ok(MonoTagged::new(Denom::Ibc {
path,
Expand All @@ -157,7 +157,7 @@ fn derive_namada_ibc_denom<ChainA, ChainB>(
} => {
let new_path = format!("{port_id}/{channel_id}/{path}");
let ibc_token_addr =
namada_ibc::trace::ibc_token(format!("{new_path}/{}", denom.hash_only()));
namada_sdk::ibc::trace::ibc_token(format!("{new_path}/{}", denom.hash_only()));

Ok(MonoTagged::new(Denom::Ibc {
path: new_path,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/util/namada.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, PortI
use ibc_relayer_types::events::IbcEventType;
use ibc_relayer_types::Height;
use itertools::Itertools;
use namada_ibc::storage::{consensus_height, consensus_state_prefix};
use namada_sdk::ibc::storage::{consensus_height, consensus_state_prefix};
use namada_sdk::events::extend::Height as HeightAttr;
use namada_sdk::queries::RPC;
use namada_sdk::storage::{Key, PrefixValue};
Expand Down

0 comments on commit 2ab89fd

Please sign in to comment.