Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Replace Deposit Record with Event #90

Merged
merged 20 commits into from
Oct 13, 2021

Conversation

waymobetta
Copy link
Contributor

@waymobetta waymobetta commented Sep 20, 2021

Description

Taking into account the recent gas optimizations made, we implement some changes to how event handlers are managed.

Some thoughts I have:

  • The EventHandlersFunc type could probably be kept more general so as to be used for different event types, rather than being made specific to deposits as I have it now
  • The relayer.Message.Payload is currently a []interface{}, which is nice because it is flexible but also I feel it could be made more strict

Related Issue Or Context

Closes: #69

How Has This Been Tested? Testing details.

A basic unit test but live/local and/or mock testing needs to be done.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in chainbridge-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

@lgtm-com
Copy link

lgtm-com bot commented Sep 21, 2021

This pull request fixes 3 alerts when merging 8a16d12 into 7d0ef93 - view on LGTM.com

fixed alerts:

  • 3 for Useless assignment to local variable

@P1sar P1sar changed the base branch from main to develop September 30, 2021 14:25
@waymobetta waymobetta mentioned this pull request Oct 1, 2021
9 tasks
@P1sar P1sar requested review from MakMuftic, P1sar and mpetrun5 October 5, 2021 13:00
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Go Test coverage is 18.8 %\ ✨ ✨ ✨

@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Go Test coverage is 17.4 %\ ✨ ✨ ✨

@waymobetta waymobetta marked this pull request as ready for review October 7, 2021 06:21
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Go Test coverage is 17.4 %\ ✨ ✨ ✨

@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Go Test coverage is 17.4 %\ ✨ ✨ ✨

chains/evm/listener/listener.go Outdated Show resolved Hide resolved
chains/evm/listener/event-handler.go Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Go Test coverage is 17.4 %\ ✨ ✨ ✨

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

Go Test coverage is 17.6 %\ ✨ ✨ ✨

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

Go Test coverage is 17.6 %\ ✨ ✨ ✨

chains/evm/listener/event-handler.go Outdated Show resolved Hide resolved
chains/evm/listener/event-handler.go Outdated Show resolved Hide resolved
chains/evm/listener/event-handler_test.go Outdated Show resolved Hide resolved
chains/evm/listener/event-handler_test.go Outdated Show resolved Hide resolved
chains/evm/listener/event-handler_test.go Outdated Show resolved Hide resolved
chains/evm/listener/event-handler_test.go Outdated Show resolved Hide resolved
@github-actions
Copy link

Go Test coverage is 17.6 %\ ✨ ✨ ✨

@github-actions
Copy link

Go Test coverage is 17.6 %\ ✨ ✨ ✨

@github-actions
Copy link

Go Test coverage is 17.1 %\ ✨ ✨ ✨

@github-actions
Copy link

Go Test coverage is 17.1 %\ ✨ ✨ ✨

@waymobetta waymobetta requested a review from mpetrun5 October 13, 2021 04:09
Copy link
Member

@mpetrun5 mpetrun5 left a comment

Choose a reason for hiding this comment

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

Some minor things to fix, but other than that LGTM

chains/evm/listener/event-handler.go Show resolved Hide resolved
chains/evm/listener/listener_test.go Show resolved Hide resolved
chains/evm/listener/event-handler.go Show resolved Hide resolved
@P1sar P1sar merged commit a066433 into develop Oct 13, 2021
@P1sar P1sar deleted the waymobetta/replace-deposit-record-with-event branch October 13, 2021 14:32
MakMuftic pushed a commit that referenced this pull request Oct 27, 2021
* Update contract ABIs + binaries

* Update deposit signature

* Update Erc20EventHandler function signature

* Update deposit event struct fields, add documentation, remove deprecated function, add todo

* Add documentation + refactor

* Add unit test

* Fix deposit signature

* Fix type in signature

* Rename address field for clarity

* Add documentation, update variable names

* refactor, add todo, fix test

* remove recipient address length from payload field

* pull ABI definition from consts, remove todo

* add mock + mock test

* fix resource ID type

* fix resource ID type

* fix test
MakMuftic pushed a commit that referenced this pull request Oct 28, 2021
* Update contract ABIs + binaries

* Update deposit signature

* Update Erc20EventHandler function signature

* Update deposit event struct fields, add documentation, remove deprecated function, add todo

* Add documentation + refactor

* Add unit test

* Fix deposit signature

* Fix type in signature

* Rename address field for clarity

* Add documentation, update variable names

* refactor, add todo, fix test

* remove recipient address length from payload field

* pull ABI definition from consts, remove todo

* add mock + mock test

* fix resource ID type

* fix resource ID type

