-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate types from specs-actors #1
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
version: 2.1 | ||
orbs: | ||
go: gotest/tools@0.0.9 | ||
codecov: codecov/codecov@1.0.2 | ||
|
||
executors: | ||
golang: | ||
docker: | ||
- image: circleci/golang:1.13 | ||
resource_class: small | ||
|
||
commands: | ||
install-deps: | ||
steps: | ||
- go/install-ssh | ||
- go/install: {package: git} | ||
prepare: | ||
parameters: | ||
linux: | ||
default: true | ||
description: is a linux build environment? | ||
type: boolean | ||
steps: | ||
- checkout | ||
- when: | ||
condition: << parameters.linux >> | ||
steps: | ||
- run: sudo apt-get update | ||
build-all: | ||
|
||
jobs: | ||
mod-tidy-check: | ||
executor: golang | ||
steps: | ||
- install-deps | ||
- prepare | ||
- go/mod-download | ||
- go/mod-tidy-check | ||
|
||
build-all: | ||
executor: golang | ||
steps: | ||
- install-deps | ||
- prepare | ||
- go/mod-download | ||
- run: | ||
command: make build | ||
- store_artifacts: | ||
path: go-state-types | ||
- store_artifacts: | ||
path: go-state-types | ||
|
||
check-gen: | ||
executor: golang | ||
steps: | ||
- install-deps | ||
- prepare | ||
- go/mod-download | ||
- run: | ||
name: "Install goimports" | ||
command: | | ||
cd / && go get golang.org/x/tools/cmd/goimports | ||
- run: | ||
name: "Ensure we don't need to run 'make gen'" | ||
command: | | ||
make gen && git diff --exit-code | ||
|
||
test-all: | ||
executor: golang | ||
steps: | ||
- install-deps | ||
- prepare | ||
- go/mod-download | ||
- run: | ||
command: | | ||
make test-coverage | ||
mkdir -p /tmp/artifacts | ||
mv coverage.out /tmp/artifacts/coverage.out | ||
- codecov/upload: | ||
file: /tmp/artifacts/coverage.out | ||
- store_artifacts: | ||
path: go-state-types | ||
|
||
lint: &lint | ||
description: | | ||
Run golangci-lint. | ||
parameters: | ||
executor: | ||
type: executor | ||
default: golang | ||
golangci-lint-version: | ||
type: string | ||
default: 1.23.1 | ||
concurrency: | ||
type: string | ||
default: '2' | ||
description: | | ||
Concurrency used to run linters. Defaults to 2 because NumCPU is not | ||
aware of container CPU limits. | ||
args: | ||
type: string | ||
default: '' | ||
description: | | ||
Arguments to pass to golangci-lint | ||
executor: << parameters.executor >> | ||
steps: | ||
- install-deps | ||
- prepare | ||
- run: | ||
command: make build | ||
- go/install-golangci-lint: | ||
gobin: $HOME/.local/bin | ||
version: << parameters.golangci-lint-version >> | ||
- run: | ||
name: Lint | ||
command: | | ||
$HOME/.local/bin/golangci-lint run -v --skip-dirs-use-default=false\ | ||
--concurrency << parameters.concurrency >> << parameters.args >> | ||
|
||
lint-all: | ||
<<: *lint | ||
|
||
workflows: | ||
version: 2.1 | ||
ci: | ||
jobs: | ||
- lint-all | ||
- mod-tidy-check | ||
- build-all | ||
- test-all | ||
- check-gen |
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,30 @@ | ||
GO_BIN ?= go | ||
GOLINT ?= golangci-lint | ||
|
||
all: build lint test tidy | ||
.PHONY: all | ||
|
||
build: | ||
$(GO_BIN) build ./... | ||
.PHONY: build | ||
|
||
test: | ||
$(GO_BIN) test ./... | ||
.PHONY: test | ||
|
||
test-coverage: | ||
$(GO_BIN) test -coverprofile=coverage.out ./... | ||
.PHONY: test-coverage | ||
|
||
tidy: | ||
$(GO_BIN) mod tidy | ||
.PHONY: tidy | ||
|
||
gen: | ||
$(GO_BIN) run ./gen/gen.go | ||
.PHONY: gen | ||
|
||
lint: | ||
$(GOLINT) run ./... | ||
.PHONY: lint | ||
|
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,38 @@ | ||
package abi | ||
|
||
import "strconv" | ||
|
||
// A sequential number assigned to an actor when created by the InitActor. | ||
// This ID is embedded in ID-type addresses. | ||
type ActorID uint64 | ||
|
||
func (e ActorID) String() string { | ||
return strconv.FormatInt(int64(e), 10) | ||
} | ||
|
||
// MethodNum is an integer that represents a particular method | ||
// in an actor's function table. These numbers are used to compress | ||
// invocation of actor code, and to decouple human language concerns | ||
// about method names from the ability to uniquely refer to a particular | ||
// method. | ||
// | ||
// Consider MethodNum numbers to be similar in concerns as for | ||
// offsets in function tables (in programming languages), and for | ||
// tags in ProtocolBuffer fields. Tags in ProtocolBuffers recommend | ||
// assigning a unique tag to a field and never reusing that tag. | ||
// If a field is no longer used, the field name may change but should | ||
// still remain defined in the code to ensure the tag number is not | ||
// reused accidentally. The same should apply to the MethodNum | ||
// associated with methods in Filecoin VM Actors. | ||
type MethodNum uint64 | ||
|
||
func (e MethodNum) String() string { | ||
return strconv.FormatInt(int64(e), 10) | ||
} | ||
|
||
// Multiaddrs is a byte array representing a Libp2p MultiAddress | ||
type Multiaddrs = []byte | ||
|
||
// PeerID is a byte array representing a Libp2p PeerID | ||
type PeerID = []byte | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so sure of these last two. I'd slightly prefer we dropped them and used
[]byte
directly. They both appear in miner info state, and hence in constructor params (which are also accessed by power actor).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to merge as is but we can reevaluate later today.