Skip to content

Commit

Permalink
Bridge-proxy: transform args to ManagedVec
Browse files Browse the repository at this point in the history
Adjust tests
  • Loading branch information
CostinCarabas committed Jan 10, 2024
1 parent ba6292b commit 8c54750
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000",
"0x0102030405060708091011121314151617181920|address:user2|nested:str:WRAPPED-123456|biguint:500|u64:2|nested:str:data|u64:10000000"
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000|nested:0",
"0x0102030405060708091011121314151617181920|address:user2|nested:str:WRAPPED-123456|biguint:500|u64:2|nested:str:data|u64:10000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|sc:multi_transfer_esdt|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:2000000",
"0x0102030405060708091011121314151617181920|sc:multi_transfer_esdt|nested:str:WRAPPED-123456|biguint:100,500|u64:2|nested:str:data|u64:2000000"
"0x0102030405060708091011121314151617181920|sc:multi_transfer_esdt|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:2000000|nested:0",
"0x0102030405060708091011121314151617181920|sc:multi_transfer_esdt|nested:str:WRAPPED-123456|biguint:100,500|u64:2|nested:str:data|u64:2000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:1000000",
"0x0102030405060708091011121314151617181920|sc:multi_transfer_esdt|nested:str:WRAPPED-123456|biguint:500|u64:2|nested:str:data|u64:1000000"
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:1000000|nested:0",
"0x0102030405060708091011121314151617181920|sc:multi_transfer_esdt|nested:str:WRAPPED-123456|biguint:500|u64:2|nested:str:data|u64:1000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000",
"0x0102030405060708091011121314151617181920|address:frozen_user|nested:str:BRIDGE-123456|biguint:500|u64:2|nested:str:data|u64:10000000"
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000|nested:0",
"0x0102030405060708091011121314151617181920|address:frozen_user|nested:str:BRIDGE-123456|biguint:500|u64:2|nested:str:data|u64:10000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:2000000",
"0x0102030405060708091011121314151617181920|address:user2|nested:str:USDC-aaaaaa|biguint:500,000,000,000,000|u64:2|nested:str:data|u64:2000000",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:USDC-cccccc|biguint:1,000,000,000,000,000|u64:3|nested:str:data|u64:2000000"
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:2000000|nested:0",
"0x0102030405060708091011121314151617181920|address:user2|nested:str:USDC-aaaaaa|biguint:500,000,000,000,000|u64:2|nested:str:data|u64:2000000|nested:0",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:USDC-cccccc|biguint:1,000,000,000,000,000|u64:3|nested:str:data|u64:2000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
2 changes: 1 addition & 1 deletion multi-transfer-esdt/scenarios/transfer_ok.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000"
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"function": "batchTransferEsdtToken",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:2|nested:str:data|u64:10000000"
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:1|nested:str:data|u64:10000000|nested:0",
"0x0102030405060708091011121314151617181920|address:user1|nested:str:BRIDGE-123456|biguint:100,200|u64:2|nested:str:data|u64:10000000|nested:0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down
4 changes: 3 additions & 1 deletion multi-transfer-esdt/tests/multi_transfer_blackbox_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use multiversx_sc::{
storage::mappers::SingleValue,
types::{
Address, BigUint, CodeMetadata, ManagedAddress, ManagedBuffer, ManagedByteArray,
MultiValueEncoded, TokenIdentifier,
MultiValueEncoded, TokenIdentifier, ManagedVec,
},
};
use multiversx_sc_modules::pause::ProxyTrait;
Expand Down Expand Up @@ -279,6 +279,7 @@ fn basic_setup_test() {
tx_nonce: 1u64,
data: ManagedBuffer::from("data"),
gas_limit: GAS_LIMIT,
args: ManagedVec::new()
};

test.world.check_state_step(
Expand Down Expand Up @@ -315,6 +316,7 @@ fn basic_transfer_test() {
tx_nonce: 1u64,
data: ManagedBuffer::from("data"),
gas_limit: GAS_LIMIT,
args: ManagedVec::new()
};

test.world.check_state_step(
Expand Down
10 changes: 6 additions & 4 deletions multisig/scenarios/ethereum_to_multiversx_tx_batch_ok.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"function": "proposeMultiTransferEsdtBatch",
"arguments": [
"1",
"0x0102030405060708091011121314151617181920", "address:user", "str:WEGLD-123456", "76,000,000,000", "1", "str:data", "u64:20000000",
"0x0102030405060708091011121314151617181920", "address:user", "str:ETH-123456", "76,000,000,000", "2", "str:data", "u64:20000000"
"0x0102030405060708091011121314151617181920", "address:user", "str:WEGLD-123456", "76,000,000,000", "1", "str:data", "u64:20000000", "0",
"0x0102030405060708091011121314151617181920", "address:user", "str:ETH-123456", "76,000,000,000", "2", "str:data", "u64:20000000", "0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down Expand Up @@ -50,7 +50,8 @@
"4-amount": "biguint:76,000,000,000",
"5-tx_nonce": "u64:1",
"6-data": "nested:str:data",
"7-gas_limit": "u64:20000000"
"7-gas_limit": "u64:20000000",
"8-args": "nested:0"
},
{
"1-from": "0x0102030405060708091011121314151617181920",
Expand All @@ -59,7 +60,8 @@
"4-amount": "biguint:76,000,000,000",
"5-tx_nonce": "u64:2",
"6-data": "nested:str:data",
"7-gas_limit": "u64:20000000"
"7-gas_limit": "u64:20000000",
"8-args": "nested:0"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
"str:data",
"u64:2,000,000",
"u64:1",
"0",
"0x0102030405060708091011121314151617181920",
"sc:egld_esdt_swap",
"str:ETH-123456",
"76,000,000,000",
"u64:2",
"str:data",
"u64:2,000,000"
"u64:2,000,000",
"0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down Expand Up @@ -58,13 +60,15 @@
"u64:2",
"str:data",
"u64:2,000,000",
"0",
"0x0102030405060708091011121314151617181920",
"sc:egld_esdt_swap",
"str:ETH-123456",
"76,000,000,000",
"u64:3",
"str:data",
"u64:2,000,000"
"u64:2,000,000",
"0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down Expand Up @@ -94,13 +98,15 @@
"u64:1",
"str:data",
"u64:2,000,000",
"0",
"0x0102030405060708091011121314151617181920",
"sc:egld_esdt_swap",
"str:ETH-123456",
"76,000,000,000",
"u64:2",
"str:data",
"u64:2,000,000"
"u64:2,000,000",
"0"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
Expand Down Expand Up @@ -134,7 +140,8 @@
"4-amount": "biguint:76,000,000,000",
"5-tx_id": "u64:1",
"6-data": "nested:str:data",
"7-gas_limit": "u64:2,000,000"
"7-gas_limit": "u64:2,000,000",
"8-args": "nested:0"
},
{
"1-from": "0x0102030405060708091011121314151617181920",
Expand All @@ -143,7 +150,8 @@
"4-amount": "biguint:76,000,000,000",
"5-tx_id": "u64:2",
"6-data": "nested:str:data",
"7-gas_limit": "u64:2,000,000"
"7-gas_limit": "u64:2,000,000",
"8-args": "nested:0"
}
]
},
Expand Down

0 comments on commit 8c54750

Please sign in to comment.