From 8c54750e21fc5ef847dc06674f7056a2ee02fef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 10 Jan 2024 09:59:21 +0200 Subject: [PATCH] Bridge-proxy: transform args to ManagedVec Adjust tests --- .../batch_transfer_both_executed.scen.json | 4 ++-- .../batch_transfer_both_failed.scen.json | 4 ++-- ..._transfer_one_executed_one_failed.scen.json | 4 ++-- .../batch_transfer_to_frozen_account.scen.json | 4 ++-- .../batch_transfer_with_wrapping.scen.json | 6 +++--- .../scenarios/transfer_ok.scen.json | 2 +- .../two_transfers_same_token.scen.json | 4 ++-- .../tests/multi_transfer_blackbox_test.rs | 4 +++- ...thereum_to_multiversx_tx_batch_ok.scen.json | 10 ++++++---- ...m_to_multiversx_tx_batch_rejected.scen.json | 18 +++++++++++++----- 10 files changed, 36 insertions(+), 24 deletions(-) diff --git a/multi-transfer-esdt/scenarios/batch_transfer_both_executed.scen.json b/multi-transfer-esdt/scenarios/batch_transfer_both_executed.scen.json index b4417975..c708c2bd 100644 --- a/multi-transfer-esdt/scenarios/batch_transfer_both_executed.scen.json +++ b/multi-transfer-esdt/scenarios/batch_transfer_both_executed.scen.json @@ -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" diff --git a/multi-transfer-esdt/scenarios/batch_transfer_both_failed.scen.json b/multi-transfer-esdt/scenarios/batch_transfer_both_failed.scen.json index 9b6d48e1..1329c6f4 100644 --- a/multi-transfer-esdt/scenarios/batch_transfer_both_failed.scen.json +++ b/multi-transfer-esdt/scenarios/batch_transfer_both_failed.scen.json @@ -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" diff --git a/multi-transfer-esdt/scenarios/batch_transfer_one_executed_one_failed.scen.json b/multi-transfer-esdt/scenarios/batch_transfer_one_executed_one_failed.scen.json index b6420639..562c799e 100644 --- a/multi-transfer-esdt/scenarios/batch_transfer_one_executed_one_failed.scen.json +++ b/multi-transfer-esdt/scenarios/batch_transfer_one_executed_one_failed.scen.json @@ -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" diff --git a/multi-transfer-esdt/scenarios/batch_transfer_to_frozen_account.scen.json b/multi-transfer-esdt/scenarios/batch_transfer_to_frozen_account.scen.json index dcf91222..9735e012 100644 --- a/multi-transfer-esdt/scenarios/batch_transfer_to_frozen_account.scen.json +++ b/multi-transfer-esdt/scenarios/batch_transfer_to_frozen_account.scen.json @@ -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" diff --git a/multi-transfer-esdt/scenarios/batch_transfer_with_wrapping.scen.json b/multi-transfer-esdt/scenarios/batch_transfer_with_wrapping.scen.json index c08275c1..22d53384 100644 --- a/multi-transfer-esdt/scenarios/batch_transfer_with_wrapping.scen.json +++ b/multi-transfer-esdt/scenarios/batch_transfer_with_wrapping.scen.json @@ -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" diff --git a/multi-transfer-esdt/scenarios/transfer_ok.scen.json b/multi-transfer-esdt/scenarios/transfer_ok.scen.json index 4768ca5e..2277c198 100644 --- a/multi-transfer-esdt/scenarios/transfer_ok.scen.json +++ b/multi-transfer-esdt/scenarios/transfer_ok.scen.json @@ -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" diff --git a/multi-transfer-esdt/scenarios/two_transfers_same_token.scen.json b/multi-transfer-esdt/scenarios/two_transfers_same_token.scen.json index 02d29c99..d58f4972 100644 --- a/multi-transfer-esdt/scenarios/two_transfers_same_token.scen.json +++ b/multi-transfer-esdt/scenarios/two_transfers_same_token.scen.json @@ -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" diff --git a/multi-transfer-esdt/tests/multi_transfer_blackbox_test.rs b/multi-transfer-esdt/tests/multi_transfer_blackbox_test.rs index f3bc4471..65e94c94 100644 --- a/multi-transfer-esdt/tests/multi_transfer_blackbox_test.rs +++ b/multi-transfer-esdt/tests/multi_transfer_blackbox_test.rs @@ -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; @@ -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( @@ -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( diff --git a/multisig/scenarios/ethereum_to_multiversx_tx_batch_ok.scen.json b/multisig/scenarios/ethereum_to_multiversx_tx_batch_ok.scen.json index 661f068a..81310661 100644 --- a/multisig/scenarios/ethereum_to_multiversx_tx_batch_ok.scen.json +++ b/multisig/scenarios/ethereum_to_multiversx_tx_batch_ok.scen.json @@ -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" @@ -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", @@ -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" } ] }, diff --git a/multisig/scenarios/ethereum_to_multiversx_tx_batch_rejected.scen.json b/multisig/scenarios/ethereum_to_multiversx_tx_batch_rejected.scen.json index 78396eba..1c1076c6 100644 --- a/multisig/scenarios/ethereum_to_multiversx_tx_batch_rejected.scen.json +++ b/multisig/scenarios/ethereum_to_multiversx_tx_batch_rejected.scen.json @@ -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" @@ -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" @@ -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" @@ -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", @@ -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" } ] },