gbuiltin_eth_bridge/lib.rs
1// Copyright (C) Gear Technologies Inc.
2// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
3
4#![cfg_attr(not(feature = "std"), no_std)]
5
6extern crate alloc;
7
8use alloc::vec::Vec;
9use gprimitives::{H160, H256, U256};
10use parity_scale_codec::{Decode, Encode};
11use scale_info::TypeInfo;
12
13/// pallet-gear-eth-bridge builtin actor request types.
14#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, TypeInfo)]
15pub enum Request {
16 /// Send an Ethereum message to the specified `destination` address with the given `payload`.
17 #[codec(index = 0)]
18 SendEthMessage { destination: H160, payload: Vec<u8> },
19}
20
21/// pallet-gear-eth-bridge builtin actor response types.
22#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, TypeInfo)]
23pub enum Response {
24 /// Returned when an Ethereum message is successfully enqueued.
25 #[codec(index = 0)]
26 EthMessageQueued {
27 /// System block number when the message was enqueued.
28 block_number: u32,
29 /// Hash of the enqueued message.
30 hash: H256,
31 /// Nonce of the enqueued message.
32 nonce: U256,
33 /// ID of the queue where the message was enqueued.
34 queue_id: u64,
35 },
36}