-
Notifications
You must be signed in to change notification settings - Fork 868
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
NFT pinning optimisation #17742
NFT pinning optimisation #17742
Conversation
ea7d520
to
04f3b75
Compare
bool PinData::operator==(const PinData& d) { | ||
return this->cid == d.cid && this->pinning_mode == d.pinning_mode; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need non-const version?
} | ||
|
||
absl::optional<std::vector<ipfs::PinData>> | ||
IpfsLocalPinService::ExtractMergedPinData(std::vector<std::string> ipfs_urls) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const &
return absl::nullopt; | ||
} | ||
for (const auto& item : pins_data_for_url.value()) { | ||
if (std::find(result.begin(), result.end(), item) == result.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base::Contains
builder += part; | ||
result.push_back(PinData{builder, PinningMode::DIRECT}); | ||
} | ||
result[result.size() - 1].pinning_mode = PinningMode::RECURSIVE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: result.back()
/build android |
Verification passed on
17742.mp4 |
Uplift of #17742 (squashed) to beta
Resolves brave/brave-browser#29230
Before: ipfs://bafy/1/1.png is given and ipfs://bafy is pinned recursively.
After: bafy and bafy/1 pinned non-recursively and bafy/1/1.png pinned recursively.
Resolves
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
http://127.0.0.1:45001/api/v0/pin/ls?arg=%2Fipfs%2F%2F