-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add handling for custom serialization, like spl-token
- Loading branch information
Tyera Eulberg
committed
Jun 27, 2020
1 parent
f8e5062
commit e104a09
Showing
6 changed files
with
302 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use solana_sdk_program_macros::instructions; | ||
|
||
mod test_program; | ||
|
||
#[instructions(test_program::id())] | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum TestInstruction { | ||
#[accounts( | ||
from_account(SIGNER, WRITABLE, desc = "Funding account") | ||
)] | ||
Transfer { lamports: u64 }, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0599]: no method named `serialize` found for enum `TestInstruction` in the current scope | ||
--> $DIR/custom_serde.rs:5:1 | ||
| | ||
5 | #[instructions(test_program::id())] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `TestInstruction` | ||
6 | #[derive(Clone, Debug, PartialEq)] | ||
7 | pub enum TestInstruction { | ||
| ------------------------ method `serialize` not found for this | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following traits define an item `serialize`, perhaps you need to implement one of them: | ||
candidate #1: `serde::ser::Serialize` | ||
candidate #2: `serde_bytes::ser::Serialize` | ||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.