Skip to content

Commit 65aa7de

Browse files
authored
feat: add nv27 skeleton (#385)
* chore: create base nv27 skeleton * chore: create base nv27 skeleton * chore: delete migration specific for nv24 * fix: update package in builtin/v16/check.go to v17 * fix: version redeclaration * fix: run gofmt
1 parent f773872 commit 65aa7de

File tree

109 files changed

+34840
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+34840
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ gen:
3434
$(GO_BIN) run ./builtin/v14/gen/gen.go
3535
$(GO_BIN) run ./builtin/v15/gen/gen.go
3636
$(GO_BIN) run ./builtin/v16/gen/gen.go
37+
$(GO_BIN) run ./builtin/v17/gen/gen.go
3738
.PHONY: gen
3839

3940
lint:

actors/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const (
2525
Version14 Version = 14
2626
Version15 Version = 15
2727
Version16 Version = 16
28+
Version17 Version = 17
2829
)
2930

3031
// Converts a network version into an actors adt version.
@@ -62,6 +63,8 @@ func VersionForNetwork(version network.Version) (Version, error) {
6263
return Version15, nil
6364
case network.Version25, network.Version26:
6465
return Version16, nil
66+
case network.Version27:
67+
return Version17, nil
6568
default:
6669
return -1, fmt.Errorf("unsupported network version %d", version)
6770
}

builtin/v17/account/account_state.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package account
2+
3+
import (
4+
addr "github.com/filecoin-project/go-address"
5+
)
6+
7+
type State struct {
8+
Address addr.Address
9+
}

builtin/v17/account/account_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package account
2+
3+
type AuthenticateMessageParams struct {
4+
Signature []byte
5+
Message []byte
6+
}

builtin/v17/account/cbor_gen.go

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

builtin/v17/account/invariants.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package account
2+
3+
import (
4+
"github.com/filecoin-project/go-address"
5+
"github.com/filecoin-project/go-state-types/builtin"
6+
)
7+
8+
type StateSummary struct {
9+
PubKeyAddr address.Address
10+
}
11+
12+
// Checks internal invariants of account state.
13+
func CheckStateInvariants(st *State, idAddr address.Address) (*StateSummary, *builtin.MessageAccumulator) {
14+
acc := &builtin.MessageAccumulator{}
15+
accountSummary := &StateSummary{
16+
PubKeyAddr: st.Address,
17+
}
18+
19+
if id, err := address.IDFromAddress(idAddr); err != nil {
20+
acc.Addf("error extracting actor ID from address: %v", err)
21+
} else if id >= builtin.FirstNonSingletonActorId {
22+
acc.Require(st.Address.Protocol() == address.BLS || st.Address.Protocol() == address.SECP256K1,
23+
"actor address %v must be BLS or SECP256K1 protocol", st.Address)
24+
}
25+
26+
return accountSummary, acc
27+
}

builtin/v17/account/methods.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package account
2+
3+
import (
4+
typegen "github.com/whyrusleeping/cbor-gen"
5+
6+
"github.com/filecoin-project/go-address"
7+
"github.com/filecoin-project/go-state-types/abi"
8+
"github.com/filecoin-project/go-state-types/builtin"
9+
)
10+
11+
var Methods = map[abi.MethodNum]builtin.MethodMeta{
12+
1: builtin.NewMethodMeta("Constructor", *new(func(*address.Address) *abi.EmptyValue)), // Constructor
13+
2: builtin.NewMethodMeta("PubkeyAddress", *new(func(*abi.EmptyValue) *address.Address)), // PubkeyAddress
14+
builtin.MustGenerateFRCMethodNum("AuthenticateMessage"): builtin.NewMethodMeta("AuthenticateMessage", *new(func(*AuthenticateMessageParams) *typegen.CborBool)), // AuthenticateMessage
15+
}

0 commit comments

Comments
 (0)