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

Commit

Permalink
fix: take args in main add pc (ethereum-optimism#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
therealbytes committed Sep 2, 2023
1 parent c2e53fb commit 320991a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions concrete/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type ConcreteApp interface {
RunWithArgs(args []string) error
RunWithOsArgs() error
Run() error
AddPrecompile(addr common.Address, pc api.Precompile) error
AddPrecompileWasm(addr common.Address, code []byte) error
AddPrecompile(addr common.Address, pc api.Precompile, args ...interface{}) error
AddPrecompileWasm(addr common.Address, code []byte, args ...interface{}) error
}

type concreteGeth struct {
Expand Down Expand Up @@ -63,16 +63,16 @@ func (a *concreteGeth) validateNewPCAddress(addr common.Address) error {
return nil
}

func (a *concreteGeth) AddPrecompile(addr common.Address, pc api.Precompile) error {
func (a *concreteGeth) AddPrecompile(addr common.Address, pc api.Precompile, args ...interface{}) error {
if err := a.validateNewPCAddress(addr); err != nil {
return err
}
return precompiles.AddPrecompile(addr, pc)
return precompiles.AddPrecompile(addr, pc, args...)
}

func (a *concreteGeth) AddPrecompileWasm(addr common.Address, code []byte) error {
func (a *concreteGeth) AddPrecompileWasm(addr common.Address, code []byte, args ...interface{}) error {
if err := a.validateNewPCAddress(addr); err != nil {
return err
}
return precompiles.AddPrecompile(addr, wasm.NewWasmPrecompile(code))
return precompiles.AddPrecompile(addr, wasm.NewWasmPrecompile(code), args...)
}

0 comments on commit 320991a

Please sign in to comment.