Skip to content

Commit 1e537bb

Browse files
committed
chore: generate rust bindings from source contract
1 parent 6695578 commit 1e537bb

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

metabased-sequencer/interceptor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
async-trait = "0.1"
8-
alloy = { version = "0.4.2", features = ["full"] }
8+
alloy = { version = "0.5.4", features = ["full"] }
99
dotenv = "0.15"
1010
figment = { version = "0.10", features = ["env"] }
1111
jsonrpsee = { version = "0.24.3", features = ["full"] }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
mod sol;
22

33
pub use sol::SolMetabasedSequencerChainService;
4+
use alloy::sol;
5+
sol!(
6+
#[sol(rpc)]
7+
"../../metabased-contracts/src/MetabasedSequencerChain.sol"
8+
);
9+
pub use MetabasedSequencerChain as MetabasedSequencerChainInstance;

metabased-sequencer/interceptor/src/infrastructure/sol.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
use crate::domain::primitives::{Address, Bytes};
22
use crate::domain::MetabasedSequencerChainService;
3-
use crate::infrastructure::sol::MetabasedSequencerChain::MetabasedSequencerChainInstance;
43
use alloy::network::Network;
54
use alloy::providers::Provider;
6-
use alloy::sol;
75
use alloy::transports::Transport;
86
use async_trait::async_trait;
97
use std::marker::PhantomData;
10-
11-
sol! {
12-
#[derive(Debug, PartialEq, Eq)]
13-
#[sol(rpc)]
14-
contract MetabasedSequencerChain {
15-
event TransactionProcessed(address indexed sender, bytes encodedTxn);
16-
error InvalidTransactionForm();
17-
function emitTransactionProcessed(bytes calldata encodedTxn) public;
18-
function processTransaction(bytes calldata encodedTxn) public;
19-
function processBulkTransactions(bytes[] calldata encodedTxns) public;
20-
}
21-
}
8+
use crate::infrastructure::MetabasedSequencerChain::MetabasedSequencerChainInstance;
229

2310
#[derive(Debug)]
2411
pub struct SolMetabasedSequencerChainService<P: Provider<T, N>, T: Transport + Clone, N: Network> {
@@ -41,7 +28,7 @@ impl<P: Provider<T, N>, T: Transport + Clone, N: Network>
4128
}
4229

4330
pub fn contract(&self) -> MetabasedSequencerChainInstance<T, &P, N> {
44-
MetabasedSequencerChain::new(self.account, &self.provider)
31+
MetabasedSequencerChainInstance::new(self.account, &self.provider)
4532
}
4633
}
4734

0 commit comments

Comments
 (0)