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

fix pda error #103

Merged
merged 1 commit into from
Dec 24, 2024
Merged

fix pda error #103

merged 1 commit into from
Dec 24, 2024

Conversation

chen4903
Copy link
Contributor

fix this error

mismatched types
expected enum `std::result::Result<(), _>`
   found enum `std::result::Result<Return<u64>, _>`rustc[Click for full compiler diagnostic](rust-analyzer-diagnostics-view:/diagnostic%20message%20[0]?0#file:///Users/levi/code/web3/solana/puppet/programs/puppet-master/src/lib.rs)
lib.rs(12, 76): expected `std::result::Result<(), anchor_lang::error::Error>` because of return type

Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

It looks like we give 2 examples of puppet::set_data:

pub fn set_data(ctx: Context<SetData>, data: u64) -> Result<()> {

pub fn set_data(ctx: Context<SetData>, data: u64) -> Result<u64> {

Therefore, it certainly makes sense for the code to work both ways here. Thank you!

@acheroncrypto acheroncrypto merged commit ee712ea into coral-xyz:master Dec 24, 2024
@chen4903 chen4903 deleted the fix-pda branch December 25, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants