-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
7 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
//! Implementation for [`frame_support::traits::ProcessMessage`] | ||
use super::*; | ||
use crate::weights::WeightInfo; | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
//! Implementation for [`snowbridge_core::outbound::SendMessage`] | ||
use super::*; | ||
use bridge_hub_common::AggregateMessageOrigin; | ||
|
@@ -15,7 +17,6 @@ use snowbridge_core::{ | |
}, | ||
ChannelId, PRIMARY_GOVERNANCE_CHANNEL, | ||
}; | ||
use sp_arithmetic::traits::Zero; | ||
use sp_core::H256; | ||
use sp_runtime::BoundedVec; | ||
|
||
|
@@ -58,14 +59,7 @@ where | |
.unwrap_or_else(|| unique((message.channel_id, &message.command)).into()); | ||
|
||
let gas_used_at_most = T::GasMeter::maximum_gas_used_at_most(&message.command); | ||
ensure!( | ||
gas_used_at_most > T::GasMeter::MAXIMUM_BASE_GAS && | ||
gas_used_at_most < T::GasMeter::MAXIMUM_GAS_CAP, | ||
SendError::MessageInvalidGasFees | ||
); | ||
let fee = Self::calculate_fee(gas_used_at_most, T::PricingParameters::get()); | ||
let zero_fee = <Self as SendMessageFeeProvider>::Balance::zero(); | ||
ensure!(fee.local > zero_fee && fee.remote > zero_fee, SendError::MessageInvalidGasFees); | ||
|
||
let queued_message: VersionedQueuedMessage = QueuedMessage { | ||
id: message_id, | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
use codec::{Decode, Encode}; | ||
use ethabi::Token; | ||
use frame_support::traits::ProcessMessage; | ||
|
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