Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

feat(abigen): Revert to geth abigen due to foundry update #232

Merged
merged 1 commit into from
Feb 17, 2023
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ executors:
docker:
- image: cimg/go:1.19
environment:
FOUNDRY_COMMIT: 3d5f03836dc5820ba95dadd736d0b17a3c7b4583
FOUNDRY_COMMIT: e2fa2b5f8940d283f54df1ec701967276a934e97
resource_class: xlarge
machine:
machine:
Expand Down
2 changes: 1 addition & 1 deletion build/mage/forge.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

var (
// Commands.
forgeBuild = mi.RunCmdV("forge", "build")
forgeBuild = mi.RunCmdV("forge", "build", "--extra-output-files", "bin", "--extra-output-files", "abi")
forgeClean = mi.RunCmdV("forge", "clean")
forgeTest = mi.RunCmdV("forge", "test")
forgeFmt = mi.RunCmdV("forge", "fmt")
Expand Down
3 changes: 2 additions & 1 deletion build/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ var (
golines = "github.com/segmentio/golines"
goimports = "golang.org/x/tools/cmd/goimports"
rlpgen = "github.com/ethereum/go-ethereum/rlp/rlpgen"
abigen = "github.com/ethereum/go-ethereum/cmd/abigen"

allTools = []string{buf, gosec, golangcilint, addlicense,
goimportsReviser, moq, ginkgo, golines, goimports, rlpgen}
goimportsReviser, moq, ginkgo, golines, goimports, rlpgen, abigen}
)

// Setup runs the setup script for the current OS.
Expand Down
1 change: 1 addition & 0 deletions build/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ package tools
import (
_ "github.com/bufbuild/buf/cmd/buf"
_ "github.com/cosmos/gosec/v2/cmd/gosec"
_ "github.com/ethereum/go-ethereum/cmd/abigen"
_ "github.com/ethereum/go-ethereum/rlp/rlpgen"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/google/addlicense"
Expand Down
103 changes: 0 additions & 103 deletions cmd/abigen/generator/generator.go

This file was deleted.

51 changes: 0 additions & 51 deletions cmd/abigen/main.go

This file was deleted.

11 changes: 8 additions & 3 deletions eth/core/precompile/container/factories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ import (
. "github.com/onsi/gomega"
)

var (
mockPrecompile, _ = solidity.MockPrecompileMetaData.GetAbi()
)

var _ = Describe("Container Factories", func() {

Context("Stateless Container Factory", func() {
var scf *container.StatelessFactory

Expand Down Expand Up @@ -138,7 +143,7 @@ type mockStateful struct {

func (ms *mockStateful) ABIMethods() map[string]abi.Method {
return map[string]abi.Method{
"getOutput": solidity.MockPrecompileInterface.ABI.Methods["getOutput"],
"getOutput": mockPrecompile.Methods["getOutput"],
}
}

Expand All @@ -158,8 +163,8 @@ type badMockStateful struct {

func (bms *badMockStateful) ABIMethods() map[string]abi.Method {
return map[string]abi.Method{
"getOutput": solidity.MockPrecompileInterface.ABI.Methods["getOutput"],
"getOutputPartial": solidity.MockPrecompileInterface.ABI.Methods["getOutputPartial"],
"getOutput": mock.Methods["getOutput"],
"getOutputPartial": mock.Methods["getOutputPartial"],
}
}

Expand Down
10 changes: 5 additions & 5 deletions eth/core/precompile/container/stateful_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ var _ = Describe("Stateful Container", func() {
// MOCKS BELOW.

var (
mock = solidity.MockPrecompileInterface
getOutputABI = mock.ABI.Methods["getOutput"]
getOutputPartialABI = mock.ABI.Methods["getOutputPartial"]
contractFuncAddrABI = mock.ABI.Methods["contractFunc"]
contractFuncStrABI = mock.ABI.Methods["contractFuncStr"]
mock, _ = solidity.MockPrecompileMetaData.GetAbi()
getOutputABI = mock.Methods["getOutput"]
getOutputPartialABI = mock.Methods["getOutputPartial"]
contractFuncAddrABI = mock.Methods["contractFunc"]
contractFuncStrABI = mock.Methods["contractFuncStr"]
mockIdsToMethods = map[string]*container.Method{
utils.UnsafeBytesToStr(getOutputABI.ID): {
AbiSig: getOutputABI.Sig,
Expand Down
4 changes: 2 additions & 2 deletions eth/testutil/contracts/solidity/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

package solidity

//go:generate go run github.com/berachain/stargazer/cmd/abigen solidity ./out/SolmateERC20.sol/SolmateERC20.json ./generated/solmate_erc20.abigen.go SolmateERC20Contract
//go:generate go run github.com/berachain/stargazer/cmd/abigen solidity ./out/MockPrecompileInterface.sol/MockPrecompileInterface.json ./generated/mock_precompile_interface.abigen.go MockPrecompileInterface
//go:generate abigen --pkg generated --abi ./out/SolmateERC20.sol/SolmateERC20.abi.json --bin ./out/SolmateERC20.sol/SolmateERC20.bin --out ./generated/solmate_erc20.abigen.go --type SolmateERC20
//go:generate abigen --pkg generated --abi ./out/MockPrecompileInterface.sol/MockPrecompileInterface.abi.json --out ./generated/mock_precompile_interface.abigen.go --type MockPrecompile
Loading