diff --git a/server/services/constants.go b/server/services/constants.go index 75f52aa..0f89056 100644 --- a/server/services/constants.go +++ b/server/services/constants.go @@ -29,7 +29,7 @@ var ( durationAlarmThresholdAccountServiceGetAccountBalance = time.Duration(500) * time.Millisecond ) -var ( +const ( transactionEventSignalError = core.SignalErrorOperation transactionEventSCDeploy = core.SCDeployIdentifier transactionEventTransferValueOnly = "transferValueOnly" @@ -48,9 +48,10 @@ var ( transactionEventDataExecuteOnDestContext = "ExecuteOnDestContext" transactionEventDataAsyncCall = "AsyncCall" + transactionEventDataTransferAndExecute = "TransferAndExecute" ) -var ( +const ( numTopicsOfEventESDTTransfer = 4 numTopicsPerTransferOfEventMultiESDTNFTTransfer = 3 numTopicsOfEventESDTLocalBurn = 3 diff --git a/server/services/transactionEventsController.go b/server/services/transactionEventsController.go index f8841f6..20c7981 100644 --- a/server/services/transactionEventsController.go +++ b/server/services/transactionEventsController.go @@ -77,7 +77,8 @@ func (controller *transactionEventsController) decideEffectiveEventTransferValue return nil, nil } - if string(event.Data) != transactionEventDataExecuteOnDestContext && string(event.Data) != transactionEventDataAsyncCall { + eventData := string(event.Data) + if eventData != transactionEventDataExecuteOnDestContext && eventData != transactionEventDataAsyncCall && eventData != transactionEventDataTransferAndExecute { // Ineffective event, since the balance change is already captured by a SCR. return nil, nil } diff --git a/server/services/transactionEventsController_test.go b/server/services/transactionEventsController_test.go index c91e407..7888f4a 100644 --- a/server/services/transactionEventsController_test.go +++ b/server/services/transactionEventsController_test.go @@ -235,6 +235,35 @@ func TestTransactionEventsController_ExtractEvents(t *testing.T) { require.Equal(t, "100", events[0].value) }) + t.Run("transferValueOnly, after Sirius, effective (intra-shard TransferAndExecute)", func(t *testing.T) { + topic0 := big.NewInt(100).Bytes() + topic1 := testscommon.TestContractBarShard0.PubKey + + tx := &transaction.ApiTransactionResult{ + Epoch: 43, + Logs: &transaction.ApiLogs{ + Events: []*transaction.Events{ + { + Identifier: "transferValueOnly", + Address: testscommon.TestContractFooShard0.Address, + Topics: [][]byte{ + topic0, + topic1, + }, + Data: []byte("TransferAndExecute"), + }, + }, + }, + } + + events, err := controller.extractEventTransferValueOnly(tx) + require.NoError(t, err) + require.Len(t, events, 1) + require.Equal(t, testscommon.TestContractFooShard0.Address, events[0].sender) + require.Equal(t, testscommon.TestContractBarShard0.Address, events[0].receiver) + require.Equal(t, "100", events[0].value) + }) + t.Run("transferValueOnly, after Sirius, ineffective (cross-shard AsyncCall)", func(t *testing.T) { topic0 := big.NewInt(100).Bytes() topic1 := testscommon.TestContractBarShard1.PubKey diff --git a/systemtests/check_with_mesh_cli.py b/systemtests/check_with_mesh_cli.py index 90a25ae..939b076 100644 --- a/systemtests/check_with_mesh_cli.py +++ b/systemtests/check_with_mesh_cli.py @@ -76,6 +76,7 @@ def run_rosetta(configuration: Configuration, shard: int): f"--first-historical-epoch={current_epoch}", f"--num-historical-epochs={configuration.num_historical_epochs}", f"--activation-epoch-spica={configuration.activation_epoch_spica}", + "--log-level=*:DEBUG", "--handle-contracts", "--pprof" ] diff --git a/version/constants.go b/version/constants.go index d84af67..b7edbdc 100644 --- a/version/constants.go +++ b/version/constants.go @@ -7,5 +7,5 @@ const ( var ( // RosettaMiddlewareVersion is the version of this package (application) - RosettaMiddlewareVersion = "v0.7.0" + RosettaMiddlewareVersion = "v0.7.1" )