Skip to content

Commit

Permalink
Merge pull request #6543 from multiversx/MX-15929-esdt-safe-tests
Browse files Browse the repository at this point in the history
integration tests for esdt-safe contract
  • Loading branch information
axenteoctavian authored Nov 7, 2024
2 parents 4e6a2de + e02932e commit 4e4724a
Show file tree
Hide file tree
Showing 7 changed files with 612 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestChainSimulator_ExecuteMintBurnBridgeOpForESDTTokensWithPrefixAndTransfe
paymentTokenAmount, _ := big.NewInt(0).SetString("1000000000000000000", 10)
chainSim.SetEsdtInWallet(t, cs, wallet, argsEsdtSafe.IssuePaymentToken, 0, esdt.ESDigitalToken{Value: paymentTokenAmount})

// TODO uncomment after rust framework and contract framework will be updated with all esdt types
// TODO MX-15942 uncomment after rust framework and contract framework will be updated with all esdt types
bridgedInTokens := make([]chainSim.ArgsDepositToken, 0)
bridgedInTokens = append(bridgedInTokens, chainSim.ArgsDepositToken{
Identifier: argsEsdtSafe.ChainPrefix + "-TKN-123456",
Expand Down
16 changes: 15 additions & 1 deletion integrationTests/chainSimulator/bridge/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (
)

const (
issuePaymentCost = "50000000000000000"
issuePaymentCost = "50000000000000000" // esdt-safe contract without header-verifier checks
esdtSafeWasmPath = "testdata/esdt-safe.wasm"
enshrineEsdtSafeWasmPath = "testdata/enshrine-esdt-safe.wasm"
//enshrine esdt-safe contract without checks for prefix or issue cost paid for new tokens
simpleEnshrineEsdtSafeWasmPath = "testdata/simple-enshrine-esdt-safe.wasm"
Expand Down Expand Up @@ -116,6 +117,19 @@ func deployBridgeSetup(
}
}

func esdtSafeContract(
t *testing.T,
cs chainSim.ChainSimulator,
ownerAddress []byte,
nonce *uint64,
systemContractDeploy []byte,
_ ArgsEsdtSafe,
contractWasmPath string,
) []byte {
esdtSafeArgs := "@" // is_sovereign_chain
return chainSim.DeployContract(t, cs, ownerAddress, nonce, systemContractDeploy, esdtSafeArgs, contractWasmPath)
}

func enshrineEsdtSafeContract(
t *testing.T,
cs chainSim.ChainSimulator,
Expand Down
Loading

0 comments on commit 4e4724a

Please sign in to comment.