-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
lang: allow token::...
and mint::...
to be used as checks without init
#1505
lang: allow token::...
and mint::...
to be used as checks without init
#1505
Conversation
token::..
and mint::...
to be used as checks without init
token::..
and mint::...
to be used as checks without inittoken::..
and mint::...
to be used as checks without init
token::..
and mint::...
to be used as checks without inittoken::..
and mint::... to be used as checks without init
token::..
and mint::... to be used as checks without inittoken::..
and mint::...
to be used as checks without init
token::..
and mint::...
to be used as checks without inittoken::...
and mint::...
to be used as checks without init
Hi, @paul-schaaf, Can you review this PR? |
Hi, @fanatid, Can you review my PR? |
the review dismissal was a missclick. pls do have a look at my comments :) |
@blockchainlover2019 do you have time to finish this or do you want me to take over? |
Sorry, @paul-schaaf , I have been very busy for MVP launch. |
@paul-schaaf, I've finished modifying codes. I want to know your opinions. Please don't hesitate to tell me about the modification and other improvements. I feel good at working with you |
signers: [token], | ||
}); | ||
try { | ||
await program.rpc.testTokenConstraint({ |
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.
we should stop using this api with new 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.
though for now let's not worry about it and just get this in
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.
Yeah, got it.
I think there should be a unit test framework to manage tests on Anchor framework.
misc.ts
is so long in its codes.
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.
yea we have issues to split up the misc tests and generally rework the testing for anchor itself
hey @blockchainlover2019 we want to release today and would like to include this PR so Im going to finish it now |
Okay! |
freeze_authority: mint_freeze_authority | ||
.as_ref() | ||
.map(|a| a.clone().into_inner().mint_freeze_auth), |
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.
freeze_authority: mint_freeze_authority | |
.as_ref() | |
.map(|a| a.clone().into_inner().mint_freeze_auth), | |
freeze_authority: mint_freeze_authority.cloned().map(|a| a.into_inner().mint_freeze_auth), |
Can be simpler 🙂
But current also looks good!
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.
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.
that doesnt actually work because cloned
only exists on Option<&T>
(and Option<&mut T>
) but mint_freeze_authority
is an Option<T>
. could do clone().map()
but I like my solution more than that
thanks for the contribution @blockchainlover2019 ! |
I feel happy to contribute, and in the opposite, I feel bad about not finishing work quickly and wonderfully. |
token_account
andmint
in ConstraintGroup.misc
i.e. for
mint::decimals
andmint::freeze_authority
test