Skip to content

Commit

Permalink
Compilation error fix due to duplicated generated types (#3760)
Browse files Browse the repository at this point in the history
This PR fixes a compilation problem due to duplicated types that were
generated by the `abigen`.
The problem is due to an error in the version of `abigen` that we use
for contract code generation.
See keep-network/keep-common#117 for
explanation.
  • Loading branch information
lukasz-zimnoch authored Jan 8, 2024
2 parents e1670d9 + 10b46e4 commit d0bfe1d
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/chain/ethereum/tbtc/gen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ define after_abi_hook
endef
define fix_wallet_proposal_validator_collision
@perl -pi -e s,BitcoinTxInfo,BitcoinTxInfo2,g ./abi/WalletProposalValidator.go
@perl -pi -e s,BitcoinTxUTXO,BitcoinTxUTXO3,g ./abi/WalletProposalValidator.go
endef
define fix_maintainer_proxy_collision
@perl -pi -e s,BitcoinTxUTXO,BitcoinTxUTXO2,g ./abi/MaintainerProxy.go
Expand All @@ -35,8 +36,13 @@ endef
# See explanation in https://github.com/keep-network/keep-common/issues/117.
define after_contract_hook
$(eval type := $(1))
$(if $(filter $(type),WalletProposalValidator),$(call fix_wallet_proposal_validator_contract_collision))
$(if $(filter $(type),MaintainerProxy),$(call fix_maintainer_proxy_contract_collision))
endef
define fix_wallet_proposal_validator_contract_collision
@perl -pi -e s,BitcoinTxUTXO,BitcoinTxUTXO3,g ./contract/WalletProposalValidator.go
@perl -pi -e s,BitcoinTxUTXO,BitcoinTxUTXO3,g ./cmd/WalletProposalValidator.go
endef
define fix_maintainer_proxy_contract_collision
@perl -pi -e s,BitcoinTxUTXO,BitcoinTxUTXO2,g ./contract/MaintainerProxy.go
@perl -pi -e s,BitcoinTxProof,BitcoinTxProof2,g ./contract/MaintainerProxy.go
Expand Down
47 changes: 46 additions & 1 deletion pkg/chain/ethereum/tbtc/gen/abi/WalletProposalValidator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions pkg/chain/ethereum/tbtc/gen/cmd/WalletProposalValidator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions pkg/chain/ethereum/tbtc/gen/contract/WalletProposalValidator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0bfe1d

Please sign in to comment.