-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for bidirectional routers (#1958)
* base implementation * correct router_id representation * router support * remove axelar receiver * add mock for axelar-router * correct sender account * fixes from reviews * add account code checker * runtime changes to compile, part 1 * required changes for gateway (#1959) * centrifuge-runtime compiling * development and altair compiling * trying to compile it * compiling with no-std * fix restricted transfers * remove unused mocks * cargo fmt & taplo fmt * fix queue tests * added IT router tests * add UTs for axelar-router * remove old crates * fix lp tests * fix comments
- Loading branch information
Showing
45 changed files
with
1,327 additions
and
1,970 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#[frame_support::pallet(dev_mode)] | ||
pub mod pallet { | ||
use cfg_traits::ethereum::EthereumTransactor; | ||
use frame_support::pallet_prelude::*; | ||
use mock_builder::{execute_call, register_call}; | ||
use sp_core::{H160, U256}; | ||
|
||
#[pallet::config] | ||
pub trait Config: frame_system::Config {} | ||
|
||
#[pallet::pallet] | ||
pub struct Pallet<T>(_); | ||
|
||
#[pallet::storage] | ||
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>; | ||
|
||
impl<T: Config> Pallet<T> { | ||
pub fn mock_call( | ||
func: impl Fn(H160, H160, &[u8], U256, U256, U256) -> DispatchResultWithPostInfo + 'static, | ||
) { | ||
register_call!(move |(a, b, c, d, e, f)| func(a, b, c, d, e, f)); | ||
} | ||
} | ||
|
||
impl<T: Config> EthereumTransactor for Pallet<T> { | ||
fn call( | ||
a: H160, | ||
b: H160, | ||
c: &[u8], | ||
d: U256, | ||
e: U256, | ||
f: U256, | ||
) -> DispatchResultWithPostInfo { | ||
execute_call!((a, b, c, d, e, f)) | ||
} | ||
} | ||
} |
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.