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

Add more complex namespaced contracts & test cases for them #4472

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

VargSupercolony
Copy link
Contributor

This PR adds complex contracts with namespaced methods (contained either within #[ink::trait_definiton] or #[ink(namespace)].

const latest = v1ToLatest(registry, contract.asV1);
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['PSP22Metadata,token_name', 'PSP22Metadata,token_symbol', 'PSP22Metadata,token_decimals', 'PSP22Mintable,mint',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
).toEqual(['PSP22Metadata,token_name', 'PSP22Metadata,token_symbol', 'PSP22Metadata,token_decimals', 'PSP22Mintable,mint',
).toEqual(['PSP22Metadata::token_name', 'PSP22Metadata::token_symbol', 'PSP22Metadata::token_decimals', 'PSP22Mintable::mint',

I believe the above is how it is now in master, let's see what the CI tests throw out.

expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['PSP22Metadata,token_name', 'PSP22Metadata,token_symbol', 'PSP22Metadata,token_decimals', 'PSP22Mintable,mint',
'PSP22,decrease_allowance', 'PSP22,transfer', 'PSP22,approve', 'PSP22,allowance', 'PSP22,transfer_from', 'PSP22,balance_of', 'PSP22,increase_allowance',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'PSP22,decrease_allowance', 'PSP22,transfer', 'PSP22,approve', 'PSP22,allowance', 'PSP22,transfer_from', 'PSP22,balance_of', 'PSP22,increase_allowance',
'PSP22::decrease_allowance', 'PSP22::transfer', 'PSP22::approve', 'PSP22::allowance', 'PSP22::transfer_from', 'PSP22::balance_of', 'PSP22::increase_allowance',

latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['PSP22Metadata,token_name', 'PSP22Metadata,token_symbol', 'PSP22Metadata,token_decimals', 'PSP22Mintable,mint',
'PSP22,decrease_allowance', 'PSP22,transfer', 'PSP22,approve', 'PSP22,allowance', 'PSP22,transfer_from', 'PSP22,balance_of', 'PSP22,increase_allowance',
'PSP22,total_supply', 'pause', 'unpause']);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'PSP22,total_supply', 'pause', 'unpause']);
'PSP22::total_supply', 'pause', 'unpause']);

Copy link
Member

@jacogr jacogr left a comment

Choose a reason for hiding this comment

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

Thank you.

Going to merge as-is and look at the tests locally - it should be as per the changes made here, although it is not quite...

@jacogr jacogr merged commit 97797d6 into polkadot-js:master Jan 20, 2022
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jan 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants