-
Notifications
You must be signed in to change notification settings - Fork 84
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
Minor fixes for upcoming v1.0.4-beta release #1827
Conversation
Can we fix the moralis tests in this PR? @laruh |
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.
The changes looks good, but I would like to see the moralis tests fixed as well before shipping this.
cc @laruh
mm2src/coins/nft.rs
Outdated
@@ -103,7 +103,7 @@ pub async fn get_nft_metadata(_ctx: MmArc, req: NftMetadataReq) -> MmResult<Nft, | |||
let token_address = &req.token_address; | |||
let token_id = &req.token_id; | |||
let uri = format!( | |||
"{req_url}{MORALIS_API_ENDPOINT}nft/{token_address}/{token_id}?chain={chain_str}&{FORMAT_DECIMAL_MORALIS}" | |||
"{req_url}{MORALIS_API_ENDPOINT}nft/{token_address:#02x}/{token_id}?chain={chain_str}&{FORMAT_DECIMAL_MORALIS}" |
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.
not a blocker: Since req_url
is a Url
type, we can use join
method instead of building string here.
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.
Done
Thanks for the fixes. rpcs work well. native test_moralis_nft_transfer_history test #[test]
fn test_moralis_nft_transfer_history() {
let response = block_on(send_request_to_uri(NFT_HISTORY_URL_TEST)).unwrap();
let mut transfer_list = response["result"].as_array().unwrap().clone();
assert_eq!(4, transfer_list.len());
let last_tx = transfer_list.remove(0);
let transfer_wrapper: NftTransferHistoryWrapper = serde_json::from_str(&last_tx.to_string()).unwrap();
assert_eq!(TEST_WALLET_ADDR_EVM, transfer_wrapper.from_address);
} next wasm target wasm test_moralis_nft_transfer_history #[wasm_bindgen_test]
async fn test_moralis_nft_transfer_history() {
let response = send_request_to_uri(NFT_HISTORY_URL_TEST).await.unwrap();
let mut transfer_list = response["result"].as_array().unwrap().clone();
assert_eq!(4, transfer_list.len());
let last_tx = transfer_list.remove(0);
let transfer_wrapper: NftTransferHistoryWrapper = serde_json::from_str(&last_tx.to_string()).unwrap();
assert_eq!(TEST_WALLET_ADDR_EVM, transfer_wrapper.from_address);
} |
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! 🔥
Fixes #1804 (review), #1804 (review)