-
Notifications
You must be signed in to change notification settings - Fork 183
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 api search contract metadata #163
Nft api search contract metadata #163
Conversation
…t api endpoint params
…updated getNftContractMetadata tests
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.
thanks for submitting this! just a small change and we should be good to go!
export function verifyNftContractMetadata( | ||
actualNftContract: NftContract, | ||
expectedNftContract: NftContract, | ||
address: string, |
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 do we need all the additional variables in the params here?
i'm thinking that we would just do
expect(actualNftContract.address).toEqual(expectedNftContract.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.
Playing with the API I saw that every element in the searchContractMetadata
endpoint response has the same structure as the response from the getNftContractMetadata
endpoint which was unit tested using the following function
So to keep the testing method consistent I decided to reuse the verifyNftContractMetadata
function for the searchContractMetadata
tests too. I can change it to test only the contract address if you want.
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.
ah I see what you mean, thanks for clarifying!
please leave this as is, i'll refactor this later!
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.
Ok, nice! Thank you!
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.
thanks again!
Changelog
searchContractMetadata
method in thenft
namespace.getNftContractMetadata
method.verifyNftContractMetadata
util function to thetest/test-util.ts
file to reuse it for thesearchContractMetadata
unit tests.searchContractMetadata
method.