SIGBlockchain / project_aurum

SIG Blockchain blockchain project in Go
https://acm.cs.uic.edu/sigblockchain
MIT License
7 stars 1 forks source link

AAA Test: GetJSONBlockByHeight #374

Closed bashbashbash closed 4 years ago

bashbashbash commented 4 years ago

Package context: internal/handlers Branch: getjsonblockbyheight

Please create a AAA test in the above package using the listed branch. Using the height, you will leverage a query to the metadata table and extract the block at the given height, returned as a JSON-block.

Be sure to test for:

Useful links AAA Testing Blocks Endpoint listening

Vineet77 commented 4 years ago

Unit test added

Vineet77 commented 4 years ago

@bashbashbash Can you look at htis

bashbashbash commented 4 years ago

Looks like metatable.db and blockchain.dat are not removed in the test. Also can you clarify line 433 comment (just that it's testing for invalid height)

kastolars commented 4 years ago

This would be a great opportunity for mocking

bashbashbash commented 4 years ago

Agreed - since this is part of squirtle sprint that is due today, perhaps we should complete it and then set up another issue to improve the test with mocking

bashbashbash commented 4 years ago

Looks good