Skip to content

Commit 9852b5a

Browse files
JonathanOppenheimeralarso16michaelkaplan13
authored
sync: coreth PR #1214: ci: update taskfile for rlpgen (#1760)
Co-authored-by: Austin Larson <78000745+alarso16@users.noreply.github.com> Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com>
1 parent 5fec099 commit 9852b5a

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

Taskfile.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ tasks:
6262
- task: generate-mocks
6363
- task: check-clean-branch
6464

65+
check-generate-rlp:
66+
desc: Checks that generated rlp files are up-to-date (requires a clean git working tree)
67+
cmds:
68+
- task: generate-rlp
69+
- task: check-clean-branch
70+
6571
check-go-mod-tidy:
6672
desc: Checks that go.mod and go.sum are up-to-date (requires a clean git working tree)
6773
cmds:
@@ -83,6 +89,12 @@ tasks:
8389
cmds:
8490
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
8591
- cmd: go generate -run "go.uber.org/mock/mockgen" ./...
92+
93+
generate-rlp:
94+
desc: Generates rlp files
95+
cmds:
96+
- cmd: grep -lr -E '^// Code generated by rlpgen\. DO NOT EDIT.\.$' . | xargs -r rm
97+
- cmd: go generate -run "github.com/ava-labs/libevm/rlp/rlpgen" ./...
8698

8799
install-avalanchego-release:
88100
desc: Download and install AvalancheGo release binary for testing, with fallback to building from source
@@ -100,6 +112,7 @@ tasks:
100112
- shellcheck
101113
- check-generate-codec
102114
- check-generate-mocks
115+
- check-generate-rlp
103116

104117
lint-all-ci:
105118
desc: Runs all lint checks one-by-one
@@ -109,6 +122,7 @@ tasks:
109122
- task: shellcheck
110123
- task: check-generate-codec
111124
- task: check-generate-mocks
125+
- task: check-generate-rlp
112126

113127
setup-contracts:
114128
desc: Set up contracts by installing NPM dependencies, cleaning Hardhat cache, and compiling contracts

plugin/evm/customtypes/gen_header_serializable_rlp.go

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/evm/customtypes/header_ext.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ func (h *HeaderSerializable) updateToExtras(extras *HeaderExtra) {
149149
extras.BlockGasCost = h.BlockGasCost
150150
}
151151

152+
// NOTE: both generators currently do not support type aliases.
153+
// We are using custom versions of these programs for now to support type aliases,
154+
// see https://github.com/ava-labs/coreth/pull/746#discussion_r1969673252
152155
//go:generate go run github.com/fjl/gencodec -type HeaderSerializable -field-override headerMarshaling -out gen_header_serializable_json.go
153-
//go:generate go run github.com/ava-labs/libevm/rlp/rlpgen@739ba847f6f407f63fd6a24175b24e56fea583a1 -type HeaderSerializable -out gen_header_serializable_rlp.go
156+
//go:generate go run github.com/ava-labs/libevm/rlp/rlpgen -type HeaderSerializable -out gen_header_serializable_rlp.go
154157

155158
// HeaderSerializable defines the header of a block in the Ethereum blockchain,
156159
// as it is to be serialized into RLP and JSON. Note it must be exported so that

0 commit comments

Comments
 (0)