Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos-rebegea committed Oct 18, 2024
1 parent cd453f0 commit ef221a3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
5 changes: 4 additions & 1 deletion bridge-proxy/sc-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
path = "../multi-transfer-esdt/src/bridge_proxy_contract_proxy.rs"

[[proxy]]
path = "../multisig/src/bridge_proxy_contract_proxy.rs"
path = "../multisig/src/bridge_proxy_contract_proxy.rs"

[[proxy]]
path = "./src/bridge_proxy_contract_proxy.rs"
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@
],
"function": "deposit",
"arguments": [
"0x30313032303330343035303630373038303931300000000000000000050063726f7766756e64696e675f5f5f5f5f5f5f5f5f5f5f0000000d4252494447452d3132333435360000000201f4000000000000000101000000150000000466756e6400000000009896800100000000"
"0x30313032303330343035303630373038303931300000000000000000050063726f7766756e64696e675f5f5f5f5f5f5f5f5f5f5f0000000d4252494447452d3132333435360000000201f4000000000000000101000000150000000466756e6400000000009896800100000000",
"0x01"
],
"gasLimit": "5,000,000"
},
Expand Down
11 changes: 5 additions & 6 deletions bridge-proxy/src/bridge_proxy_contract_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ where
{
pub fn deposit<
Arg0: ProxyArg<transaction::EthTransaction<Env::Api>>,
Arg1: ProxyArg<u64>,
>(
self,
eth_tx: Arg0,
batch_id: Arg1,
) -> TxTypedCall<Env, From, To, (), Gas, ()> {
self.wrapped_tx
.raw_call("deposit")
.argument(&eth_tx)
.argument(&batch_id)
.original_result()
}

Expand All @@ -110,16 +113,12 @@ where
.original_result()
}

pub fn cancel<
Arg0: ProxyArg<usize>,
>(
pub fn update_lowest_tx_id(
self,
tx_id: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("cancel")
.argument(&tx_id)
.raw_call("updateLowestTxId")
.original_result()
}

Expand Down
8 changes: 4 additions & 4 deletions bridge-proxy/tests/bridge_proxy_blackbox_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ fn bridge_proxy_execute_crowdfunding_test() {
.from(MULTI_TRANSFER_ADDRESS)
.to(BRIDGE_PROXY_ADDRESS)
.typed(bridge_proxy_contract_proxy::BridgeProxyContractProxy)
.deposit(&eth_tx)
.deposit(&eth_tx, 1u64)
.egld_or_single_esdt(
&EgldOrEsdtTokenIdentifier::esdt(BRIDGE_TOKEN_ID),
0,
Expand Down Expand Up @@ -352,7 +352,7 @@ fn multiple_deposit_test() {
.from(MULTI_TRANSFER_ADDRESS)
.to(BRIDGE_PROXY_ADDRESS)
.typed(bridge_proxy_contract_proxy::BridgeProxyContractProxy)
.deposit(&eth_tx1)
.deposit(&eth_tx1, 1u64)
.single_esdt(
&TokenIdentifier::from(BRIDGE_TOKEN_ID),
0u64,
Expand All @@ -365,7 +365,7 @@ fn multiple_deposit_test() {
.from(MULTI_TRANSFER_ADDRESS)
.to(BRIDGE_PROXY_ADDRESS)
.typed(bridge_proxy_contract_proxy::BridgeProxyContractProxy)
.deposit(&eth_tx2)
.deposit(&eth_tx2, 1u64)
.single_esdt(
&TokenIdentifier::from(BRIDGE_TOKEN_ID),
0u64,
Expand Down Expand Up @@ -464,7 +464,7 @@ fn test_lowest_tx_id() {
.from(MULTI_TRANSFER_ADDRESS)
.to(BRIDGE_PROXY_ADDRESS)
.typed(bridge_proxy_contract_proxy::BridgeProxyContractProxy)
.deposit(tx)
.deposit(tx, 1u64)
.single_esdt(
&TokenIdentifier::from(BRIDGE_TOKEN_ID),
0u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"arguments": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000005006d756c74692d7472616e736665725f5f5f5f5f5f5f5f",
"0x000000000000000005006272696467652d70726f78795f5f5f5f5f5f5f5f5f5f",
"0x0249f0"
],
"gasLimit": "5,000,000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"arguments": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000005006d756c74692d7472616e736665725f5f5f5f5f5f5f5f",
"0x000000000000000005006272696467652d70726f78795f5f5f5f5f5f5f5f5f5f",
"0x0249f0"
],
"gasLimit": "5,000,000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"arguments": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000005006d756c74692d7472616e736665725f5f5f5f5f5f5f5f",
"0x000000000000000005006272696467652d70726f78795f5f5f5f5f5f5f5f5f5f",
"0x0249f0"
],
"gasLimit": "5,000,000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"arguments": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000005006d756c74692d7472616e736665725f5f5f5f5f5f5f5f",
"0x000000000000000005006272696467652d70726f78795f5f5f5f5f5f5f5f5f5f",
"0x0249f0"
],
"gasLimit": "5,000,000"
Expand Down

0 comments on commit ef221a3

Please sign in to comment.