-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create base nv24 skeleton * Delete migration specific for nv24 * Remove .go= duplicate files * Use v15 instead of v14 --------- Co-authored-by: Phi-rjan <orjan.roren@gmail.com>
- Loading branch information
Showing
107 changed files
with
33,962 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package account | ||
|
||
type AuthenticateMessageParams struct { | ||
Signature []byte | ||
Message []byte | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.