-
Notifications
You must be signed in to change notification settings - Fork 303
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
go: Add missing Shanghai revision constant #608
Conversation
Codecov Report
@@ Coverage Diff @@
## master #608 +/- ##
=======================================
Coverage 95.71% 95.71%
=======================================
Files 24 24
Lines 3971 3971
=======================================
Hits 3801 3801
Misses 170 170 |
bindings/go/evmc/evmc.go
Outdated
@@ -149,6 +149,8 @@ const ( | |||
Istanbul Revision = C.EVMC_ISTANBUL | |||
Berlin Revision = C.EVMC_BERLIN | |||
London Revision = C.EVMC_LONDON | |||
Shanghai Revision = C.EVMC_SHANGHAI | |||
maxRevision Revision = C.EVMC_MAX_REVISION |
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 also add latest stable?
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.
maxRevision
is private and cannot be used outside of the evmc
package.
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.
How is it private? Because lowercase?
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. But made it public now together with LatestStableRevision
. I don't want to overthink it.
@@ -149,6 +149,8 @@ const ( | |||
Istanbul Revision = C.EVMC_ISTANBUL | |||
Berlin Revision = C.EVMC_BERLIN | |||
London Revision = C.EVMC_LONDON | |||
Shanghai Revision = C.EVMC_SHANGHAI | |||
maxRevision Revision = C.EVMC_MAX_REVISION | |||
) | |||
|
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.
Unrelated, but can't comment on the line: can func (err Error) Error() string
be replaced by the new string helpers?
bindings/go/evmc/evmc_test.go
Outdated
@@ -59,3 +59,9 @@ func TestExecuteEmptyCode(t *testing.T) { | |||
t.Errorf("execution returned unexpected error: %v", err) | |||
} | |||
} | |||
|
|||
func TestRevision(t *testing.T) { | |||
if MaxRevision != London { |
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.
Should there also be a test for LatestStableRevision
here?
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.
Added.
Added a test that fails in case of
C.EVMC_MAX_REVISION
is increased as a remainder to add new Revision constants to Go.The missing London Revision is added.