trustlines-protocol / merkle-drop

MIT License
12 stars 1 forks source link

Feature/cli status #52

Closed saschagoebel closed 5 years ago

saschagoebel commented 5 years ago

Implementation of #47

Example output:

Token Address:             0xb9171585ca462C680a6bb0561A96b4808679AdF4
Token Name:                Trustlines Network Token (TLN)
Token Balance:             215.13923688271606

Merkle Drop Address:       0xa28940Ae7AC5FA5D4437C5d982c2172c61769a00
Merkle Root:               c81b9a6a08a3a57ed1d60d6c232a622528dc8dc0573bf5d3200fc0d3428a35dc

Initial Balance:           241.0
Remaining Value:           221.0
Spent tokens:              25.860763117283952
Decayed Remaining Value:   214.8920613425926

Decay Start Time:          2019-07-29T00:00:00+00:00 (1 day ago)
Decay Duration in Seconds: 5184000 (2 months)
Decay End Time:            2019-09-27T00:00:00+00:00 (in 2 months)
Remaining Time in Seconds: 5040726 (2 months)
ghost commented 5 years ago

It fails because the deploy_contract fixture used to deploy the merkle_drop_contract deploys to a different chain then what you get with --jsonrpc test.

https://github.com/trustlines-protocol/contract-deploy-tools/blob/master/deploy_tools/cli.py#L26-L30

https://github.com/trustlines-protocol/contract-deploy-tools/blob/master/deploy_tools/cli.py#L367-L372

The way to solve this would be to not use the merkle_drop_contract fixture and use a merkle drop contract that you deployed with the cli tools to the --jsonrpc test chain

saschagoebel commented 5 years ago

Ahhh! I remember some talk about this some time ago. Thanks!

codecov-io commented 5 years ago

Codecov Report

Merging #52 into master will increase coverage by 3.1%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #52     +/-   ##
=========================================
+ Coverage    73.3%   76.41%   +3.1%     
=========================================
  Files           6        7      +1     
  Lines         266      301     +35     
=========================================
+ Hits          195      230     +35     
  Misses         71       71
Impacted Files Coverage Δ
merkle_drop/cli.py 95.14% <100%> (+1.72%) :arrow_up:
merkle_drop/status.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 07f444f...f3467da. Read the comment docs.

saschagoebel commented 5 years ago

I didn't come up with an additional check that makes sense right now, but the remaining value check is right here: https://github.com/trustlines-protocol/merkle-drop/pull/52/files#diff-d616077eae5c677134893708f5530692R232 - It's just not in the example though :-o

berndbohmeier commented 5 years ago

Woops, then my bad, did not see that.