Dapp-a-day 20: Multiarray Reporter

in #ethereum8 years ago (edited)


You are probabbly familliar with dapples //@log feature which can be used to log strings or variables out during a dapple test --report execution. But did you know that you can also generate beautiful reports using //@doc?

In todays dapp-a-day we will explore the reporter and also answer the question "If you decrese the size of a nested array, will the nested arrays be deleted or just the pointer like it is done with mappings?", lets see by looking at our nicely generated report. (which was generated with dapple test --report)

multiarray length: 0
multiarray.length++;
multiarray length: 1
multiarray[0] length: 0
multiarray[0].length++;
multiarray[0].length++;
multiarray[0][0]: 0
multiarray[0][0] = 1;
multiarray[0][1] = 1;
multiarray[0] length: 2
multiarray[0][0]: 1
multiarray[0][1]: 1
multiarray.length--;
multiarray[0] length: 0
multiarray.length++;
multiarray[0] length: 0
multiarray[0].length++;
multiarray[0].length++;
multiarray[0][0]: 0
multiarray[0][1]: 0

the first 10 number of the fibonacci sequence

0x1

0x2

0x3

0x5

0x8

0xd

0x15

0x22

0x37

0x59

github/nexusdev/multiarray-reporter

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 70884.24
ETH 3570.27
USDT 1.00
SBD 4.76