-
Notifications
You must be signed in to change notification settings - Fork 53
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
Adds total supply view and updates cadence tests #139
Conversation
@sisyphusSmiling @satyamakgec I'm having some issues with the JS test setup in this PR when I run the tests and when CI runs. Can one of you take a look? Thank you! |
cc: @jribbink @franklywatson could use some js-friendly eyes Not sure why the js tests are failing here. I'm getting some odd behavior -
I was able to get
This is after updating to latest stable npm release from |
@sisyphusSmiling and @satyamakgec I removed the JS tests and added some cadence tests for the switchboard, which was the only extra thing that wasn't already handled by the Go/Cadence tests, so this is ready for another review |
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. Glad to see we're getting more Cadence tests in the mix!
.borrow<&{MetadataViews.Resolver}>() | ||
?? panic("Could not borrow a reference to the vault resolver") | ||
|
||
let ftSupply = vaultRef.resolveView(Type<FungibleTokenMetadataViews.TotalSupply>())! |
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.
np: Maybe not in scope for this PR, but we could generalize this script if ExampleToken
implemented ViewResolver
. I think we should encourage NFT & FT contracts to implement that interface anyway.
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 would ExampleToken
need to implement ViewResolver
to make this generalizable? Isn't it already generalizable if you just provide the path as an argument instead of hardcoding? Agreed about making it implement ViewResolver
though.
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, totally true. Could just add public path. I've just come across a couple of instances with HC scripts/txns where ViewResolver
would make things easier, so I've been more inclined to spot opportunities to encourage the pattern. You're right though, either one works
Description
For contributor use:
master
branchFiles changed
in the Github PR explorer