Skip to content

Commit

Permalink
Move governance origin to V2 package
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Oct 23, 2024
1 parent a0deaba commit 850fe96
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/outbound-queue-v2/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use snowbridge_core::{
meth,
outbound::v2::*,
pricing::{PricingParameters, Rewards},
primary_governance_origin, ParaId,
ParaId,
};
use sp_core::{ConstU32, H160, H256};
use sp_runtime::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ use frame_support::{
ensure,
traits::{EnqueueMessage, Get},
};
use snowbridge_core::{
outbound::v2::{Message, SendError, SendMessage, SendMessageFeeProvider},
primary_governance_origin,
use snowbridge_core::outbound::v2::{
primary_governance_origin, Message, SendError, SendMessage, SendMessageFeeProvider,
};
use sp_core::H256;
use sp_runtime::BoundedVec;
Expand Down
4 changes: 2 additions & 2 deletions bridges/snowbridge/pallets/outbound-queue-v2/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use frame_support::{

use codec::Encode;
use snowbridge_core::{
outbound::v2::{Command, SendError, SendMessage},
primary_governance_origin, ChannelId, ParaId,
outbound::v2::{primary_governance_origin, Command, SendError, SendMessage},
ChannelId, ParaId,
};
use sp_core::H256;

Expand Down
10 changes: 0 additions & 10 deletions bridges/snowbridge/primitives/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,3 @@ impl Default for AssetMetadata {

/// Maximum length of a string field in ERC20 token metada
const METADATA_FIELD_MAX_LEN: u32 = 32;

// Origin for high-priority governance commands
pub fn primary_governance_origin() -> H256 {
hex!("0000000000000000000000000000000000000000000000000000000000000001").into()
}

// Origin for lower-priority governance commands
pub fn second_governance_origin() -> H256 {
hex!("0000000000000000000000000000000000000000000000000000000000000002").into()
}
11 changes: 11 additions & 0 deletions bridges/snowbridge/primitives/core/src/outbound/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::outbound::OperatingMode;
use codec::{Decode, Encode};
use ethabi::Token;
use frame_support::{pallet_prelude::ConstU32, BoundedVec, PalletError};
use hex_literal::hex;
use scale_info::TypeInfo;
use sp_arithmetic::traits::{BaseArithmetic, Unsigned};
use sp_core::{RuntimeDebug, H160, H256, U256};
Expand Down Expand Up @@ -300,3 +301,13 @@ impl GasMeter for () {
1
}
}

// Origin for high-priority governance commands
pub fn primary_governance_origin() -> H256 {
hex!("0000000000000000000000000000000000000000000000000000000000000001").into()
}

// Origin for lower-priority governance commands
pub fn second_governance_origin() -> H256 {
hex!("0000000000000000000000000000000000000000000000000000000000000002").into()
}

0 comments on commit 850fe96

Please sign in to comment.