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

Make pub cid count public #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions evm/basin_storage/src/BasinStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract BasinStorage is AccessControl {
mapping(address => string[]) private _ownerPubs;

// CID count by pub
mapping(string => uint256) private _pubCIDCount;
mapping(string => uint256) public pubCIDCount;

// CID storage indexes by pub, indexed by epoch.
mapping(string pub => mapping(uint256 epoch => string[])) private _cids;
Expand Down Expand Up @@ -80,7 +80,7 @@ contract BasinStorage is AccessControl {
revert PubDoesNotExist(pub);
}
_cids[pub][timestamp].push(cid);
_pubCIDCount[pub]++;
pubCIDCount[pub]++;
emit CIDAdded(cid, pub, owner);
}

Expand All @@ -103,7 +103,7 @@ contract BasinStorage is AccessControl {
if (aftr >= before) {
revert IncorrectRange(aftr, before);
}
string[] memory cids = new string[](_pubCIDCount[pub]);
string[] memory cids = new string[](pubCIDCount[pub]);
uint256 lastCIDFetchedIdx = 0;

uint256 epoch = aftr + 1;
Expand Down
Loading