Skip to content

Commit

Permalink
FEVM: update types (#147)
Browse files Browse the repository at this point in the history
* feat: update state for selfdestruct

* EVM: fix method numbers/signatures

* add CreateExternal to eam (#149)

* add CreateExternal to eam

* use CborBytes instead of CreateExternalParams

* Update builtin/v10/eam/eam_types.go

Co-authored-by: Steven Allen <steven@stebalien.com>

* Update builtin/v10/eam/methods.go

Co-authored-by: Steven Allen <steven@stebalien.com>

* add CreateExternal to eam method list

Co-authored-by: Steven Allen <steven@stebalien.com>

* make gen for CreateExternalReturn (#150)

* Fix copypasta

Co-authored-by: vyzo <vyzo@hackzen.org>
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
  • Loading branch information
3 people authored Jan 14, 2023
1 parent 2a2fe5b commit 5f2a83a
Show file tree
Hide file tree
Showing 9 changed files with 315 additions and 21 deletions.
14 changes: 9 additions & 5 deletions builtin/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,28 +363,32 @@ var MethodsDatacap = struct {

var MethodsEVM = struct {
Constructor abi.MethodNum
InvokeContract abi.MethodNum
Resurrect abi.MethodNum
GetBytecode abi.MethodNum
GetBytecodeHash abi.MethodNum
GetStorageAt abi.MethodNum
InvokeContractReadOnly abi.MethodNum
InvokeContractDelegate abi.MethodNum
InvokeContract abi.MethodNum
}{
MethodConstructor,
2,
3,
4,
5,
6,
MustGenerateFRCMethodNum("InvokeEVM"),
}

var MethodsEAM = struct {
Constructor abi.MethodNum
Create abi.MethodNum
Create2 abi.MethodNum
Constructor abi.MethodNum
Create abi.MethodNum
Create2 abi.MethodNum
CreateExternal abi.MethodNum
}{
MethodConstructor,
2,
3,
4,
}

var MethodsPlaceholder = struct {
Expand Down
145 changes: 141 additions & 4 deletions builtin/v10/eam/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions builtin/v10/eam/eam_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package eam

import "github.com/filecoin-project/go-address"
import (
"github.com/filecoin-project/go-address"
)

type CreateParams struct {
Initcode []byte
Expand All @@ -14,9 +16,10 @@ type Create2Params struct {

type Return struct {
ActorID uint64
RobustAddress address.Address
RobustAddress *address.Address
EthAddress [20]byte
}

type CreateReturn Return
type Create2Return Return
type CreateExternalReturn Return
7 changes: 4 additions & 3 deletions builtin/v10/eam/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

var Methods = map[abi.MethodNum]builtin.MethodMeta{
1: {"Constructor", *new(func(*abi.EmptyValue) *abi.EmptyValue)}, // Constructor
2: {"Create", *new(func(*CreateParams) *CreateReturn)}, // Create
3: {"Create2", *new(func(*Create2Params) *Create2Return)}, // Create2
1: {"Constructor", *new(func(*abi.EmptyValue) *abi.EmptyValue)}, // Constructor
2: {"Create", *new(func(*CreateParams) *CreateReturn)}, // Create
3: {"Create2", *new(func(*Create2Params) *Create2Return)}, // Create2
4: {"CreateExternal", *new(func(*abi.CborBytes) *CreateExternalReturn)}, // CreateExternal
}
Loading

0 comments on commit 5f2a83a

Please sign in to comment.