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

List addresses that have ever made deposits #1140

Merged
merged 3 commits into from
Jul 26, 2019

Conversation

pirapira
Copy link
Contributor

When I was integrating raiden-contrtacts 0.26.0 with the Raiden client, I realized that there must be a way for the client to look up all registered services in ServiceRegistry contract. This PR provides a poor man's solution to this problem, namely, a list of all addresses that have ever made a deposit. The client can then query about any address in the list.

This closes #1139.

@pirapira pirapira requested a review from karlb July 25, 2019 16:14
@codecov
Copy link

codecov bot commented Jul 25, 2019

Codecov Report

Merging #1140 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1140   +/-   ##
=======================================
  Coverage   81.18%   81.18%           
=======================================
  Files          21       21           
  Lines        1446     1446           
  Branches      188      188           
=======================================
  Hits         1174     1174           
  Misses        230      230           
  Partials       42       42

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 ddccf5e...d92cdf0. Read the comment docs.

raiden_contracts/data/source/services/ServiceRegistry.sol Outdated Show resolved Hide resolved
require(now < service_valid_till[msg.sender], "registration expired");
require(bytes(new_url).length != 0, "new url is empty string");
urls[msg.sender] = new_url;
return true;
}

/// A getter function for seeing the length of ever_made_deposits array.
function ever_made_deposits_len() public view returns (uint256 _len) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really weird that solidity does not provide this for public arrays itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. It's weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a list of addresses that have ever made a deposit in ServiceRegistry
2 participants