Skip to content

Commit

Permalink
- new contracts
Browse files Browse the repository at this point in the history
- made the tests fail if a transaction sent through the test mvxHandler fails
  • Loading branch information
iulianpascalau committed Sep 26, 2024
1 parent e387d46 commit 22440b2
Show file tree
Hide file tree
Showing 14 changed files with 144 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,15 @@ func (instance *chainSimulatorWrapper) DeploySC(ctx context.Context, wasmFilePat
func (instance *chainSimulatorWrapper) getTransactionResult(ctx context.Context, hash string) *data.TransactionOnNetwork {
instance.GenerateBlocksUntilTxProcessed(ctx, hash)

txResult, errGet := instance.proxyInstance.GetTransactionInfoWithResults(ctx, hash)
require.Nil(instance, errGet)
txResult, err := instance.proxyInstance.GetTransactionInfoWithResults(ctx, hash)
require.Nil(instance, err)

txStatus, err := instance.proxyInstance.ProcessTransactionStatus(ctx, hash)
require.Nil(instance, err)

jsonData, err := json.MarshalIndent(txResult.Data.Transaction, "", " ")
require.Nil(instance, err)
require.Equal(instance, transaction.TxStatusSuccess, txStatus, fmt.Sprintf("tx hash: %s,\n tx: %s", hash, string(jsonData)))

return &txResult.Data.Transaction
}
Expand Down
19 changes: 17 additions & 2 deletions integrationTests/relayers/slowTests/framework/multiversxHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const (
submitBatchFunction = "submitBatch"
createTransactionFunction = "createTransaction"
unwrapTokenFunction = "unwrapToken"
setupBridgedTokenWrapperFunction = "setBridgedTokensWrapper"
setBridgedTokensWrapperAddressFunction = "setBridgedTokensWrapperAddress"
setMultiTransferAddressFunction = "setMultiTransferAddress"
initSupplyMintBurnEsdtSafe = "initSupplyMintBurnEsdtSafe"
initSupplyEsdtSafe = "initSupplyEsdtSafe"
)
Expand Down Expand Up @@ -259,13 +260,27 @@ func (handler *MultiversxHandler) DeployContracts(ctx context.Context) {
handler.ScProxyAddress,
zeroStringValue,
setCallsGasLimit,
setupBridgedTokenWrapperFunction,
setBridgedTokensWrapperAddressFunction,
[]string{
handler.WrapperAddress.Hex(),
},
)
log.Info("setupEsdtSafe in SC bridge proxy tx executed", "hash", hash, "status", txResult.Status)

// setMultiTransferAddress in SC bridge proxy
hash, txResult = handler.ChainSimulator.ScCall(
ctx,
handler.OwnerKeys.MvxSk,
handler.ScProxyAddress,
zeroStringValue,
setCallsGasLimit,
setMultiTransferAddressFunction,
[]string{
multiTransferAddress.Hex(),
},
)
log.Info("setMultiTransferAddress in SC bridge proxy tx executed", "hash", hash, "status", txResult.Status)

// setEsdtSafeOnWrapper
hash, txResult = handler.ChainSimulator.ScCall(
ctx,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildInfo": {
"rustc": {
"version": "1.78.0",
"commitHash": "9b00956e56009bab2aa15d7bff10916599e3d6d6",
"commitDate": "2024-04-29",
"version": "1.80.0",
"commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9",
"commitDate": "2024-07-21",
"channel": "Stable",
"short": "rustc 1.78.0 (9b00956e5 2024-04-29)"
"short": "rustc 1.80.0 (051478957 2024-07-21)"
},
"contractCrate": {
"name": "bridge-proxy",
Expand Down Expand Up @@ -57,6 +57,17 @@
],
"outputs": []
},
{
"name": "cancel",
"mutability": "mutable",
"inputs": [
{
"name": "tx_id",
"type": "u32"
}
],
"outputs": []
},
{
"name": "getPendingTransactionById",
"mutability": "readonly",
Expand Down Expand Up @@ -84,7 +95,7 @@
]
},
{
"name": "setupMultiTransfer",
"name": "setMultiTransferAddress",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [
Expand All @@ -97,7 +108,20 @@
"outputs": []
},
{
"name": "setBridgedTokensWrapper",
"name": "setBridgedTokensWrapperAddress",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [
{
"name": "opt_address",
"type": "optional<Address>",
"multi_arg": true
}
],
"outputs": []
},
{
"name": "setEsdtSafeAddress",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [
Expand Down Expand Up @@ -129,6 +153,16 @@
}
]
},
{
"name": "getEsdtSafeContractAddress",
"mutability": "readonly",
"inputs": [],
"outputs": [
{
"type": "Address"
}
]
},
{
"name": "lowestTxId",
"mutability": "readonly",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildInfo": {
"rustc": {
"version": "1.78.0",
"commitHash": "9b00956e56009bab2aa15d7bff10916599e3d6d6",
"commitDate": "2024-04-29",
"version": "1.80.0",
"commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9",
"commitDate": "2024-07-21",
"channel": "Stable",
"short": "rustc 1.78.0 (9b00956e5 2024-04-29)"
"short": "rustc 1.80.0 (051478957 2024-07-21)"
},
"contractCrate": {
"name": "bridged-tokens-wrapper",
Expand Down Expand Up @@ -171,6 +171,11 @@
{
"name": "to",
"type": "EthAddress"
},
{
"name": "opt_refunding_address",
"type": "optional<Address>",
"multi_arg": true
}
],
"outputs": []
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildInfo": {
"rustc": {
"version": "1.78.0",
"commitHash": "9b00956e56009bab2aa15d7bff10916599e3d6d6",
"commitDate": "2024-04-29",
"version": "1.80.0",
"commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9",
"commitDate": "2024-07-21",
"channel": "Stable",
"short": "rustc 1.78.0 (9b00956e5 2024-04-29)"
"short": "rustc 1.80.0 (051478957 2024-07-21)"
},
"contractCrate": {
"name": "esdt-safe",
Expand Down Expand Up @@ -122,6 +122,10 @@
{
"name": "to",
"type": "EthAddress"
},
{
"name": "refunding_address",
"type": "Address"
}
],
"outputs": []
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildInfo": {
"rustc": {
"version": "1.78.0",
"commitHash": "9b00956e56009bab2aa15d7bff10916599e3d6d6",
"commitDate": "2024-04-29",
"version": "1.80.0",
"commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9",
"commitDate": "2024-07-21",
"channel": "Stable",
"short": "rustc 1.78.0 (9b00956e5 2024-04-29)"
"short": "rustc 1.80.0 (051478957 2024-07-21)"
},
"contractCrate": {
"name": "multi-transfer-esdt",
Expand Down Expand Up @@ -76,6 +76,18 @@
],
"outputs": []
},
{
"name": "addUnprocessedRefundTxToBatch",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [
{
"name": "tx_id",
"type": "u64"
}
],
"outputs": []
},
{
"name": "setEsdtSafeContractAddress",
"onlyOwner": true,
Expand Down Expand Up @@ -343,6 +355,16 @@
"indexed": true
}
]
},
{
"identifier": "unprocessedRefundTxs",
"inputs": [
{
"name": "tx_id",
"type": "u64",
"indexed": true
}
]
}
],
"esdtAttributes": [],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildInfo": {
"rustc": {
"version": "1.78.0",
"commitHash": "9b00956e56009bab2aa15d7bff10916599e3d6d6",
"commitDate": "2024-04-29",
"version": "1.80.0",
"commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9",
"commitDate": "2024-07-21",
"channel": "Stable",
"short": "rustc 1.78.0 (9b00956e5 2024-04-29)"
"short": "rustc 1.80.0 (051478957 2024-07-21)"
},
"contractCrate": {
"name": "multisig",
Expand Down Expand Up @@ -205,6 +205,18 @@
],
"outputs": []
},
{
"name": "addUnprocessedRefundTxToBatch",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [
{
"name": "tx_id",
"type": "u64"
}
],
"outputs": []
},
{
"docs": [
"Proposers and board members use this to launch signed actions."
Expand Down Expand Up @@ -1214,7 +1226,7 @@
],
"events": [
{
"identifier": "add_mapping",
"identifier": "addMapping",
"inputs": [
{
"name": "erc20_address",
Expand All @@ -1229,7 +1241,7 @@
]
},
{
"identifier": "clear_mapping",
"identifier": "clearMapping",
"inputs": [
{
"name": "erc20_address",
Expand All @@ -1244,15 +1256,25 @@
]
},
{
"identifier": "move_refund_batch_to_safe",
"identifier": "moveRefundBatchToSafeEvent",
"inputs": []
},
{
"identifier": "pause_esdt_safe",
"identifier": "addUnprocessedRefundTxToBatchEvent",
"inputs": [
{
"name": "tx_id",
"type": "u64",
"indexed": true
}
]
},
{
"identifier": "pauseEsdtEvent",
"inputs": []
},
{
"identifier": "unpause_esdt_safe",
"identifier": "unpauseEsdtEvent",
"inputs": []
},
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildInfo": {
"rustc": {
"version": "1.78.0",
"commitHash": "9b00956e56009bab2aa15d7bff10916599e3d6d6",
"commitDate": "2024-04-29",
"version": "1.80.0",
"commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9",
"commitDate": "2024-07-21",
"channel": "Stable",
"short": "rustc 1.78.0 (9b00956e5 2024-04-29)"
"short": "rustc 1.80.0 (051478957 2024-07-21)"
},
"contractCrate": {
"name": "test-caller",
Expand Down
Binary file not shown.

0 comments on commit 22440b2

Please sign in to comment.