-
Notifications
You must be signed in to change notification settings - Fork 325
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
[action] add access list tx #4391
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4391 +/- ##
==========================================
- Coverage 75.86% 75.28% -0.58%
==========================================
Files 361 371 +10
Lines 30116 30280 +164
==========================================
- Hits 22846 22795 -51
- Misses 6134 6323 +189
- Partials 1136 1162 +26 ☔ View full report in Codecov by Sentry. |
@@ -79,23 +79,24 @@ func (b *Builder) Build() AbstractAction { | |||
// TODO: change envelope to *envelope | |||
type EnvelopeBuilder struct { | |||
elp envelope | |||
ab AbstractAction |
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.
If you want to keep the interface of EnvelopeBuilder
as unchanged as possible to reduce modifications, it would be more suitable to change it to LegacyEnvelopeBuilder
. The new EnvelopeBuilder
may only need SetCommon()
and SetPayload()
.
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.
- the current builder is more intuitive and easier to understand/use:
SetNonce().SetGasPrice().SetGasLimit()...
- SetCommon() and SetPayload() would cause too many code changes
} | ||
|
||
func (elp *envelope) BlobTxSidecar() *types.BlobTxSidecar { | ||
// TODO | ||
return nil | ||
return elp.common.BlobTxSidecar() | ||
} | ||
|
||
func (elp *envelope) Value() *big.Int { |
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.
why not return common.Value?
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.
so far only EVM would use Value()
r.Equal("0801100818e907220231332803", hex.EncodeToString(b)) | ||
pb := iotextypes.ActionCore{} | ||
r.NoError(proto.Unmarshal(b, &pb)) | ||
r.Equal(tx, MustNoErrorV(fromProtoLegacyTx(&pb))) |
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.
expect fromProtoLegacyTx(&pb) == tx
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.
yes, this is L35 doing, tx == the result of fromProtoLegacyTx(&pb)
"github.com/pkg/errors" | ||
) | ||
|
||
type LegacyTx struct { |
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.
comment
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.
fixed
action/tx_legacy.go
Outdated
|
||
func (tx *LegacyTx) toProto() *iotextypes.ActionCore { | ||
actCore := iotextypes.ActionCore{ | ||
Version: 1, |
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.
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.
fixed
action/tx_access_list.go
Outdated
|
||
func (tx *AccessListTx) toProto() *iotextypes.ActionCore { | ||
actCore := iotextypes.ActionCore{ | ||
Version: 1, |
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.
Version AccessListTxType
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.
fixed
"github.com/pkg/errors" | ||
) | ||
|
||
type AccessListTx struct { |
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.
comment
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.
fixed
"rawAmount": "0", | ||
"rawGasLimit": 1000000, | ||
"rawGasPrice": "0", | ||
"rawAccessList": [ |
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.
add test with valid access list
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.
let's refactor builder in a follow up PR
Quality Gate passedIssues Measures |
Description
Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: