You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated tbtc/gen/abi/Bridge.go, tbtc/gen/abi/WalletCoordinator.go, and tbtc/gen/abi/MaintainerProxy.go declare BitcoinTxInfo struct. To make the Go compiler happy, we rename BitcoinTxInfo to BitcoinTxInfo2 and BitcoinTxInfo3.
Those Go files are generated with @go run github.com/ethereum/go-ethereum/cmd/abigen.
But this is not enough! If we try to build the project with just this hook, we will encounter errors like:
pkg/chain/ethereum/tbtc/gen/contract/MaintainerProxy.go:730:3: cannot use arg_mainUtxo (variable of type "[github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen/abi](https://github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen/abi)".BitcoinTxUTXO) as type "[github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen/abi](https://github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen/abi)".BitcoinTxUTXO2 in argument to mp.contract.NotifyMovingFundsBelowDust
Looking at the generated code at the problematic line:
mp.contract.NotifyFundsBelowDust is declared in the tbtc/gen/abi/MaintainerProxy.go and expects BitcoinTxUTXO2.
arg_mainUtxo from tbtc/gen/contract/MaintainerProxy.go has an incorrect type though: arg_mainUtxo abi.BitcoinTxUTXO,
Just like tbtc/gen/abi/MaintainerProxy.go this file is generated based on tbtc/gen/abi/MaintainerProxy.abi and in the *.abi file we don't have the rename performed by after_abi_hook.
The compilation error was solved with the after_contract_hook which is partially a result of ethereum/go-ethereum#24627 and partially how our Go contract bindings work. The fix from ethereum/go-ethereum#24924 will change the generated tbtc/gen/abi/*.go files but we'll have to adjust the @go run github.com/keep-network/keep-common/tools/generators/ethereum logic to follow the same naming rules as the *.abi file will remain unchanged.
The text was updated successfully, but these errors were encountered:
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.
May depend on #45
See keep-network/keep-core#3630
after_abi_hook
inkeep-core
renames structures that were incorrectly re-declared in the same Go package given this bug: ethereum/go-ethereum#24627.The generated
tbtc/gen/abi/Bridge.go
,tbtc/gen/abi/WalletCoordinator.go
, andtbtc/gen/abi/MaintainerProxy.go
declareBitcoinTxInfo
struct. To make the Go compiler happy, we renameBitcoinTxInfo
toBitcoinTxInfo2
andBitcoinTxInfo3
.Those Go files are generated with
@go run github.com/ethereum/go-ethereum/cmd/abigen
.But this is not enough! If we try to build the project with just this hook, we will encounter errors like:
Looking at the generated code at the problematic line:
mp.contract.NotifyFundsBelowDust
is declared in thetbtc/gen/abi/MaintainerProxy.go
and expectsBitcoinTxUTXO2
.arg_mainUtxo
fromtbtc/gen/contract/MaintainerProxy.go
has an incorrect type though:arg_mainUtxo abi.BitcoinTxUTXO,
Just like
tbtc/gen/abi/MaintainerProxy.go
this file is generated based ontbtc/gen/abi/MaintainerProxy.abi
and in the*.abi
file we don't have the rename performed byafter_abi_hook
.The compilation error was solved with the
after_contract_hook
which is partially a result of ethereum/go-ethereum#24627 and partially how our Go contract bindings work. The fix from ethereum/go-ethereum#24924 will change the generatedtbtc/gen/abi/*.go
files but we'll have to adjust the@go run github.com/keep-network/keep-common/tools/generators/ethereum
logic to follow the same naming rules as the*.abi
file will remain unchanged.The text was updated successfully, but these errors were encountered: