Skip to content

Generalised ChainClient - #8843

Merged
prashantkumar1982 merged 36 commits into
developfrom
feature/generalised-chain-client
Apr 24, 2023
Merged

Generalised ChainClient#8843
prashantkumar1982 merged 36 commits into
developfrom
feature/generalised-chain-client

Conversation

@sdrug

@sdrug sdrug commented Mar 27, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread core/chains/evm/client/client.go
Comment thread core/chains/evm/client/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go
Comment thread core/chains/evm/client/client.go Outdated
Comment thread core/chains/evm/client/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go
@sdrug
sdrug marked this pull request as ready for review April 18, 2023 11:27
@sdrug
sdrug requested a review from a team April 18, 2023 11:27
@sdrug
sdrug requested review from a team, PiotrTrzpil, connorwstein and pinebit as code owners April 18, 2023 11:27
Comment thread core/chains/evm/client/client.go
Base automatically changed from txm/BCI-1159/use_generics to develop April 21, 2023 02:25
Comment thread core/chains/evm/txmgr/eth_confirmer.go Outdated
}

func (ec *EthConfirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) getMinedTransactionCount(ctx context.Context, from ADDR) (nonce uint64, err error) {
func (ec *EthConfirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) getMinedTransactionCount(ctx context.Context, from ADDR) (nonce evmtypes.Nonce, err error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Huh, this function name is totally misleading.
Could you rename it to: getMinedSequenceForAddress()

Comment thread core/chains/evm/txmgr/eth_confirmer.go Outdated
Comment thread core/chains/evm/txmgr/eth_broadcaster_test.go Outdated
Comment thread core/chains/evm/client/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
Comment thread common/txmgr/types/client.go Outdated
sdrug added 2 commits April 24, 2023 05:20
Split HASH into TXHASH and BLOCKHASH in generic interface + test fixes

Fixing tests

Fixing tests

SequenceAt mock returns evmtypes.Nonce

LINKBalance in client interface

Fixing LINKBalance test
func (c *SimulatedBackendClient) FilterEvents(ctx context.Context, q ethereum.FilterQuery) (logs []types.Log, err error) {
return c.b.FilterLogs(ctx, q)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we keep both FilterEvents and FilterLogs if they are identical?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If i remember correctly, we are trying to use the more generic naming Events rather than Logs

so in the generic interface there is only FilterEvents so we wrap FilterLogs into FilterEvents to conform to the interface

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, I tried shifting to the FilterEvents same as we did with nonce -> sequence across the code base, but it's actually too large of a change for this PR, so I limited it to only conforming to the generic interface for now.

Comment thread core/chains/evm/client/simulated_backend_client.go Outdated
Comment thread core/chains/evm/forwarders/forwarder_manager.go Outdated
Comment thread core/web/eth_keys_controller.go Outdated
Comment thread core/web/eth_keys_controller.go Outdated
func (c *SimulatedBackendClient) FilterEvents(ctx context.Context, q ethereum.FilterQuery) (logs []types.Log, err error) {
return c.b.FilterLogs(ctx, q)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If i remember correctly, we are trying to use the more generic naming Events rather than Logs

so in the generic interface there is only FilterEvents so we wrap FilterLogs into FilterEvents to conform to the interface

Comment thread core/chains/evm/client/simulated_backend_client.go Outdated
Comment thread core/chains/evm/txmgr/eth_confirmer.go Outdated
Comment thread core/web/resolver/eth_key.go Outdated
@cl-sonarqube-production

Copy link
Copy Markdown

SonarQube Quality Gate

Quality Gate failed

Failed condition 45.5% 45.5% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@aalu1418
aalu1418 requested review from aalu1418 and jmank88 April 24, 2023 19:19

@aalu1418 aalu1418 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

@prashantkumar1982
prashantkumar1982 merged commit 9fd994e into develop Apr 24, 2023
@prashantkumar1982
prashantkumar1982 deleted the feature/generalised-chain-client branch April 24, 2023 19:55
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.

6 participants