-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix!: assemble of Transfer
operation
#1787
Conversation
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.
First pass - great work!
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.
Awesome job @Torres-ssf 👏🏻
Really like the new e2e tests.
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.
Hell of a PR! 🔥
Perhaps we could merge #1801 here.
Coverage Report:
Changed Files:
|
getTransferOperations
#1774Variable Outputs
documentation page #925Some details about this PR
Since we already have the
OperationName.transfer
, I've removed theOperationName.contractTransfer
.I reckon that we do not need yet another transfer-related operation.
The
Operation
object has thefrom
andto
properties and each one has a property namedtype
, which can beAccount
orContract
.We can simplify transfers in 4 types:
Account
toAccount
- No receipts are generated since no opcodes are called.Account
toContract
- Produces aTransfer
receipt.Contract
toAccount
- Produces aTransferOut
receipt.Contract
toContract
- Produces aTransfer
receipt.This means that the
TransferOperation
needs to mainly be extracted fromTransfer
andTransferOut
receipts, which was not the case until now.I've removed the unit tests related to the
TransferOperation
and replaced them with e2e tests.Unit tests involve moving many pieces around and when you find yourself wasting hours creating mocks to cover many specific edge cases, it's because something is wrong.
Often, these mocks are constructed based on the existing code, which can lead to misleading positive results if the code is wrong. (which was the case until now).
So I am testing this with e2e tests since it takes fewer steps to simulate each case and we can have more confidence in the test results.