Skip to content

Commit

Permalink
Rename constant to what bridge relayers expect (#237)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe what change this PR is implementing -->

### Types of Changes
<!--- What types of changes does your code introduce? -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Dependency upgrade (A change in substrate or any 3rd party crate
version)

### Migrations and Hooks
<!--- Check the following box with an x if the following applies: -->
- [ ] This change requires a runtime migration.
- [ ] Modifies `on_initialize`
- [ ] Modifies `on_finalize`

### Checklist
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [x] Change has been tested locally.
- [ ] Change adds / updates tests.
- [ ] Changelog doc updated.
  • Loading branch information
MRamanenkau authored Jan 17, 2024
1 parent b4d2535 commit 590ab3d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pallets/chainbridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub mod pallet {
/// This must be unique and must not collide with existing IDs within a set of bridged
/// chains.
#[pallet::constant]
type ChainId: Get<ChainId>;
type ChainIdentity: Get<ChainId>;

#[pallet::constant]
type ProposalLifetime: Get<<Self as frame_system::Config>::BlockNumber>;
Expand Down Expand Up @@ -482,7 +482,7 @@ pub mod pallet {
/// Whitelist a chain ID for transfer
pub fn whitelist(id: ChainId) -> DispatchResult {
// Cannot whitelist this chain
ensure!(id != T::ChainId::get(), Error::<T>::InvalidChainId);
ensure!(id != T::ChainIdentity::get(), Error::<T>::InvalidChainId);
// Cannot whitelist with an existing entry
ensure!(!Self::chain_whitelisted(id), Error::<T>::ChainAlreadyWhitelisted);
<ChainNonces<T>>::insert(id, 0);
Expand Down
2 changes: 1 addition & 1 deletion pallets/chainbridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl crate::pallet::Config for Test {
type RuntimeEvent = RuntimeEvent;
type AdminOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Proposal = RuntimeCall;
type ChainId = TestChainId;
type ChainIdentity = TestChainId;
type ProposalLifetime = ProposalLifetime;
type BridgeAccountId = BridgeAccountId;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/erc20/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl bridge::Config for Test {
type Event = Event;
type AdminOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Proposal = Call;
type ChainId = TestChainId;
type ChainIdentity = TestChainId;
type ProposalLifetime = ProposalLifetime;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/cere-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ impl pallet_chainbridge::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AdminOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Proposal = RuntimeCall;
type ChainId = ChainId;
type ChainIdentity = ChainId;
type ProposalLifetime = ProposalLifetime;
type BridgeAccountId = BridgeAccountId;
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ impl pallet_chainbridge::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AdminOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Proposal = RuntimeCall;
type ChainId = ChainId;
type ChainIdentity = ChainId;
type ProposalLifetime = ProposalLifetime;
type BridgeAccountId = BridgeAccountId;
}
Expand Down

0 comments on commit 590ab3d

Please sign in to comment.