-
Notifications
You must be signed in to change notification settings - Fork 2
Fix reconcilation failure: improve detection of (in)effective "transfer value only" events #136
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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", | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intended (explicit logging for our system tests).
|
||||||
| "--log-level=*:DEBUG", | |
| f"--log-level=*:{log_level}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For system tests. Intended. That is the default, anyway.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,5 @@ const ( | |
|
|
||
| var ( | ||
| // RosettaMiddlewareVersion is the version of this package (application) | ||
| RosettaMiddlewareVersion = "v0.7.0" | ||
| RosettaMiddlewareVersion = "v0.7.1" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hotfix (patch). |
||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Use the
transactionEventTransferAndExecuteconstant instead of a string literal here to keep the test in sync with production code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will not change. It's better to have failing tests in case of such a change.