Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable system calls from xcm & Refactoring emulated tests #1115

Merged
merged 36 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8d31f23
For integration tests
yrong Jan 16, 2024
a14e8a9
Merge branch 'main' into ron/more-integration-tests
yrong Jan 17, 2024
7844a14
Update sdk
yrong Jan 17, 2024
2f44a3b
Merge branch 'main' into ron/more-integration-tests
yrong Jan 22, 2024
40dcaa0
Refactoring Inbound fixture
yrong Jan 23, 2024
278752a
Add a separate crate for the fixtures
yrong Jan 23, 2024
db19328
Fix zepter
yrong Jan 23, 2024
8bc179b
Update sdk
yrong Jan 24, 2024
6600812
Regenerate inbound fixture
yrong Jan 24, 2024
c4c66dc
Fix generate execution update
yrong Jan 24, 2024
9e5a79c
Regenerate inbound fixture
yrong Jan 24, 2024
eb5fb16
Rename as register_token
yrong Jan 24, 2024
98b3758
Revert to wait by default
yrong Jan 24, 2024
7b1948a
Refactoring with const & fix the template
yrong Jan 24, 2024
054f965
Fix breaking test
yrong Jan 24, 2024
7feb668
Merge branch 'ron/refactoring-inbound-fixture' into ron/more-integrat…
yrong Jan 24, 2024
1da51e1
Add license header
yrong Jan 24, 2024
7faa581
Remove the alias type
yrong Jan 24, 2024
9d84921
Merge branch 'main' into ron/refactoring-inbound-fixture
yrong Jan 25, 2024
681a4e2
Improve error handling
yrong Jan 25, 2024
aec880f
Merge branch 'ron/refactoring-inbound-fixture' into ron/more-integrat…
yrong Jan 25, 2024
9008543
Update sdk
yrong Jan 25, 2024
4e19759
Update Cargo.lock
yrong Jan 25, 2024
5eb319d
Change recipient to BOB
yrong Jan 25, 2024
f1187f8
Update sdk
yrong Jan 25, 2024
84fb8e6
Update sdk
yrong Jan 25, 2024
824d300
Update sdk with more checks
yrong Jan 25, 2024
204924d
Cleanup
yrong Jan 25, 2024
cd6f10a
Merge branch 'main' into ron/more-integration-tests
yrong Jan 26, 2024
f1d5309
Merge branch 'main' into ron/more-integration-tests
yrong Jan 26, 2024
a70f668
Add fixture for insufficient fee
yrong Jan 26, 2024
69d632a
Test fixture for sending token to penpal
yrong Jan 26, 2024
4f9f56e
Revert change
yrong Jan 29, 2024
8b4b771
Merge branch 'main' into ron/more-integration-tests
yrong Jan 29, 2024
77b79b7
Fix typo
yrong Jan 29, 2024
47210e1
Update sdk
yrong Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parachain/pallets/ethereum-client/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub const MAX_EXTRA_DATA_BYTES: usize = 32;
pub const MAX_LOGS_BLOOM_SIZE: usize = 256;
pub const MAX_FEE_RECIPIENT_SIZE: usize = 20;

/// Sanity value to constain the max size of a merkle branch proof.
/// Sanity value to constrain the max size of a merkle branch proof.
pub const MAX_BRANCH_PROOF_SIZE: usize = 20;

/// DomainType('0x07000000')
Expand Down
2 changes: 2 additions & 0 deletions parachain/pallets/inbound-queue/fixtures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use snowbridge_core::inbound::Message;
use sp_core::RuntimeDebug;

pub mod register_token;
pub mod register_token_with_insufficient_fee;
pub mod send_token;
pub mod send_token_to_penpal;

