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

Minor fixes for upcoming v1.0.4-beta release #1827

Merged
merged 12 commits into from May 17, 2023
Merged

Conversation

shamardy
Copy link
Collaborator

@shamardy shamardy mentioned this pull request May 16, 2023
@shamardy shamardy changed the title Minor fixes for upcoming v1.0.4 release Minor fixes for upcoming v1.0.4-beta release May 16, 2023
@onur-ozkan
Copy link
Member

Can we fix the moralis tests in this PR? @laruh

onur-ozkan
onur-ozkan previously approved these changes May 16, 2023
Copy link
Member

@onur-ozkan onur-ozkan left a 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

@@ -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}"
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@laruh
Copy link
Member

laruh commented May 17, 2023

Thanks for the fixes. rpcs work well.
As for native tests, could you please add semicolon here.

native test_moralis_nft_transfer_history test
please rewrite it as

#[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
semicolon here.

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);
    }

Copy link
Member

@laruh laruh left a comment

Choose a reason for hiding this comment

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

LGTM! 🔥

@shamardy shamardy merged commit 0660e75 into dev May 17, 2023
27 of 29 checks passed
@shamardy shamardy deleted the v1.0.4-beta-release-patch branch May 17, 2023 16:49
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.

None yet

3 participants