-
Notifications
You must be signed in to change notification settings - Fork 895
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
Support pinning of solana tokens #16963
Conversation
52e3eaa
to
4aa17f0
Compare
absl::optional<std::string> service, | ||
mojom::BlockchainTokenPtr token, |
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 &
for service and token
FetchMetadata(*url, | ||
base::BindOnce(&NftMetadataFetcher::CompleteGetSolTokenMetadata, | ||
weak_ptr_factory_.GetWeakPtr(), url.value(), | ||
std::move(callback))); |
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.
Both either *url
or url.value()
to be consistent
@@ -31,7 +31,8 @@ const char kErrorMessage[] = "error_message"; | |||
const char kAssetUrlListKey[] = "cids"; | |||
|
|||
namespace { | |||
|
|||
// Solana NFTs doesn't have token_id |
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: don't
mojom::BlockchainTokenPtr token, | ||
const std::string& token_url, | ||
const std::string& result, | ||
AddPinCallback callback) { | ||
GURL token_gurl = GURL(token_url); | ||
if (!token_gurl.SchemeIs(ipfs::kIPFSScheme)) { |
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.
Should we also fail here if whole url is not valid?
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.
There is only one check for url to have ipfs scheme, not sure if it is enough.
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.
LGTM with some minor comments
a34fbf0
to
662cc44
Compare
Resolves brave/brave-browser#28000
Solana doesn't have token_id so we use * as token_id in the GetTokenPrefPath to construct token preference path.
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:
Test pinning SOL token pinning. Ex: https://magiceden.io/item-details/7tSu4udrnQXbs92ocYboCCHMxpmq1ufDyxzGMmzY62UL