#[derive(Clone, RuntimeDebug)]
pub struct InboundQueueFixture {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>
// Generated, do not edit!
// See ethereum client README.md for instructions to generate

use crate::InboundQueueFixture;
use hex_literal::hex;
use snowbridge_beacon_primitives::CompactExecutionHeader;
use snowbridge_core::inbound::{Log, Message, Proof};
use sp_std::vec;

pub fn make_register_token_with_infufficient_fee_message() -> InboundQueueFixture {
InboundQueueFixture {
execution_header: CompactExecutionHeader{
parent_hash: hex!("998e81dc6df788a920b67e058fbde0dc3f4ec6f11f3f7cd8c3148e6d99584885").into(),
block_number: 338,
state_root: hex!("30ef9c9db2609de19bbc6c3cbeddac889e82bbcb2db20304b3abdfbdc7134cbf").into(),
receipts_root: hex!("969335c3132a007cb8b5886a3c23dd8da63cba04aeda29857a86ee1c13dae782").into(),
},
message: Message {
event_log: Log {
address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(),
topics: vec![
hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(),
hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(),
hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(),
],
// insufficient xcm fee as only 1000(hex:e803)
data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7de8030000000000000000000000000000000000000000000000000000000000000000").into(),
},
proof: Proof {
block_hash: hex!("5976f37f0e331d194eb331df74355ef47565c3a1bd11c95a45b681f6917085c1").into(),
tx_index: 0,
data: (vec![
hex!("969335c3132a007cb8b5886a3c23dd8da63cba04aeda29857a86ee1c13dae782").to_vec(),
], vec![
hex!("f9028e822080b9028802f90284018301d205b9010000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000080000000000000000000000000000004000000000080000000000000000000000000000000000010100000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040004000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000200000000000010f90179f85894eda338e4dc46038493b885327842fd3e301cab39e1a0f78bb28d4b1d7da699e5c0bc2be29c2b04b5aab6aacf6298fe5304f9db9c6d7ea000000000000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7df9011c94eda338e4dc46038493b885327842fd3e301cab39f863a07153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84fa0c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539a05f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0b8a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7de8030000000000000000000000000000000000000000000000000000000000000000").to_vec(),
]),
},
},
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>
// Generated, do not edit!
// See ethereum client README.md for instructions to generate

use crate::InboundQueueFixture;
use hex_literal::hex;
use snowbridge_beacon_primitives::CompactExecutionHeader;
use snowbridge_core::inbound::{Log, Message, Proof};
use sp_std::vec;

pub fn make_send_token_to_penpal_message() -> InboundQueueFixture {
InboundQueueFixture {
execution_header: CompactExecutionHeader{
parent_hash: hex!("434148c290f27ee4be34fa344cd7608bf942a4541b27c9d868439631b3f37a8d").into(),
block_number: 816,
state_root: hex!("595e643f9095870e30e85e2bbef7d9e3a39df5aae839d26cf455d3dbf3e5a539").into(),
receipts_root: hex!("c40ab2c4abcfdea4f42195e0ad822806e5423108021c3b542646c7193319a6c1").into(),
},
message: Message {
event_log: Log {
address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(),
topics: vec![
hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(),
hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(),
hex!("c8eaf22f2cb07bac4679df0a660e7115ed87fcfd4e32ac269f6540265bbbd26f").into(),
],
data: hex!("00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000007300a736aa00000000000187d1f7fdfee7f651fabc8bfcb6e086c278b77a7d01d00700001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c00286bee000000000000000000000000000064a7b3b6e00d000000000000000000e40b5402000000000000000000000000000000000000000000000000").into(),
},
proof: Proof {
block_hash: hex!("6c49a7f8fb2014a23e58a949c95a6743174589a7ce83434b073dc05dec402f3d").into(),
tx_index: 0,
data: (vec![
hex!("c40ab2c4abcfdea4f42195e0ad822806e5423108021c3b542646c7193319a6c1").to_vec(),
], vec![
hex!("f90471822080b9046b02f90467018301d30fb9010000800000000000000000000000000000000000000000004000000000000000000400000000004000000000001000000010000000000000000000000008000000200000000000000001000008000000000000000000000000000000008000080000000000200000000000000000000000000100000000000000000011000000000000020000000000000000000000000000003000000000080018000000000000000000040044000021000000002000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000200820000000000f9035cf89b9487d1f7fdfee7f651fabc8bfcb6e086c278b77a7df863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000090a987b944cb1dcce5564e5fdecd7a54d3de27fea000000000000000000000000057a2d4ff0c3866d96556884bf09fecdd7ccd530ca00000000000000000000000000000000000000000000000000de0b6b3a7640000f9015d94eda338e4dc46038493b885327842fd3e301cab39f884a024c5d2de620c6e25186ae16f6919eba93b6e2c1a33857cc419d9f3a00d6967e9a000000000000000000000000090a987b944cb1dcce5564e5fdecd7a54d3de27fea000000000000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7da000000000000000000000000000000000000000000000000000000000000007d0b8c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000201cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07cf9015c94eda338e4dc46038493b885327842fd3e301cab39f863a07153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84fa0c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539a0c8eaf22f2cb07bac4679df0a660e7115ed87fcfd4e32ac269f6540265bbbd26fb8e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000007300a736aa00000000000187d1f7fdfee7f651fabc8bfcb6e086c278b77a7d01d00700001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c00286bee000000000000000000000000000064a7b3b6e00d000000000000000000e40b5402000000000000000000000000000000000000000000000000").to_vec(),
]),
},
},
}
}
2 changes: 1 addition & 1 deletion relayer/cmd/generate_beacon_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func generateBeaconTestFixture(cmd *cobra.Command, _ []string) error {
if err != nil {
return err
}
if testCase != "register_token" || testCase != "send_token" {
if testCase != "register_token" && testCase != "send_token" {
return fmt.Errorf("invalid test case: %s", testCase)
}
pathToInboundQueueFixtureTemplate := fmt.Sprintf(pathToInboundQueueFixtureTemplate, testCase)
Expand Down
Loading