Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Add typechain to nitro-protocol #3604

Merged
merged 5 commits into from
Jun 16, 2021
Merged

Add typechain to nitro-protocol #3604

merged 5 commits into from
Jun 16, 2021

Conversation

geoknee
Copy link
Contributor

@geoknee geoknee commented Jun 15, 2021

https://www.notion.so/statechannels/Add-TypeChain-tooling-f17342226cb44244be4820b9937c9fae

This PR brings us to a state where we can do this:

Screenshot 2021-06-07 at 13 11 49

I didn't spread the types around the codebase much, yet. For now I just used them in the gas benchmarking test. We can do more of that kind of thing in future PRs.

@geoknee geoknee changed the title Typechaaaaaaain Add typechain to nitro-protocol Jun 15, 2021
export let erc20AssetHolder: Contract;
export let nitroAdjudicator: Contract;
export let token: Contract;
export let ethAssetHolder: ETHAssetHolder & Contract;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this intersection type is the canonical way to use typechain. But it works well!

@geoknee geoknee mentioned this pull request Jun 15, 2021
@geoknee geoknee requested a review from NiloCK June 15, 2021 16:41
@@ -112,6 +112,7 @@ jobs:
- packages/*/dist
- packages/*/build
- packages/nitro-protocol/artifacts
- packages/nitro-protocol/typechain
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarifying circle config:

This is writing these directories into the filesystem of circleCI's vm, and not persisting in the 'artifact' sense? It writes these to make them available for the later test job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly!

Copy link
Contributor

@NiloCK NiloCK left a comment

Choose a reason for hiding this comment

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

This is great! The gas benchmarks, along with typechain, serve as a much improved walk-through of nitro workflows with great discoverability.

I am having had some trouble running this locally. For reference, things were cleared up after some yarn clean, yarn, and closing out all VSCode windows, which seemed to be hanging onto some out of date cached typings.

@geoknee geoknee merged commit 59c48b4 into master Jun 16, 2021
@geoknee geoknee deleted the typechaaaaaaain branch June 16, 2021 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants