Skip to content

Commit

Permalink
add tokenless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Dec 20, 2024
1 parent e63de09 commit 5acc98c
Show file tree
Hide file tree
Showing 7 changed files with 538 additions and 30 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ e2e-test-fraud-detection-da-p2p-evm: clean-e2e
e2e-test-erc20-rollapp-to-hub-new-evm: clean-e2e
cd tests && go test -timeout=45m -race -v -run TestERC20RollAppToHubNewRegister_EVM .

e2e-test-tokenless-create-erc20-evm: clean-e2e
cd tests && go test -timeout=45m -race -v -run TestTokenlessCreateERC20_EVM .

e2e-test-tokenless-transfer-success-evm: clean-e2e
cd tests && go test -timeout=45m -race -v -run TestTokenlessTransferSuccess_EVM .

# Executes IBC tests via rollup-e2e-testing
e2e-test-ibc-success-wasm: clean-e2e
cd tests && go test -timeout=45m -race -v -run TestIBCTransferSuccess_Wasm .
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ replace (

require (
github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869
github.com/decentrio/rollup-e2e-testing v0.0.0-20241218041247-d03d7fef7544
github.com/decentrio/rollup-e2e-testing v0.0.0-20241220064322-31dd72989026
github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20241016085626-2b8c8898058b
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 h1:qWpUYGOsrSC+1Vmd2TjhbsSpntvvx9PsX3AoeMunFxc=
github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869/go.mod h1:HZNYnPwmSxkwTPjSD5yolauc1Vx1ZzKL4FFMxTq4H5Y=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241218041247-d03d7fef7544 h1:b1izOB8UFpzcC4ESNvTvGVV8NZnuG3VKFlaeJvqSsGQ=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241218041247-d03d7fef7544/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241220064322-31dd72989026 h1:wxRixOHD8MIRNc+7e2u1H/5T8fKxyECNIdv3BGpYEP8=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241220064322-31dd72989026/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c=
github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI=
github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
Expand Down
5 changes: 5 additions & 0 deletions tests/data/native_denom_tokenless.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"display": "DYM",
"base": "ibc/FECACB927EB3102CCCB240FFB3B6FCCEEB8D944C6FEA8DFF079650FEFF59781D",
"exponent": 18
}
20 changes: 1 addition & 19 deletions tests/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,13 @@ import (
"github.com/icza/dyno"
"github.com/stretchr/testify/require"

banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
denommetadatatypes "github.com/dymensionxyz/dymension/v3/x/denommetadata/types"
eibc "github.com/dymensionxyz/dymension/v3/x/eibc/types"
rollapp "github.com/dymensionxyz/dymension/v3/x/rollapp/types"
ethermintcrypto "github.com/evmos/ethermint/crypto/codec"
ethermint "github.com/evmos/ethermint/types"
)

var rollappDenomMetadata = banktypes.Metadata{
Description: "Denom of the rollapp",
Base: "urax",
Display: "RAX",
Name: "RAX",
Symbol: "urax",
DenomUnits: []*banktypes.DenomUnit{
{
Denom: "urax",
Exponent: 0,
}, {
Denom: "RAX",
Exponent: 18,
},
},
}

type memoData struct {
denommetadatatypes.MemoData
User *userData `json:"user,omitempty"`
Expand Down Expand Up @@ -107,7 +89,7 @@ var (

DymensionMainRepo = "ghcr.io/dymensionxyz/dymension"

RollappEVMMainRepo = "ghcr.io/decentrio/rollapp-evm"
RollappEVMMainRepo = "ghcr.io/dymensionxyz/rollapp-evm"

RollappWasmMainRepo = "ghcr.io/dymensionxyz/rollapp-wasm"

Expand Down
16 changes: 8 additions & 8 deletions tests/time_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ func Test_TimeBaseUpgrade_EVM(t *testing.T) {
upgradeTime := blockTime.Add(90 * time.Second).Format(time.RFC3339)
fmt.Println("Upgrade Time:", upgradeTime)
msg := map[string]interface{}{
"@type": "/rollapp.timeupgrade.types.MsgSoftwareUpgrade",
"authority": "ethm10d07y265gmmuvt4z0w9aw880jnsr700jpva843",
"drs": 2,
"upgrade_time": upgradeTime,
"@type": "/rollapp.timeupgrade.types.MsgSoftwareUpgrade",
"authority": "ethm10d07y265gmmuvt4z0w9aw880jnsr700jpva843",
"drs": 3,
"upgrade_time": upgradeTime,
}

rawMsg, err := json.Marshal(msg)
Expand Down Expand Up @@ -588,10 +588,10 @@ func Test_TimeBaseUpgradeInPast_EVM(t *testing.T) {
upgradeTime := "2024-09-06T18:10:00Z" // upgrade time in the past
fmt.Println("Upgrade Time:", upgradeTime)
msg := map[string]interface{}{
"@type": "/rollapp.timeupgrade.types.MsgSoftwareUpgrade",
"authority": "ethm10d07y265gmmuvt4z0w9aw880jnsr700jpva843",
"drs": 2,
"upgrade_time": upgradeTime,
"@type": "/rollapp.timeupgrade.types.MsgSoftwareUpgrade",
"authority": "ethm10d07y265gmmuvt4z0w9aw880jnsr700jpva843",
"drs": 2,
"upgrade_time": upgradeTime,
}

rawMsg, err := json.Marshal(msg)
Expand Down
Loading

0 comments on commit 5acc98c

Please sign in to comment.