-
Notifications
You must be signed in to change notification settings - Fork 2k
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
example: Provide ProgramTest example with spl-token CPI #829
Comments
|
I definitely think this example should invoke SPL Token. The first thing people familiar with ERC-20 ask seems to be, "so how do I customize the SPL Token implementation for my application". To which we reply, "please don't, there's a better way". I conveniently wrote this example earlier today, mvines/solana-bpf-program-template#3, that perhaps can be recycled in whole or part for this issue |
@mvines What was the intent of writing that example in its own repo and not as an example under SPL? |
Nope. Just wanted to park it somewhere for now, and seemed easiest to add it under my account for now. |
Cool, I'll add it to the examples |
@jackcmay my bad, I put this in late yesterday and hadn't read through all of the examples you've already provided. the |
@joncinque the global allocator conflict should go away now that SPL is on v1.4.8. I remove the extra checks in this PR: #852 |
Program developers will want to write end-to-end tests using other programs, which is not totally possible with unit tests.
solana-program-test
is extremely useful, so we should have a small example of how to use it. A few things to consider:processor
function (e.g. spl_token)Also, there's an error that I ran into while doing this:
error: the
#[global_allocator]in solana_measure conflicts with global allocator in: spl_stake_pool
so an extra comment or an FAQ point about that error and how to resolve it would be useful as well, e.g. adding
#![cfg(all(target_arch = "bpf", not(feature = "no-entrypoint")))]
in entrypoint.rs to avoid definingglobal_allocator
twice.tag @jackcmay
The text was updated successfully, but these errors were encountered: