Skip to content
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

feat(shared): add shared tools and types #9

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

hannahhoward
Copy link
Collaborator

Goals

Move a bunch of shared stuff over from lotus so we can work with things internally

Implementation

  • We have a new tool to do cbor-gen -- cbor-gen-for which allows you to just put a //go:generate cbor-gen-for ~structName~ comment near the struct that needs cbor methods and then just run go generate ./...
  • Copied over the shared types I was aware of from RetrievalMarket --Signature, SignedVoucher, Address, BigInt (now TokenAmount)
  • Ran go fmt
  • Copied over some shared utils - cborutil, crypto
  • Removed any lotus references

Copy link
Contributor

@ingar ingar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just some non-blocking comments. It seems like the tab settings are 8/6 for this? Do we care? I don't particularly care; not sure if it is a FC-wide code style to have 4/4.

@@ -26,6 +26,8 @@ const (
ExtensionDataTransfer = graphsync.ExtensionName("fil/data-transfer")
)

//go:generate cbor-gen-for ExtensionDataTransferData
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty cool.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait till it breaks though...

@@ -18,7 +18,7 @@ func NewLocalFileStore(basedirectory string) (FileStore, error) {
break
}
}
base := basedirectory[0:i + 1]
base := basedirectory[0 : i+1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's like path.Clean, path.Join that can do some of the path manipulation in this file...

go.mod Outdated
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
google.golang.org/appengine v1.5.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appengine!

@hannahhoward hannahhoward force-pushed the feat/infrastructure branch 2 times, most recently from 7001c47 to cc56e38 Compare December 17, 2019 00:29
- copy important types from lotus
- copy over address, cborutil, and crypto library
- switch to generating cbor through cbor-gen-for + go-generate
- run go fmt (hadn't been run)
- remove external depedencies on lotus
@hannahhoward hannahhoward merged commit d047563 into master Dec 17, 2019
laser pushed a commit that referenced this pull request Dec 18, 2019
@hannahhoward hannahhoward deleted the feat/infrastructure branch April 30, 2020 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants