This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command to update registerTokenFee and sendTokenFee (paritytech#991)
* Add command to update registerTokenFee and sendTokenFee * Add smoke test for update fees * Rename to setTokenTransferFees * Improve for the comments * Update sdk * Update parachain/pallets/control/src/lib.rs Co-authored-by: Clara van Staden <claravanstaden64@gmail.com> * Update parachain/pallets/control/src/lib.rs Co-authored-by: Clara van Staden <claravanstaden64@gmail.com> * Rename as InvalidTokenTransferFees --------- Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
- Loading branch information
1 parent
df8d5da
commit 654f242
Showing
14 changed files
with
340 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use ethers::prelude::Address; | ||
use snowbridge_smoketest::{ | ||
constants::*, | ||
contracts::{i_gateway, i_gateway::SetTokenTransferFeesFilter}, | ||
helper::*, | ||
parachains::bridgehub::api::{ | ||
ethereum_control::events::SetTokenTransferFees, | ||
runtime_types::{self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall}, | ||
}, | ||
}; | ||
|
||
#[tokio::test] | ||
async fn set_token_transfer_fees() { | ||
let test_clients = initial_clients().await.expect("initialize clients"); | ||
|
||
let gateway_addr: Address = GATEWAY_PROXY_CONTRACT.into(); | ||
let ethereum_client = *(test_clients.ethereum_client.clone()); | ||
let gateway = i_gateway::IGateway::new(gateway_addr, ethereum_client.clone()); | ||
let fees = gateway.token_transfer_fees().await.expect("get fees"); | ||
println!("asset fees {:?}", fees); | ||
|
||
let set_token_fees_call = BHRuntimeCall::EthereumControl( | ||
runtime_types::snowbridge_control::pallet::Call::set_token_transfer_fees { | ||
register: 10_000_000_000_000, | ||
send: 20_000_000_000, | ||
}, | ||
); | ||
|
||
governance_bridgehub_call_from_relay_chain(vec![set_token_fees_call]) | ||
.await | ||
.expect("set token fees"); | ||
|
||
wait_for_bridgehub_event::<SetTokenTransferFees>(&test_clients.bridge_hub_client).await; | ||
|
||
wait_for_ethereum_event::<SetTokenTransferFeesFilter>(&test_clients.ethereum_client).await; | ||
|
||
let fees = gateway.token_transfer_fees().await.expect("get fees"); | ||
println!("asset fees {:?}", fees); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters