-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:metaplex-foundation/shank
- Loading branch information
Showing
8 changed files
with
549 additions
and
33 deletions.
There are no files selected for viewing
165 changes: 165 additions & 0 deletions
165
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,165 @@ | ||
{ | ||
"version": "", | ||
"name": "", | ||
"instructions": [ | ||
{ | ||
"name": "Create", | ||
"accounts": [ | ||
{ | ||
"name": "from", | ||
"isMut": true, | ||
"isSigner": true, | ||
"docs": [ | ||
"Payer of the transaction" | ||
] | ||
}, | ||
{ | ||
"name": "to", | ||
"isMut": true, | ||
"isSigner": false, | ||
"docs": [ | ||
"The deterministically defined 'state' account being created via `create_account_with_seed`" | ||
] | ||
}, | ||
{ | ||
"name": "base", | ||
"isMut": false, | ||
"isSigner": false, | ||
"docs": [ | ||
"The program-derived-address signing off on the account creation. Seeds = &[] + bump seed." | ||
] | ||
}, | ||
{ | ||
"name": "systemProgram", | ||
"isMut": false, | ||
"isSigner": false, | ||
"docs": [ | ||
"The system program" | ||
] | ||
}, | ||
{ | ||
"name": "program", | ||
"isMut": false, | ||
"isSigner": false, | ||
"docs": [ | ||
"The program whose state is being constructed" | ||
] | ||
} | ||
], | ||
"args": [ | ||
{ | ||
"name": "dataLen", | ||
"type": "u64" | ||
} | ||
], | ||
"discriminant": { | ||
"type": "u8", | ||
"value": 0 | ||
} | ||
}, | ||
{ | ||
"name": "CreateBuffer", | ||
"accounts": [ | ||
{ | ||
"name": "buffer", | ||
"isMut": true, | ||
"isSigner": false | ||
}, | ||
{ | ||
"name": "authority", | ||
"isMut": false, | ||
"isSigner": true | ||
} | ||
], | ||
"args": [], | ||
"discriminant": { | ||
"type": "u8", | ||
"value": 1 | ||
} | ||
}, | ||
{ | ||
"name": "SetBuffer", | ||
"accounts": [ | ||
{ | ||
"name": "buffer", | ||
"isMut": true, | ||
"isSigner": false, | ||
"docs": [ | ||
"The buffer with the new idl data." | ||
] | ||
}, | ||
{ | ||
"name": "idl", | ||
"isMut": true, | ||
"isSigner": false, | ||
"docs": [ | ||
"The idl account to be updated with the buffer's data." | ||
] | ||
}, | ||
{ | ||
"name": "authority", | ||
"isMut": false, | ||
"isSigner": true | ||
} | ||
], | ||
"args": [], | ||
"discriminant": { | ||
"type": "u8", | ||
"value": 2 | ||
} | ||
}, | ||
{ | ||
"name": "SetAuthority", | ||
"accounts": [ | ||
{ | ||
"name": "idl", | ||
"isMut": true, | ||
"isSigner": false | ||
}, | ||
{ | ||
"name": "authority", | ||
"isMut": false, | ||
"isSigner": true | ||
} | ||
], | ||
"args": [ | ||
{ | ||
"name": "newAuthority", | ||
"type": "publicKey" | ||
} | ||
], | ||
"discriminant": { | ||
"type": "u8", | ||
"value": 3 | ||
} | ||
}, | ||
{ | ||
"name": "Write", | ||
"accounts": [ | ||
{ | ||
"name": "idl", | ||
"isMut": true, | ||
"isSigner": false | ||
}, | ||
{ | ||
"name": "authority", | ||
"isMut": false, | ||
"isSigner": true | ||
} | ||
], | ||
"args": [ | ||
{ | ||
"name": "idlData", | ||
"type": "bytes" | ||
} | ||
], | ||
"discriminant": { | ||
"type": "u8", | ||
"value": 4 | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"origin": "shank" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
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,13 @@ | ||
#[derive(ShankInstruction)] | ||
pub enum Instruction { | ||
#[idl_instruction(Create)] | ||
Create, | ||
#[idl_instruction(CreateBuffer)] | ||
CreateBuffer, | ||
#[idl_instruction(SetBuffer)] | ||
SetBuffer, | ||
#[idl_instruction(SetAuthority)] | ||
SetAuthority, | ||
#[idl_instruction(Write)] | ||
Write, | ||
} |
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.