Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Nov 9, 2023
1 parent 0c142db commit b971a09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::*;
use hex_literal::hex;
use integration_tests_common::{AssetHubRococoPallet, BridgeHubRococoPallet};
Expand All @@ -25,6 +24,8 @@ const CHAIN_ID: u64 = 15;
const DEST_PARA_ID: u32 = 1000;
const SNOWBRIDGE_SOVEREIGN: [u8; 32] =
hex!("da4d66c3651dc151264eee5460493210338e41a7bbfca91a520e438daf180bf5");
const TREASURY_ACCOUNT: [u8; 32] =
hex!("6d6f646c70792f74727372790000000000000000000000000000000000000000");
const WETH: [u8; 20] = hex!("87d1f7fdfEe7f651FaBc8bFCB6E086C278b77A7d");
const ASSETHUB_SOVEREIGN: [u8; 32] =
hex!("7369626ce8030000000000000000000000000000000000000000000000000000");
Expand Down Expand Up @@ -390,7 +391,7 @@ fn reserve_transfer_token() {
events.iter().find(|&event| matches!(
event,
RuntimeEvent::Balances(pallet_balances::Event::Deposit{ who, amount })
if *who == SNOWBRIDGE_SOVEREIGN.into() && *amount == 16903333
if *who == TREASURY_ACCOUNT.into() && *amount == 16903333
))
.is_some(),
"Snowbridge sovereign takes local fee."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ use pallet_xcm::EnsureXcm;
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm::VersionedMultiLocation;
use xcm_config::{SnowbridgeTreasuryAccount, XcmConfig, XcmOriginToTransactDispatchOrigin};
use xcm_config::{TreasuryAccount, XcmConfig, XcmOriginToTransactDispatchOrigin};

use bp_runtime::HeaderId;

Expand Down Expand Up @@ -618,7 +618,7 @@ impl snowbridge_control::Config for Runtime {
type MessageHasher = BlakeTwo256;
type SiblingOrigin = EnsureXcm<AllowSiblingsOnly>;
type AgentIdOf = xcm_config::AgentIdOf;
type TreasuryAccount = SnowbridgeTreasuryAccount;
type TreasuryAccount = TreasuryAccount;
type Token = Balances;
type WeightInfo = weights::snowbridge_control::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,10 @@ use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use rococo_runtime_constants::system_parachain::SystemParachains;
use snowbridge_core::{
outbound::SendMessageFee,
outbound::SendMessageFeeProvider,
sibling_sovereign_account_raw
};
use snowbridge_router_primitives::{
inbound::GlobalConsensusEthereumConvertsFor,
outbound::EthereumBlobExporter,
};
use snowbridge_router_primitives:: outbound::EthereumBlobExporter;
use sp_core::{Get, H256};
use sp_runtime::traits::AccountIdConversion;
use sp_std::marker::PhantomData;
Expand Down Expand Up @@ -91,7 +88,6 @@ parameter_types! {
// Network and location for the local Ethereum testnet.
pub const EthereumChainId: u64 = 15;
pub const EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: EthereumChainId::get() };
pub SnowbridgeTreasuryAccount: AccountId = GlobalConsensusEthereumConvertsFor::<AccountId>::from_chain_id(&EthereumChainId::get()).into();
}

/// Adapter for resolving `NetworkId` based on `pub storage Flavor: RuntimeFlavor`.
Expand Down Expand Up @@ -329,7 +325,7 @@ impl xcm_executor::Config for XcmConfig {
XcmExportFeeToSnowbridge<
TokenLocation,
EthereumNetwork,
SnowbridgeTreasuryAccount,
TreasuryAccount,
Self::AssetTransactor,
crate::EthereumOutboundQueue,
>,
Expand Down Expand Up @@ -612,7 +608,7 @@ impl<
EthereumNetwork: Get<NetworkId>,
ReceiverAccount: Get<AccountId>,
AssetTransactor: TransactAsset,
OutboundQueue: SendMessageFee<Balance = bp_rococo::Balance>,
OutboundQueue: SendMessageFeeProvider<Balance = bp_rococo::Balance>,
> HandleFee
for XcmExportFeeToSnowbridge<
TokenLocation,
Expand Down

0 comments on commit b971a09

Please sign in to comment.