Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Add Go contract bindings #739

Merged
merged 14 commits into from
Oct 22, 2020
Merged

Add Go contract bindings #739

merged 14 commits into from
Oct 22, 2020

Conversation

lukasz-zimnoch
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch commented Oct 14, 2020

Refs: keep-network/keep-ecdsa#574
Depends on: keep-network/keep-common#52
Depends on: keep-network/keep-common#53

Added a Makefile allowing to generate Go bindings for given contracts using the go generate ./... command. The solution is based on similar ones from keep-core and keep-ecdsa projects. This PR also ships several ready to use bindings prepared using the aforementioned Makefile.

Added a Makefile allowing
to generate Go bindings of
given contracts.
@pdyraga
Copy link
Member

pdyraga commented Oct 14, 2020

Thoughts on keeping all of it in go directory? We have tbtc/solidity so tbtc/go looks less cryptic to me than tbtc/bindings.

go/Makefile Outdated Show resolved Hide resolved
go/Makefile Outdated Show resolved Hide resolved
go/abi/DepositLog.go Outdated Show resolved Hide resolved
go/generate.sh Outdated Show resolved Hide resolved
go/go.mod Outdated Show resolved Hide resolved
This change is motivated by the
fact that `TBTCSystem` contract
derives from `DepositLog` and it
is the contract actually emitting
deposit lifecycle events.
@Shadowfiend
Copy link
Contributor

Thoughts on keeping all of it in go directory? We have tbtc/solidity so tbtc/go looks less cryptic to me than tbtc/bindings.

I know it's going to feel weird at first blush, but let's put these at the top level of the repo with a structure that matches what we're using elsewhere IMO. As in, pkg/chain/ethereum/gen.

@pdyraga
Copy link
Member

pdyraga commented Oct 19, 2020

Thoughts on keeping all of it in go directory? We have tbtc/solidity so tbtc/go looks less cryptic to me than tbtc/bindings.

I know it's going to feel weird at first blush, but let's put these at the top level of the repo with a structure that matches what we're using elsewhere IMO. As in, pkg/chain/ethereum/gen.

Yeah, that's a very good idea. I guess we were thinking all the time that tbtc is Solidity-only and we were trying to reflect it in the directory structure by again, thinking that we are adding some Go but not that mutch. Nevertheless, it's no longer just a Solidity repository, and having the same structure everywhere is a good move. Especially that we already have Kube infrastructure files here.

@lukasz-zimnoch lukasz-zimnoch marked this pull request as ready for review October 20, 2020 11:58
@lukasz-zimnoch
Copy link
Member Author

lukasz-zimnoch commented Oct 20, 2020

@pdyraga everything is addressed here. I'm ready for the next look!

@pdyraga pdyraga merged commit 135f6c5 into master Oct 22, 2020
@pdyraga pdyraga deleted the contract-bindings branch October 22, 2020 10:53
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.

3 participants