• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gnosis / solidity-data-structures / 10
100%

Build:
DEFAULT BRANCH: master
Ran 03 Sep 2019 12:14PM UTC
Jobs 1
Files 2
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
10

push

travis-ci

web-flow
[IterableAppendOnlySet] add size function (#2)

We need to know the size of the set when trying to convert it into a list (e.g. to pass it to the caller of our smart contract), since memory arrays need to have a known size (variable sized arrays only work in storage).

This PR adds a view function for the size, which doesn't require any additional cost on insertion. We could alternatively store the size on the data but this would cost an sstore and every addition. Since this method is designed to be called in view functions only, we don't care about potentially running the for loop twice (once to get the count and then again to get the elements)


### Test Plan

Unit tests

12 of 12 branches covered (100.0%)

Branch coverage included in aggregate %.

26 of 26 relevant lines covered (100.0%)

7.65 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10.1 03 Sep 2019 12:14PM UTC 0
100.0
Travis Job 10.1
Source Files on build 10
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Travis Build #10
  • c726d3a5 on github
  • Prev Build on master (#3)
  • Next Build on master (#15)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc