Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge rc160 into feat refactor eeh 2023.08.28 #45

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.2
github.com/mitchellh/mapstructure v1.4.1
github.com/multiversx/mx-chain-core-go v1.2.13
github.com/multiversx/mx-chain-core-go v1.2.15-0.20230828081708-1d1190bec635
github.com/multiversx/mx-chain-crypto-go v1.2.8
github.com/multiversx/mx-chain-logger-go v1.0.13
github.com/multiversx/mx-chain-vm-common-go v1.5.2
github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20230828083058-8acb3c9d0f87
github.com/multiversx/mx-components-big-int v1.0.0
github.com/pelletier/go-toml v1.9.3
github.com/stretchr/testify v1.8.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/multiversx/mx-chain-core-go v1.2.13 h1:4Svi23hdsoibStFXv0i7lbBWus3kDJPc6CFhrxrKIZ4=
github.com/multiversx/mx-chain-core-go v1.2.13/go.mod h1:BILOGHUOIG5dNNX8cgkzCNfDaVtoYrJRYcPnpxRMH84=
github.com/multiversx/mx-chain-core-go v1.2.15-0.20230828081708-1d1190bec635 h1:BtuOBkYy3heZYLaqRys94rPwEiQq/HKHYRL8RXAq46A=
github.com/multiversx/mx-chain-core-go v1.2.15-0.20230828081708-1d1190bec635/go.mod h1:BILOGHUOIG5dNNX8cgkzCNfDaVtoYrJRYcPnpxRMH84=
github.com/multiversx/mx-chain-crypto-go v1.2.8 h1:wOgVlUaO5X4L8iEbFjcQcL8SZvv6WZ7LqH73BiRPhxU=
github.com/multiversx/mx-chain-crypto-go v1.2.8/go.mod h1:fkaWKp1rbQN9wPKya5jeoRyC+c/SyN/NfggreyeBw+8=
github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpAXmqjT02klNT/JnY=
github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk=
github.com/multiversx/mx-chain-vm-common-go v1.5.2 h1:iRWJNlogjkq9w+pJZIfkVkXQFmMoRxZr6pzCfg2/K68=
github.com/multiversx/mx-chain-vm-common-go v1.5.2/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c=
github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20230828083058-8acb3c9d0f87 h1:66UVkqfJPw+IOtCtYfFkl5MLfopzLUCa7FpxWInHTwU=
github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20230828083058-8acb3c9d0f87/go.mod h1:uDaefuPXa9p0sb+wrUk16J0z+U324Hh894Y5oVXeVdI=
github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8=
github.com/multiversx/mx-components-big-int v1.0.0/go.mod h1:maIEMgHlNE2u78JaDD0oLzri+ShgU4okHfzP3LWGdQM=
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
Expand Down
2 changes: 1 addition & 1 deletion scenarioexec/stepCheckTxResult.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (ae *VMTestExecutor) checkTxResults(
mjwrite.LogToString(ae.convertLogToTestFormat(outLog)))
}
}
if !testLog.Data.Check(outLog.Data) {
if !testLog.Data.Check(outLog.GetFirstDataItem()) {
return fmt.Errorf("bad log data. Tx %s. Want:\n%s\nGot:\n%s",
txIndex,
mjwrite.LogToString(testLog),
Expand Down
4 changes: 2 additions & 2 deletions scenarioexec/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/data/esdt"
"github.com/multiversx/mx-chain-vm-common-go"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
"github.com/multiversx/mx-chain-vm-common-go/builtInFunctions"
worldmock "github.com/multiversx/mx-chain-vm-v1_3-go/mock/world"
er "github.com/multiversx/mx-chain-vm-v1_3-go/scenarios/expression/reconstructor"
Expand Down Expand Up @@ -159,7 +159,7 @@ func (ae *VMTestExecutor) convertLogToTestFormat(outputLog *vmcommon.LogEntry) *
outputLog.Identifier,
ae.exprReconstructor.Reconstruct(outputLog.Identifier,
er.StrHint)),
Data: mj.JSONCheckBytesReconstructed(outputLog.Data, ""),
Data: mj.JSONCheckBytesReconstructed(outputLog.GetFirstDataItem(), ""),
Topics: make([]mj.JSONCheckBytes, len(outputLog.Topics)),
}
for i, topic := range outputLog.Topics {
Expand Down
21 changes: 0 additions & 21 deletions test/egld-esdt-swap/scenarios/wrap_egld.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,6 @@
"expect": {
"status": "0",
"message": "",
"logs": [
{
"address": "sc:egld-esdt-swap",
"identifier": "str:ESDTTransfer",
"topics": [
"str:WEGLD-abcdef",
"",
"500",
"address:user"
],
"data": ""
},
{
"address": "sc:egld-esdt-swap",
"identifier": "str:wrap-egld",
"topics": [
"address:user"
],
"data": "500"
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,41 +49,6 @@
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"identifier": "str:ESDTTransfer",
"topics": [
"str:TEST-TOKEN",
"",
"1000",
"sc:vault"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:accept_funds",
"topics": [
"str:TEST-TOKEN",
"str:FungibleESDT",
"1000",
"0"
],
"data": ""
},
{
"address": "sc:forwarder",
"identifier": "str:callback_raw",
"topics": [
"str:EGLD",
"0"
],
"data": {
"0-status": "biguint:0"
}
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,6 @@
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"identifier": "str:ESDTTransfer",
"topics": [
"str:TEST-TOKEN",
"",
"1000",
"sc:vault"
],
"data": ""
},
{
"address": "sc:forwarder",
"identifier": "str:callback_raw",
"topics": [
"str:EGLD",
"0"
],
"data": {
"0-status": "biguint:0"
}
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,6 @@
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"identifier": "str:ESDTTransfer",
"topics": [
"str:TEST-TOKEN",
"",
"1000",
"sc:vault"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:accept_funds",
"topics": [
"str:TEST-TOKEN",
"str:FungibleESDT",
"1000",
"0"
],
"data": ""
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,6 @@
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"identifier": "str:ESDTNFTTransfer",
"topics": [
"str:NFT-0001",
"5",
"01",
"sc:vault"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:accept_funds",
"topics": [
"str:NFT-0001",
"str:NonFungibleESDT",
"1",
"5"
],
"data": ""
}

],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,39 +47,6 @@
"expect": {
"out": [ "str:ESDTTransfer@544553542d544f4b454e@03e8" ],
"status": "0",
"logs": [
{
"address": "sc:vault",
"identifier": "str:retrieve_funds",
"topics": [
"str:TEST-TOKEN",
"0",
"1000"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:ESDTTransfer",
"topics": [
"str:TEST-TOKEN",
"",
"1000",
"sc:forwarder"
],
"data": ""
},
{
"address": "sc:forwarder",
"identifier": "str:retrieve_funds_callback",
"topics": [
"str:TEST-TOKEN",
"0",
"1000"
],
"data": ""
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,6 @@
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:vault",
"identifier": "str:retrieve_funds",
"topics": [
"str:NFT-0001",
"5",
"1"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:ESDTNFTTransfer",
"topics": [
"str:NFT-0001",
"5",
"01",
"sc:forwarder"
],
"data": ""
},
{
"address": "sc:forwarder",
"identifier": "str:retrieve_funds_callback",
"topics": [
"*",
"*",
"*"
],
"data": ""
}

],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,6 @@
"0"
],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"identifier": "str:ESDTTransfer",
"topics": [
"str:TEST-TOKEN",
"",
"1000",
"sc:vault"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:accept_funds",
"topics": [
"str:TEST-TOKEN",
"str:FungibleESDT",
"1000",
"0"
],
"data": ""
},
{
"address": "sc:forwarder",
"identifier": "str:accept_funds_sync_result",
"topics": [
"str:TEST-TOKEN",
"str:FungibleESDT",
"1000",
"0"
],
"data": ""
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,6 @@
"5"
],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"identifier": "str:ESDTNFTTransfer",
"topics": [
"str:NFT-0001",
"5",
"01",
"sc:vault"
],
"data": ""
},
{
"address": "sc:vault",
"identifier": "str:accept_funds",
"topics": [
"str:NFT-0001",
"str:NonFungibleESDT",
"1",
"5"
],
"data": ""
},
{
"address": "sc:forwarder",
"identifier": "str:accept_funds_sync_result",
"topics": [
"str:NFT-0001",
"str:NonFungibleESDT",
"1",
"5"
],
"data": ""
}
],
"gas": "*",
"refund": "*"
}
Expand Down
Loading
Loading