* fix test
P1sar added a commit that referenced this pull request Nov 19, 2021
* Generic handler implementation (#102)

* Implement generic event handler

* Fix generic message handler type

* Move abi to consts package

* Fix generic handler abi string

* Get deposit record tests (#114)

* Make GetDepositRecord public

* Add fetching deposit record unit tests

* Add gomock to dependecies

* Check if rec is not nil

* Generic handler cmd commands (#118)

* Add command to deploy generic handler

* Fix deploy generic handler types

* Implement registering generic resource with function sig hashing

* Implement hash functionality when setting generic resource

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Refactor balance erc20 command

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Add get solidity function tests

* Rename hash-exists command

* Update README

* Fix linter

* Mark cmd flags that previously had default values as required

* Remove get deposit record logic

* Rename chainID to domainID (#86)

* Rename chainID to domainID

* Fix ChainID usage as related to Ethereum client

* Fix chainID CLI arguments + tests

* Fix flag names + descriptions

* Update ABIs + BINs

* update ABIs + binaries

* replace chainID with domainID + fix comments

* refactor error

* add missing error handling

* remove unnecessary struct field

* Implement generic event handler

* Move abi to consts package

* Fix generic handler abi string

* ERC721 handler implementation (#112)

* Add Erc721 event handler function

* Change return type of message handler

* Remove Proposer usage

* Add mising props to payload

* Listen to events unit tests (#116)

* Add unit tests

* Add listener mocks

* Add blockstore mocks

* Add gomock lib

* Define resource ID type (#117)

* Define type for resource ID

* Use resource ID as type instead of [32]bytes + rename rID to resourceID

* Replace [32]byte with resource id type

* Add the CLI command for base currency transfer (#115)

* add value parameter to the transact function call;

Signed-off-by: tcar <tcar121293@gmail.com>

* add cli command for base currency transfer;

Signed-off-by: tcar <tcar121293@gmail.com>

* add value parameter to the transact function;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix minor issues;

Signed-off-by: tcar <tcar121293@gmail.com>

* handle error;

Signed-off-by: tcar <tcar121293@gmail.com>

* add nil check;

Signed-off-by: tcar <tcar121293@gmail.com>

* add transfer command to the readme document;

Signed-off-by: tcar <tcar121293@gmail.com>

* optimize code;

Signed-off-by: tcar <tcar121293@gmail.com>

* Replace Deposit Record with Event (#90)

* Update contract ABIs + binaries

* Update deposit signature

* Update Erc20EventHandler function signature

* Update deposit event struct fields, add documentation, remove deprecated function, add todo

* Add documentation + refactor

* Add unit test

* Fix deposit signature

* Fix type in signature

* Rename address field for clarity

* Add documentation, update variable names

* refactor, add todo, fix test

* remove recipient address length from payload field

* pull ABI definition from consts, remove todo

* add mock + mock test

* fix resource ID type

* fix resource ID type

* fix test

* EIP1559 fees (#111)

* Migrate CLI documentation from core-example (#91)

* migrate CLI documentation from core-example

* fix syntax

* add celo-evm differences

* fix formatting

* small missing error + add error handling

* Fix CI errors (#109)

* squashed erip1559 old branch

* revisited how gas prcie estimation happen on the london gaspricer
all logic related to gasprice calulations moved to gasprices from client

* make client to be an argument to gaspricers methods

* gas prices calculations or estmation moved from client

* add gaspricer usage to cli:

* fix e2e tests, linters

* Add static gasPricer unit tests
GaPRicer Multiplayer renamed to Factor

* unit tests added for london gasPricer

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>

* Generic integration e2e test (#134)

* Rename chainID to domainID (#86)

* Rename chainID to domainID

* Fix ChainID usage as related to Ethereum client

* Fix chainID CLI arguments + tests

* Fix flag names + descriptions

* Update ABIs + BINs

* update ABIs + binaries

* replace chainID with domainID + fix comments

* refactor error

* add missing error handling

* remove unnecessary struct field

* Get deposit record tests (#114)

* Make GetDepositRecord public

* Add fetching deposit record unit tests

* Add gomock to dependecies

* Check if rec is not nil

* Add command to deploy generic handler

* Implement registering generic resource with function sig hashing

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Refactor deposit to accept deposit data instead of targeting only erc20 deposits

* Add generic deposit e2e test

* Move test setup to SetupSuite

* Check stored hash from created hash in generic test

* Generic handler cmd commands (#118)

* Add command to deploy generic handler

* Fix deploy generic handler types

* Implement registering generic resource with function sig hashing

* Implement hash functionality when setting generic resource

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Refactor balance erc20 command

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Add get solidity function tests

* Rename hash-exists command

* Update README

* Fix linter

* Mark cmd flags that previously had default values as required

* Fix deposit command

* Cleanup rebase

* Update abi consts

* Add generic handler unit tests

* Reduce calldata length on generic event handler to include only metadata length

* Add depositer offset to setting generic resource

* Update README

* Replace using topics for deposits with unpacking it from raw data

* Add unpack deposit event log tests

* Replace calldata with data to fix unpack into interface

* Add unpack deposit event unit tests

* Update VoteProposal for new contracts

* Vote on proposal if it is inactive as well

* Fix tests

* Fix vote proposal

* Move test config to struct

* Fix generic handler deploy

* Fix erc20 e2e test RID

* Replace manually creating calldata in test with ConstructErc20DepositData

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>

* Integrate changes from develop

* Update e2e tests

* Refactor e2e env params as struct

* Fix makefile

* Fix lint errors

* Fix centrifuge tests

* ERC721 related cli CMDs (#143)

* fix typo and wrong cmd use; (#138)

* Implement generic event handler

* Move abi to consts package

* ERC721 handler implementation (#112)

* Add Erc721 event handler function

* Change return type of message handler

* Remove Proposer usage

* Add mising props to payload

* Implement deploy flow for ERC721

* Add implementation of all erc721 commands

* Add addminter command

* Refactor mint cmd

* Refactor owner command

* Refactor deposit CLI command

* Refactor approve CLI command

* Refactor add-minter CLI command

* Fix client type

* Fix merge bugs

* Expand README file and code cleanup in CLI commands

* Remove generic handler code

* Revert updates on generic event handler

* Add deploy flags to README and mark all flags as required in deploy command

* Update mod and sum files

* Remove duplicated functions (#130)

* brake import cycle and remove duplicated functions;

Signed-off-by: tcar <tcar121293@gmail.com>

* add test for ToCallArg function;

Signed-off-by: tcar <tcar121293@gmail.com>

* add test case for ToCallArg function;

Signed-off-by: tcar <tcar121293@gmail.com>

* move ChainClient interface to listener;

Signed-off-by: tcar <tcar121293@gmail.com>

* Refactor CLI commands to call new calls

* Refactor deposit function to return hash and error

* Initial test setup

* Write cli I/O output data to file (#119)

* Add func for writing cli i/o data to log file

* Add test for writing cli i/o data to log file

* Refactor cli data writer

* Add test for writing cli i/o data to log file

* Implement cli writer into all commands

* Refactor and rename writer to logger

* Add test for logger

* Move logger to comand PreRun

* Fix lint

* Remove excess func call

* Code cleanup

* Fix cli deploy command flags (#146)

* set some flags to be optional;

Signed-off-by: tcar <tcar121293@gmail.com>

* use value from func param;

Signed-off-by: tcar <tcar121293@gmail.com>

* use fee flag and validate flags

Signed-off-by: tcar <tcar121293@gmail.com>

* update tests;

Signed-off-by: tcar <tcar121293@gmail.com>

* Fix fee type

* Remove old check for empty bridge address from deploy command

* Fix failing tests

* Fix typos

* Fix event-handler and add basic unit test

* Expand unit tests for event-handler

* Merge deposit logs and remove error definitions in deploy cmd

* Fix bind flag commands

Co-authored-by: tcar121293 <tcar121293@gmail.com>
Co-authored-by: Matija Petrunic <matija.petrunic@fer.hr>
Co-authored-by: Nikola Mlinarić <35880252+nmlinaric@users.noreply.github.com>

* Fix linter

* Fix merge bugs

* Add e2e setup command in Makefile

* Add logging to erc721 CLI commands

* ERC721 e2e tests (#185)

* Update abis

* WIP adding e2e tests

* Fix tests and add event hendler tests

* Fix linter error

* Fix handling erc721 metadata and expand event handler testst

* Fix missing comment

* Add missing comment

* Fix missing props in e2e config

* Fix duplicate function in deploy

* Change minimal calldata length for erc721 handler

* Fix failin unit test

* Fix failing logger tests

* Change assertion in logger test

Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>
Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Nikola Mlinarić <35880252+nmlinaric@users.noreply.github.com>
Co-authored-by: tcar121293 <tcar121293@gmail.com>
Co-authored-by: Kirill <pisarevkir@gmail.com>
P1sar added a commit that referenced this pull request Nov 19, 2021
* Rename chainID to domainID (#86)

* Rename chainID to domainID

* Fix ChainID usage as related to Ethereum client

* Fix chainID CLI arguments + tests

* Fix flag names + descriptions

* Update ABIs + BINs

* update ABIs + binaries

* replace chainID with domainID + fix comments

* refactor error

* add missing error handling

* remove unnecessary struct field

* Add setDepositNonce Admin command (#87)

* Update ABIs, binaries, remove unwanted comments, add set-deposit-nonce cmd and add cmd to admin command list

* Improve description and add required flag checks

* Remove comment

* Fix nonce type, add unit test

* Feat/#70 combine vote with execute (#110)

* Migrate CLI documentation from core-example (#91)

* migrate CLI documentation from core-example

* fix syntax

* add celo-evm differences

* fix formatting

* small missing error + add error handling

* remove execute from vote flow

* Add setDepositNonce Admin command (#87)

* Update ABIs, binaries, remove unwanted comments, add set-deposit-nonce cmd and add cmd to admin command list

* Improve description and add required flag checks

* Remove comment

* Fix nonce type, add unit test

* Fix CI errors (#109)

* proposal type moved to separate module, all its methods moved to separate module to be more goway

* fix

* fix import problem

* fix how we hqandle errors that probably should not happen in cli:

* function name update, return status fix

* remove unclear code comment:

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>

* Define resource ID type (#117)

* Define type for resource ID

* Use resource ID as type instead of [32]bytes + rename rID to resourceID

* Replace [32]byte with resource id type

* Add the CLI command for base currency transfer (#115)

* add value parameter to the transact function call;

Signed-off-by: tcar <tcar121293@gmail.com>

* add cli command for base currency transfer;

Signed-off-by: tcar <tcar121293@gmail.com>

* add value parameter to the transact function;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix minor issues;

Signed-off-by: tcar <tcar121293@gmail.com>

* handle error;

Signed-off-by: tcar <tcar121293@gmail.com>

* add nil check;

Signed-off-by: tcar <tcar121293@gmail.com>

* add transfer command to the readme document;

Signed-off-by: tcar <tcar121293@gmail.com>

* optimize code;

Signed-off-by: tcar <tcar121293@gmail.com>

* Replace Deposit Record with Event (#90)

* Update contract ABIs + binaries

* Update deposit signature

* Update Erc20EventHandler function signature

* Update deposit event struct fields, add documentation, remove deprecated function, add todo

* Add documentation + refactor

* Add unit test

* Fix deposit signature

* Fix type in signature

* Rename address field for clarity

* Add documentation, update variable names

* refactor, add todo, fix test

* remove recipient address length from payload field

* pull ABI definition from consts, remove todo

* add mock + mock test

* fix resource ID type

* fix resource ID type

* fix test

* Calldata length check logic + test (#121)

* Update contract ABIs + binaries

* Update deposit signature

* Update Erc20EventHandler function signature

* Update deposit event struct fields, add documentation, remove deprecated function, add todo

* Add documentation + refactor

* Add unit test

* Fix deposit signature

* Fix type in signature

* Rename address field for clarity

* Add documentation, update variable names

* refactor, add todo, fix test

* remove recipient address length from payload field

* pull ABI definition from consts, remove todo

* add mock + mock test

* fix resource ID type

* fix resource ID type

* fix test

* add test for incorrect calldata length

* add dev notes

* fix slice index in test

* Update calls for new contracts (#128)

* Replace using topics for deposits with unpacking it from raw data

* Add unpack deposit event log tests

* Replace calldata with data to fix unpack into interface

* Add unpack deposit event unit tests

* Update VoteProposal for new contracts

* Vote on proposal if it is inactive as well

* EIP1559 fees (#111)

* Migrate CLI documentation from core-example (#91)

* migrate CLI documentation from core-example

* fix syntax

* add celo-evm differences

* fix formatting

* small missing error + add error handling

* Fix CI errors (#109)

* squashed erip1559 old branch

* revisited how gas prcie estimation happen on the london gaspricer
all logic related to gasprice calulations moved to gasprices from client

* make client to be an argument to gaspricers methods

* gas prices calculations or estmation moved from client

* add gaspricer usage to cli:

* fix e2e tests, linters

* Add static gasPricer unit tests
GaPRicer Multiplayer renamed to Factor

* unit tests added for london gasPricer

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>

* Cli flag usage refactor (#127)

* refactor CLI flags handling;

Signed-off-by: tcar <tcar121293@gmail.com>

* mark required fields;

Signed-off-by: tcar <tcar121293@gmail.com>

* update docs;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix variable name;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix variable name;

Signed-off-by: tcar <tcar121293@gmail.com>

* rename function and refactor utils;

Signed-off-by: tcar <tcar121293@gmail.com>

* rename handler into minter;

Signed-off-by: tcar <tcar121293@gmail.com>

* refactor accounts cli flags; optimise code;

Signed-off-by: tcar <tcar121293@gmail.com>

* remove unnecessary error check;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix linter error;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix lint error;

Signed-off-by: tcar <tcar121293@gmail.com>

* Omit shorthand flag name option + make validate and process functions public (#136)

* Omit shorthand flag name option

* Make validate and process flags functions public

* fix typo and wrong cmd use; (#138)

* Remove duplicated functions (#130)

* brake import cycle and remove duplicated functions;

Signed-off-by: tcar <tcar121293@gmail.com>

* add test for ToCallArg function;

Signed-off-by: tcar <tcar121293@gmail.com>

* add test case for ToCallArg function;

Signed-off-by: tcar <tcar121293@gmail.com>

* move ChainClient interface to listener;

Signed-off-by: tcar <tcar121293@gmail.com>

* Write cli I/O output data to file (#119)

* Add func for writing cli i/o data to log file

* Add test for writing cli i/o data to log file

* Refactor cli data writer

* Add test for writing cli i/o data to log file

* Implement cli writer into all commands

* Refactor and rename writer to logger

* Add test for logger

* Move logger to comand PreRun

* Fix lint

* Remove excess func call

* Fix cli deploy command flags (#146)

* set some flags to be optional;

Signed-off-by: tcar <tcar121293@gmail.com>

* use value from func param;

Signed-off-by: tcar <tcar121293@gmail.com>

* use fee flag and validate flags

Signed-off-by: tcar <tcar121293@gmail.com>

* update tests;

Signed-off-by: tcar <tcar121293@gmail.com>

* Relayer config (#162)

* Move chain config to separate directory

* Implement relayer config

* Add default relayer config values

* Use port and address for Prometheus from config

* Add config tests

* Update go.mod

* Fix rename chain ID to domain ID (#155)

* Fix rename chain ID to domain ID

* rename occurrences of dest id to domain id

* add e2e tests (#163)

* add e2e tests

* fix GA flow

* fix GA flow

* some renames to make idea more clear

* remove redundad geth nodes, fix rleayer config

* add unit tests for evm-tx bug

* add unit tests for evm-tx bug

* Update chains/evm/evmtransaction/evm-tx_test.go

Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>

* type fiix:

Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>

* add set and get relayer threshold commands; (#170)

Signed-off-by: tcar <tcar121293@gmail.com>

Co-authored-by: Kirill <pisarevkir@gmail.com>

* Fix nonce not unlocking (#167)

* Fix nonce not unlocking

* Add tests for nonce not unlocking

* Add utils package mock

* Add utils mock generation

* Fix gas price check after EIp-1559 implementation

* Add happy path utils test

* Add happy path deploy tests

Co-authored-by: Kirill <pisarevkir@gmail.com>

* Fix flags default values (#172)

* Set decimals default value to 0

* Set decimals flags as required

Co-authored-by: Kirill <pisarevkir@gmail.com>

* Add cmd argument to binding function (#173)

* add cmd argument to binding function;

Signed-off-by: tcar <tcar121293@gmail.com>

* add argument to bindings function;

Signed-off-by: tcar <tcar121293@gmail.com>

* make codebase consistent;

Signed-off-by: tcar <tcar121293@gmail.com>

Co-authored-by: Kirill <pisarevkir@gmail.com>

* Increase e2e relayer count (#180)

* Increase e2e test relayer count

* Fix GA e2e workflow

* update ABI constants with V2 contracts ABI; (#182)

* update ABI constants with V2 contracts ABI;

Signed-off-by: tcar <tcar121293@gmail.com>

* Fix failing tests

Co-authored-by: Kirill <pisarevkir@gmail.com>
Co-authored-by: Mak Muftic <mak@chainsafe.io>

* Update and separate constants (#183)

* update ABI constants with V2 contracts ABI;

Signed-off-by: tcar <tcar121293@gmail.com>

* separate constants into separate files;

Signed-off-by: tcar <tcar121293@gmail.com>

* Generic handler implementation (#174)

* Generic handler implementation (#102)

* Implement generic event handler

* Fix generic message handler type

* Move abi to consts package

* Fix generic handler abi string

* Get deposit record tests (#114)

* Make GetDepositRecord public

* Add fetching deposit record unit tests

* Add gomock to dependecies

* Check if rec is not nil

* Generic handler cmd commands (#118)

* Add command to deploy generic handler

* Fix deploy generic handler types

* Implement registering generic resource with function sig hashing

* Implement hash functionality when setting generic resource

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Refactor balance erc20 command

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Add get solidity function tests

* Rename hash-exists command

* Update README

* Fix linter

* Mark cmd flags that previously had default values as required

* Remove get deposit record logic

* Generic integration e2e test (#134)

* Rename chainID to domainID (#86)

* Rename chainID to domainID

* Fix ChainID usage as related to Ethereum client

* Fix chainID CLI arguments + tests

* Fix flag names + descriptions

* Update ABIs + BINs

* update ABIs + binaries

* replace chainID with domainID + fix comments

* refactor error

* add missing error handling

* remove unnecessary struct field

* Get deposit record tests (#114)

* Make GetDepositRecord public

* Add fetching deposit record unit tests

* Add gomock to dependecies

* Check if rec is not nil

* Add command to deploy generic handler

* Implement registering generic resource with function sig hashing

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Refactor deposit to accept deposit data instead of targeting only erc20 deposits

* Add generic deposit e2e test

* Move test setup to SetupSuite

* Check stored hash from created hash in generic test

* Generic handler cmd commands (#118)

* Add command to deploy generic handler

* Fix deploy generic handler types

* Implement registering generic resource with function sig hashing

* Implement hash functionality when setting generic resource

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Refactor balance erc20 command

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Add get solidity function tests

* Rename hash-exists command

* Update README

* Fix linter

* Mark cmd flags that previously had default values as required

* Fix deposit command

* Cleanup rebase

* Update abi consts

* Add generic handler unit tests

* Reduce calldata length on generic event handler to include only metadata length

* Add depositer offset to setting generic resource

* Update README

* Replace using topics for deposits with unpacking it from raw data

* Add unpack deposit event log tests

* Replace calldata with data to fix unpack into interface

* Add unpack deposit event unit tests

* Update VoteProposal for new contracts

* Vote on proposal if it is inactive as well

* Fix tests

* Fix vote proposal

* Move test config to struct

* Fix generic handler deploy

* Fix erc20 e2e test RID

* Replace manually creating calldata in test with ConstructErc20DepositData

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>

* Integrate changes from develop

* Update e2e tests

* Refactor e2e env params as struct

* Fix makefile

* Fix lint errors

* Fix centrifuge tests

* Fix linter

* Update Generic ABI

* FIx README centrifuge deploy description

* Fix bug when getHash command doesn't error

* Refactor ResourceID type to be consistently typed

* Fix linter

* Move Centrifuge ABI to separate file

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>

* Local setup CLI command (#139)

* move e2e calls, fix resource ID type, update test

* fix to remove gas price

* fix misspelling

* Rename local deploy functions, move file into local cli directory, modify test

* add zero fee

* wrap domain ID

* refactor

* move alice kp to avoid import cycle conflict

* add local command to CLI root

* add local-setup make instruction

* update readme with local setup section + refactor

* fix readme title

* add local setup script

* fix syntax

* add additional information to local setup step

* Implement admin withdraw cmd + update flag names/descriptions (#164)

* update custom withdraw binding from updated adminWithdraw method

* add missing error return, fix default error return

* add additional processed flag vars

* implement admin withdrawal command

* add dev notes + remove commented code

* remove redundant if block/fix default error return

* refactor withdraw input + transact

* fix lint error

* add missing error return

* make function public for unit testing

* update command documentation

* add unit test

Co-authored-by: Kirill <pisarevkir@gmail.com>

* Add Erc721 support (#186)

* Generic handler implementation (#102)

* Implement generic event handler

* Fix generic message handler type

* Move abi to consts package

* Fix generic handler abi string

* Get deposit record tests (#114)

* Make GetDepositRecord public

* Add fetching deposit record unit tests

* Add gomock to dependecies

* Check if rec is not nil

* Generic handler cmd commands (#118)

* Add command to deploy generic handler

* Fix deploy generic handler types

* Implement registering generic resource with function sig hashing

* Implement hash functionality when setting generic resource

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Refactor balance erc20 command

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Add get solidity function tests

* Rename hash-exists command

* Update README

* Fix linter

* Mark cmd flags that previously had default values as required

* Remove get deposit record logic

* Rename chainID to domainID (#86)

* Rename chainID to domainID

* Fix ChainID usage as related to Ethereum client

* Fix chainID CLI arguments + tests

* Fix flag names + descriptions

* Update ABIs + BINs

* update ABIs + binaries

* replace chainID with domainID + fix comments

* refactor error

* add missing error handling

* remove unnecessary struct field

* Implement generic event handler

* Move abi to consts package

* Fix generic handler abi string

* ERC721 handler implementation (#112)

* Add Erc721 event handler function

* Change return type of message handler

* Remove Proposer usage

* Add mising props to payload

* Listen to events unit tests (#116)

* Add unit tests

* Add listener mocks

* Add blockstore mocks

* Add gomock lib

* Define resource ID type (#117)

* Define type for resource ID

* Use resource ID as type instead of [32]bytes + rename rID to resourceID

* Replace [32]byte with resource id type

* Add the CLI command for base currency transfer (#115)

* add value parameter to the transact function call;

Signed-off-by: tcar <tcar121293@gmail.com>

* add cli command for base currency transfer;

Signed-off-by: tcar <tcar121293@gmail.com>

* add value parameter to the transact function;

Signed-off-by: tcar <tcar121293@gmail.com>

* fix minor issues;

Signed-off-by: tcar <tcar121293@gmail.com>

* handle error;

Signed-off-by: tcar <tcar121293@gmail.com>

* add nil check;

Signed-off-by: tcar <tcar121293@gmail.com>

* add transfer command to the readme document;

Signed-off-by: tcar <tcar121293@gmail.com>

* optimize code;

Signed-off-by: tcar <tcar121293@gmail.com>

* Replace Deposit Record with Event (#90)

* Update contract ABIs + binaries

* Update deposit signature

* Update Erc20EventHandler function signature

* Update deposit event struct fields, add documentation, remove deprecated function, add todo

* Add documentation + refactor

* Add unit test

* Fix deposit signature

* Fix type in signature

* Rename address field for clarity

* Add documentation, update variable names

* refactor, add todo, fix test

* remove recipient address length from payload field

* pull ABI definition from consts, remove todo

* add mock + mock test

* fix resource ID type

* fix resource ID type

* fix test

* EIP1559 fees (#111)

* Migrate CLI documentation from core-example (#91)

* migrate CLI documentation from core-example

* fix syntax

* add celo-evm differences

* fix formatting

* small missing error + add error handling

* Fix CI errors (#109)

* squashed erip1559 old branch

* revisited how gas prcie estimation happen on the london gaspricer
all logic related to gasprice calulations moved to gasprices from client

* make client to be an argument to gaspricers methods

* gas prices calculations or estmation moved from client

* add gaspricer usage to cli:

* fix e2e tests, linters

* Add static gasPricer unit tests
GaPRicer Multiplayer renamed to Factor

* unit tests added for london gasPricer

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>

* Generic integration e2e test (#134)

* Rename chainID to domainID (#86)

* Rename chainID to domainID

* Fix ChainID usage as related to Ethereum client

* Fix chainID CLI arguments + tests

* Fix flag names + descriptions

* Update ABIs + BINs

* update ABIs + binaries

* replace chainID with domainID + fix comments

* refactor error

* add missing error handling

* remove unnecessary struct field

* Get deposit record tests (#114)

* Make GetDepositRecord public

* Add fetching deposit record unit tests

* Add gomock to dependecies

* Check if rec is not nil

* Add command to deploy generic handler

* Implement registering generic resource with function sig hashing

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Refactor deposit to accept deposit data instead of targeting only erc20 deposits

* Add generic deposit e2e test

* Move test setup to SetupSuite

* Check stored hash from created hash in generic test

* Generic handler cmd commands (#118)

* Add command to deploy generic handler

* Fix deploy generic handler types

* Implement registering generic resource with function sig hashing

* Implement hash functionality when setting generic resource

* Implement deploying cent asset

* Move centrifuge related cli commands to separate package

* Refactor balance erc20 command

* Implement checking if centrifuge hash exists

* Add checking if asset hash exists tests

* Revert deploy flag changes

* Add get solidity function tests

* Rename hash-exists command

* Update README

* Fix linter

* Mark cmd flags that previously had default values as required

* Fix deposit command

* Cleanup rebase

* Update abi consts

* Add generic handler unit tests

* Reduce calldata length on generic event handler to include only metadata length

* Add depositer offset to setting generic resource

* Update README

* Replace using topics for deposits with unpacking it from raw data

* Add unpack deposit event log tests

* Replace calldata with data to fix unpack into interface

* Add unpack deposit event unit tests

* Update VoteProposal for new contracts

* Vote on proposal if it is inactive as well

* Fix tests

* Fix vote proposal

* Move test config to struct

* Fix generic handler deploy

* Fix erc20 e2e test RID

* Replace manually creating calldata in test with ConstructErc20DepositData

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>

* Integrate changes from develop

* Update e2e tests

* Refactor e2e env params as struct

* Fix makefile

* Fix lint errors

* Fix centrifuge tests

* ERC721 related cli CMDs (#143)

* fix typo and wrong cmd use; (#138)

* Implement generic event handler

* Move abi to consts package

* ERC721 handler implementation (#112)

* Add Erc721 event handler function

* Change return type of message handler

* Remove Proposer usage

* Add mising props to payload

* Implement deploy flow for ERC721

* Add implementation of all erc721 commands

* Add addminter command

* Refactor mint cmd

* Refactor owner command

* Refactor deposit CLI command

* Refactor approve CLI command

* Refactor add-minter CLI command

* Fix client type

* Fix merge bugs

* Expand README file and code cleanup in CLI commands

* Remove generic handler code

* Revert updates on generic event handler

* Add deploy flags to README and mark all flags as required in deploy command

* Update mod and sum files

* Remove duplicated functions (#130)

* brake import cycle and remove duplicated functions;

Signed-off-by: tcar <tcar121293@gmail.com>

* add test for ToCallArg function;

Signed-off-by: tcar <tcar121293@gmail.com>

* add test case for ToCallArg function;

Signed-off-by: tcar <tcar121293@gmail.com>

* move ChainClient interface to listener;

Signed-off-by: tcar <tcar121293@gmail.com>

* Refactor CLI commands to call new calls

* Refactor deposit function to return hash and error

* Initial test setup

* Write cli I/O output data to file (#119)

* Add func for writing cli i/o data to log file

* Add test for writing cli i/o data to log file

* Refactor cli data writer

* Add test for writing cli i/o data to log file

* Implement cli writer into all commands

* Refactor and rename writer to logger

* Add test for logger

* Move logger to comand PreRun

* Fix lint

* Remove excess func call

* Code cleanup

* Fix cli deploy command flags (#146)

* set some flags to be optional;

Signed-off-by: tcar <tcar121293@gmail.com>

* use value from func param;

Signed-off-by: tcar <tcar121293@gmail.com>

* use fee flag and validate flags

Signed-off-by: tcar <tcar121293@gmail.com>

* update tests;

Signed-off-by: tcar <tcar121293@gmail.com>

* Fix fee type

* Remove old check for empty bridge address from deploy command

* Fix failing tests

* Fix typos

* Fix event-handler and add basic unit test

* Expand unit tests for event-handler

* Merge deposit logs and remove error definitions in deploy cmd

* Fix bind flag commands

Co-authored-by: tcar121293 <tcar121293@gmail.com>
Co-authored-by: Matija Petrunic <matija.petrunic@fer.hr>
Co-authored-by: Nikola Mlinarić <35880252+nmlinaric@users.noreply.github.com>

* Fix linter

* Fix merge bugs

* Add e2e setup command in Makefile

* Add logging to erc721 CLI commands

* ERC721 e2e tests (#185)

* Update abis

* WIP adding e2e tests

* Fix tests and add event hendler tests

* Fix linter error

* Fix handling erc721 metadata and expand event handler testst

* Fix missing comment

* Add missing comment

* Fix missing props in e2e config

* Fix duplicate function in deploy

* Change minimal calldata length for erc721 handler

* Fix failin unit test

* Fix failing logger tests

* Change assertion in logger test

Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>
Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Nikola Mlinarić <35880252+nmlinaric@users.noreply.github.com>
Co-authored-by: tcar121293 <tcar121293@gmail.com>
Co-authored-by: Kirill <pisarevkir@gmail.com>

* Opentelemetry integration (#158)

* Implement OpenTelementry tracer and metrics

* Move message processors tests

* Remove extra test file

* Configure OpenTelemetry from relayer config

* Move message definition to separate package to prevent import cycle

* Fix message imports

* Fix import

* Make opentelemetyr conform to tracing interface

* Fix imports

* Implement TraceDepositEvent

* Add TraceDepositEvent tests

* Write relayer tests

* Initialize Prometheus by default if OpenTelemetry does not exist

* Fix lint

* Name tracer and meter

* Add godoc to opentelemetry package

* Remove prometheus implementation

* Remove tracer implementation

* Pass in metrics implementation into relayer

* Remove extra mocks

* Remove extra mocks

* Update relayer tests

* Add ConsoleTelemetry to turn off OpenTelemetry in tests

* Remove Prometheus related flags

* Add Metrics README

* Add link to OpenTelemetry integration in README

* Fix merge error

* Fix tests

Co-authored-by: Kirill <pisarevkir@gmail.com>

* Prevent excess votes (#184)

* Remove subkey from evm-evm e2e tests Dockerfile

* Fix typo

* Fix evm-evm test name

* Switch e2e tests to run with ws

* Bump go-ethereum

* Refactor proposal status to include yes votes count

* Implement voter pending proposal tracking to prevent extra votes

* Fix proposal status fetching

* Remove annoying log

* Increase pending proposal votes by proposal ID

* Rebuild mocks

* Add voter tests

* Update godocs

* Fix typo

* Lint

* Add godocs, remove channel from shouldVoteForProposal and add fallback constructor when subscription is not supported

* Remove extra argument

* Fix linter

* Fix tests

* Improve voter pending tx subscription godocs

Co-authored-by: Kirill <pisarevkir@gmail.com>

* fix unit tests wrong mock expectation

Co-authored-by: Jon Roethke <waymobetta@users.noreply.github.com>
Co-authored-by: Matija Petrunić <matija.petrunic@fer.hr>
Co-authored-by: Nikola Mlinarić <35880252+nmlinaric@users.noreply.github.com>
Co-authored-by: tcar121293 <tcar121293@gmail.com>
Co-authored-by: Mak Muftic <mak@chainsafe.io>
Co-authored-by: mace <mak@nodefactory.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace deposit record fetch with event
3 participants