Skip to content
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gen:
$(GO_BIN) run ./builtin/v15/gen/gen.go
$(GO_BIN) run ./builtin/v16/gen/gen.go
$(GO_BIN) run ./builtin/v17/gen/gen.go
$(GO_BIN) run ./builtin/v18/gen/gen.go
.PHONY: gen

lint:
Expand Down
3 changes: 3 additions & 0 deletions actors/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
Version15 Version = 15
Version16 Version = 16
Version17 Version = 17
Version18 Version = 18
)

// Converts a network version into an actors adt version.
Expand Down Expand Up @@ -65,6 +66,8 @@ func VersionForNetwork(version network.Version) (Version, error) {
return Version16, nil
case network.Version27:
return Version17, nil
case network.Version28:
return Version18, nil
default:
return -1, fmt.Errorf("unsupported network version %d", version)
}
Expand Down
9 changes: 9 additions & 0 deletions builtin/v18/account/account_state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package account

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

type State struct {
Address addr.Address
}
6 changes: 6 additions & 0 deletions builtin/v18/account/account_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package account

type AuthenticateMessageParams struct {
Signature []byte
Message []byte
}
188 changes: 188 additions & 0 deletions builtin/v18/account/cbor_gen.go

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

27 changes: 27 additions & 0 deletions builtin/v18/account/invariants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package account

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

type StateSummary struct {
PubKeyAddr address.Address
}

// Checks internal invariants of account state.
func CheckStateInvariants(st *State, idAddr address.Address) (*StateSummary, *builtin.MessageAccumulator) {
acc := &builtin.MessageAccumulator{}
accountSummary := &StateSummary{
PubKeyAddr: st.Address,
}

if id, err := address.IDFromAddress(idAddr); err != nil {
acc.Addf("error extracting actor ID from address: %v", err)
} else if id >= builtin.FirstNonSingletonActorId {
acc.Require(st.Address.Protocol() == address.BLS || st.Address.Protocol() == address.SECP256K1,
"actor address %v must be BLS or SECP256K1 protocol", st.Address)
}

return accountSummary, acc
}
15 changes: 15 additions & 0 deletions builtin/v18/account/methods.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package account

import (
typegen "github.com/whyrusleeping/cbor-gen"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin"
)

var Methods = map[abi.MethodNum]builtin.MethodMeta{
1: builtin.NewMethodMeta("Constructor", *new(func(*address.Address) *abi.EmptyValue)), // Constructor
2: builtin.NewMethodMeta("PubkeyAddress", *new(func(*abi.EmptyValue) *address.Address)), // PubkeyAddress
builtin.MustGenerateFRCMethodNum("AuthenticateMessage"): builtin.NewMethodMeta("AuthenticateMessage", *new(func(*AuthenticateMessageParams) *typegen.CborBool)), // AuthenticateMessage
}
Loading
Loading