Skip to content
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

Merged
merged 3 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions bindings/go/evmc/evmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,19 @@ const (
type Revision int32

const (
Frontier Revision = C.EVMC_FRONTIER
Homestead Revision = C.EVMC_HOMESTEAD
TangerineWhistle Revision = C.EVMC_TANGERINE_WHISTLE
SpuriousDragon Revision = C.EVMC_SPURIOUS_DRAGON
Byzantium Revision = C.EVMC_BYZANTIUM
Constantinople Revision = C.EVMC_CONSTANTINOPLE
Petersburg Revision = C.EVMC_PETERSBURG
Istanbul Revision = C.EVMC_ISTANBUL
Berlin Revision = C.EVMC_BERLIN
London Revision = C.EVMC_LONDON
Frontier Revision = C.EVMC_FRONTIER
Homestead Revision = C.EVMC_HOMESTEAD
TangerineWhistle Revision = C.EVMC_TANGERINE_WHISTLE
SpuriousDragon Revision = C.EVMC_SPURIOUS_DRAGON
Byzantium Revision = C.EVMC_BYZANTIUM
Constantinople Revision = C.EVMC_CONSTANTINOPLE
Petersburg Revision = C.EVMC_PETERSBURG
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
LatestStableRevision Revision = C.EVMC_LATEST_STABLE_REVISION
)

Copy link
Member

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?

type VM struct {
Expand Down
9 changes: 9 additions & 0 deletions bindings/go/evmc/evmc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ func TestExecuteEmptyCode(t *testing.T) {
t.Errorf("execution returned unexpected error: %v", err)
}
}

func TestRevision(t *testing.T) {
if MaxRevision != Shanghai {
t.Errorf("missing constant for revision %d", MaxRevision)
}
if LatestStableRevision != London {
t.Errorf("wrong latest stable revision %d", LatestStableRevision)
}
}