forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
29 additions
and
514 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 |
---|---|---|
|
@@ -2,14 +2,14 @@ | |
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
use snowbridge_core::inbound::Log; | ||
|
||
use sp_core::{RuntimeDebug, H160, H256}; | ||
use sp_core::{RuntimeDebug, H160}; | ||
use sp_std::prelude::*; | ||
|
||
use alloy_primitives::B256; | ||
use alloy_sol_types::{sol, SolEvent}; | ||
|
||
sol! { | ||
event OutboundMessageAccepted(uint64 indexed nonce, bytes32 indexed message_id, uint32 indexed para_id, bytes32 reward_address, uint128 fee, bytes payload); | ||
event OutboundMessageAccepted(uint64 indexed nonce, uint128 fee, bytes32 reward_address, bytes payload); | ||
} | ||
|
||
/// An inbound message that has had its outer envelope decoded. | ||
|
@@ -19,14 +19,10 @@ pub struct Envelope { | |
pub gateway: H160, | ||
/// A nonce for enforcing replay protection and ordering. | ||
pub nonce: u64, | ||
/// An id for tracing the message on its route (has no role in bridge consensus) | ||
pub message_id: H256, | ||
/// Destination ParaId | ||
pub para_id: u32, | ||
/// The reward address | ||
pub reward_address: [u8; 32], | ||
/// Total fee paid on source chain | ||
pub fee: u128, | ||
/// The reward address | ||
pub reward_address: [u8; 32], | ||
/// The inner payload generated from the source application. | ||
pub payload: Vec<u8>, | ||
} | ||
|
@@ -46,10 +42,8 @@ impl TryFrom<&Log> for Envelope { | |
Ok(Self { | ||
gateway: log.address, | ||
nonce: event.nonce, | ||
message_id: H256::from(event.message_id.as_ref()), | ||
reward_address: event.reward_address.clone().into(), | ||
fee: event.fee, | ||
para_id: event.para_id, | ||
reward_address: event.reward_address.clone().into(), | ||
payload: event.payload, | ||
}) | ||
} | ||
|
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
Oops, something went wrong.