Skip to content

Commit

Permalink
chore: erase useless config fields in Axon
Browse files Browse the repository at this point in the history
  • Loading branch information
liyukun committed Dec 8, 2023
1 parent 272bc8e commit 3491f28
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 34 deletions.
22 changes: 1 addition & 21 deletions crates/relayer/src/chain/axon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ use ibc_proto::{
use ibc_relayer_types::{
applications::ics31_icq::response::CrossChainQueryResponse,
clients::ics07_axon::{
client_state::AxonClientState,
consensus_state::AxonConsensusState,
header::{AxonHeader, AXON_HEADER_TYPE_URL},
client_state::AxonClientState, consensus_state::AxonConsensusState, header::AxonHeader,
light_block::AxonLightBlock,
},
core::{
Expand Down Expand Up @@ -1392,24 +1390,6 @@ impl AxonChain {
create_client::TYPE_URL => {
convert!(self, msg, MsgCreateClient, create_client)
}
// TODO: this update_client uses Hermes internal message to handle the Axon-specific function,
// so maybe there is possibility to create a new one to do so
update_client::TYPE_URL => {
let msg = update_client::MsgUpdateClient::from_any(msg)
.map_err(|e| Error::protobuf_decode(update_client::TYPE_URL.to_string(), e))?;
let bytes = msg.header.value.as_slice();
let type_url = msg.header.type_url;
let to = match type_url.as_str() {
AXON_HEADER_TYPE_URL => self.config.ckb_light_client_contract_address,
"CELL_TYPE_URL" => self.config.image_cell_contract_address,
type_url => {
return Err(Error::other_error(format!("unknown type_url {type_url}")))
}
};
let tx = TransactionRequest::new().to(to).data(bytes.to_vec());
self.rt
.block_on(async { Ok(self.client.send_transaction(tx, None).await?.await?) })
}
// connection
conn_open_init::TYPE_URL => {
convert!(self, msg, MsgConnectionOpenInit, connection_open_init)
Expand Down
3 changes: 0 additions & 3 deletions crates/relayer/src/config/axon.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use ethers::types::H160;
use ibc_relayer_types::core::ics24_host::identifier::ChainId;
use serde_derive::{Deserialize, Serialize};
use tendermint_rpc::Url;
Expand All @@ -16,8 +15,6 @@ pub struct AxonChainConfig {
pub restore_block_count: u64,
pub key_name: String,
pub store_prefix: String,
pub ckb_light_client_contract_address: H160,
pub image_cell_contract_address: H160,

#[serde(default)]
pub packet_filter: PacketFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ transfer_contract_address = "0x0000000000000000000000000000000000000000"
restore_block_count = 10000
key_name = "relayer_axon_wallet"
store_prefix = "forcerelay"
ckb_light_client_contract_address = "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
image_cell_contract_address = "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"

[[chains]]
id = "ckb4ibc-0"
Expand Down
2 changes: 0 additions & 2 deletions tools/ibc-test/src/framework/utils/axon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ pub(crate) fn prepare_axon_chain(
let deployment = DeployedContracts {
contract_address,
transfer_contract_address,
image_cell_contract_address: ethers::types::H160::default(),
ckb_light_client_contract_address: ethers::types::H160::default(),
};
let path = working_dir.join(AXON_CONTRACTS_CONFIG_PATH);
std::fs::write(path, toml::to_string(&deployment)?).with_context(|| "write deployment info")?;
Expand Down
2 changes: 0 additions & 2 deletions tools/test-framework/src/types/axon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ use serde_derive::{Deserialize, Serialize};
pub struct DeployedContracts {
pub contract_address: H160,
pub transfer_contract_address: H160,
pub image_cell_contract_address: H160,
pub ckb_light_client_contract_address: H160,
}
4 changes: 0 additions & 4 deletions tools/test-framework/src/types/single/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ impl FullNode {
let DeployedContracts {
contract_address,
transfer_contract_address,
image_cell_contract_address,
ckb_light_client_contract_address,
..
} = deployed_contracts;

Expand All @@ -243,8 +241,6 @@ impl FullNode {
contract_address,
transfer_contract_address,
restore_block_count,
ckb_light_client_contract_address,
image_cell_contract_address,
};
Ok(config::ChainConfig::Axon(axon_config))
}
Expand Down

0 comments on commit 3491f28

Please sign in to comment.