-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
idl instruction: add create account macro attr
- Loading branch information
Showing
16 changed files
with
437 additions
and
78 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
shank-idl/tests/fixtures/instructions/single_file/create_idl_instructions.json
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,54 @@ | ||
{ | ||
"version": "", | ||
"name": "", | ||
"instructions": [ | ||
{ | ||
"name": "Create", | ||
"accounts": [ | ||
{ | ||
"name": "from", | ||
"isMut": true, | ||
"isSigner": true, | ||
"desc": "Payer of the transaction" | ||
}, | ||
{ | ||
"name": "to", | ||
"isMut": true, | ||
"isSigner": false, | ||
"desc": "The deterministically defined 'state' account being created via `create_account_with_seed`" | ||
}, | ||
{ | ||
"name": "base", | ||
"isMut": false, | ||
"isSigner": false, | ||
"desc": "The program-derived-address signing off on the account creation. Seeds = &[] + bump seed." | ||
}, | ||
{ | ||
"name": "systemProgram", | ||
"isMut": false, | ||
"isSigner": false, | ||
"desc": "The system program" | ||
}, | ||
{ | ||
"name": "program", | ||
"isMut": false, | ||
"isSigner": false, | ||
"desc": "The program whose state is being constructed" | ||
} | ||
], | ||
"args": [ | ||
{ | ||
"name": "dataLen", | ||
"type": "u64" | ||
} | ||
], | ||
"discriminant": { | ||
"type": "u8", | ||
"value": 0 | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"origin": "shank" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
shank-idl/tests/fixtures/instructions/single_file/create_idl_instructions.rs
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,5 @@ | ||
#[derive(ShankInstruction)] | ||
pub enum Instruction { | ||
#[idl_instruction(Create)] | ||
Create, | ||
} |
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
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
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
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.