Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test for ethereum/block in cmd/indexer #487

Open
10 tasks
robdefeo opened this issue Jan 2, 2020 · 2 comments
Open
10 tasks

Unit test for ethereum/block in cmd/indexer #487

robdefeo opened this issue Jan 2, 2020 · 2 comments
Labels

Comments

@robdefeo
Copy link
Member

robdefeo commented Jan 2, 2020

Is your feature request related to a problem? Please describe.

cmd/indexer has a processor for Ethereum blocks, it does not have unit test against ethereum blocks.

Describe the solution you'd like

To create core.Block structs in go-ethereum the rlp.Decode method can be used to decode a raw hex string, this though is difficult to read compared to a json doc. Suggested approach is

  • create cmd/indexer/internal/ethereum/testdata/[TestName] folder to store json docs for this case
  • create separate file for each test case named the same as the test case name.
  • For each test case load the file
  • Encode the file to bytes with rlp.EncodeToBytes()
  • Decode the returned bytes to Block with rlp.DecodeBytes()
  • Use object for test

Create test expected ethereum transactions cases:

  • No transactions
  • mixed non Mailchain & non Mailchain transactions
  • Failed transaction
  • other relevant cases
@robdefeo robdefeo added enhancement New feature or request cmd/indexer tests labels Jan 2, 2020
@robdefeo
Copy link
Member Author

ref #512

@stale
Copy link

stale bot commented Jun 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Mailchain team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please reply in order to keep the issue open. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant