-
Notifications
You must be signed in to change notification settings - Fork 7
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
[BLADE-97] Refactor tx signer #113
[BLADE-97] Refactor tx signer #113
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
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.
Generally, let's follow the convention that file names are separated with the underscore, for the sake of the consistency. So:
- txsignerEIP155.go -> txsigner_eip155.go
- txsignerFrontier -> txsigner_frontier.go etc.
@grujicf you need to post the following comment to pass the CLA assistant check:
Also, there are some build errors and merge conflicts on the |
// RLP(chainId, nonce, gasPrice, gas, to, -, -, -) | ||
hashPreimage.Set(RLP.NewNull()) | ||
} else { | ||
|
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.
|
||
// Checking whether the transaction is a smart contract deployment | ||
if tx.To() == nil { | ||
|
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.
accessList := RLP.NewArray() | ||
|
||
if tx.AccessList() != nil { | ||
|
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.
|
||
// accessTuple contains (address, storageKeys[]) | ||
for _, accessTuple := range tx.AccessList() { | ||
|
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.
@@ -87,7 +87,8 @@ func TestLondonSignerSender(t *testing.T) { | |||
} | |||
|
|||
chainID := tc.chainID.Uint64() | |||
signer := NewLondonOrBerlinSigner(chainID, true, NewEIP155Signer(chainID, true)) | |||
//signer := NewLondonOrBerlinSigner(chainID, true, NewEIP155Signer(chainID, true)) | |||
signer := NewLondonOrBerlinSigner(chainID, true, NewEIP155Signer(chainID)) |
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.
We should remove NewLondonOrBerlinSigner
.
Also there are some build errors, because crypto.NewEIP155Signer
does not have bool parameter anymore, so please take a look to it.
I have read the CLA Document and I hereby sign the CLA |
@grujicf you have some merge conflicts on |
2999e85
into
Ethernal-Tech:feat/refactor-tx-signers
* Refactoring the tx singer logic * Build fix * Fix tests
* Refactoring the tx singer logic * Build fix * Fix tests
* [BLADE-97] Refactor tx signer (#113) * Refactoring the tx singer logic * Build fix * Fix tests * Revert go.mod and go.sum * Linter fixes and renames * Fix tests * Fix test * Fix tests * Fix EIP155Signer condition * Fix * Fix * Fix * Fix * Remove calcTxHash * Fix lint * Revert go.mod * Address comments (part 1) * Rebase fix * code reorg * Lint fix * Lint fix * err logging * Remove commented code * ChainID check in tx signer * Lint fix * Fix legacy tests * UTs fix * Fix TestTxPool_RecoverableError * Change error message in the Sender fn * Minor change --------- Co-authored-by: grujicf <61869071+grujicf@users.noreply.github.com> Co-authored-by: grujicf998 <grujicf998@gmail.com> Co-authored-by: Goran Rojovic <goran.rojovic@ethernal.tech>
Description
Refactored tx singer logic. If everything is fine,
calcTxHash
function should be deleted fromtxsigner.go
. Also, files such astxsigner_london_berlin.go
and other test files are no longer needed. It is necessary to write new tests.Changes include
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Checklist
Testing