Skip to content

Commit df361f5

Browse files
authored
chore: create base nv28 skeleton (#418)
* chore: duplicate v17 to v18 chore: duplicate v17 to v18 * chore: update references to 18 from 17 chore: update references to v18 from v17 in builtin/v18 * chore: create base nv28-skeleton chore: create base nv28-skeleton * chore: update simple migration chore: update simple migration * chore: update folder name builtin/18 to builtin/v18 chore: update folder name builtin/18 to builtin/v18
1 parent e57db7c commit df361f5

File tree

112 files changed

+35137
-1
lines changed

Some content is hidden

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

112 files changed

+35137
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ gen:
3535
$(GO_BIN) run ./builtin/v15/gen/gen.go
3636
$(GO_BIN) run ./builtin/v16/gen/gen.go
3737
$(GO_BIN) run ./builtin/v17/gen/gen.go
38+
$(GO_BIN) run ./builtin/v18/gen/gen.go
3839
.PHONY: gen
3940

4041
lint:

actors/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
Version15 Version = 15
2727
Version16 Version = 16
2828
Version17 Version = 17
29+
Version18 Version = 18
2930
)
3031

3132
// Converts a network version into an actors adt version.
@@ -65,6 +66,8 @@ func VersionForNetwork(version network.Version) (Version, error) {
6566
return Version16, nil
6667
case network.Version27:
6768
return Version17, nil
69+
case network.Version28:
70+
return Version18, nil
6871
default:
6972
return -1, fmt.Errorf("unsupported network version %d", version)
7073
}
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+
}
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/v18/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/v18/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/v18/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)