-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Feature: CPI Events API #2438
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
Merged
Merged
Feature: CPI Events API #2438
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
1b9ff06
add permissionless event cpi api
ngundotra eed5e6f
add cpi event test
ngundotra 6c9fced
move __emit_cpi_invoke to __private in lib.rs
ngundotra e1d234c
export emit_cpi and _emit_cpi_data in prelude
ngundotra f5c5ab9
remove empty file
ngundotra bca57d6
rewrite emit_cpi as a proc_macro
ngundotra ffd6fb1
remove unused code
ngundotra aadba4e
inline _emit_cpi_invoke to proc_macro declaration
ngundotra bbd869b
address acheron feedback
ngundotra 7bc2c25
optimize emit macro to reduce cloning
ngundotra 3d04a71
explicitly only parse two args
ngundotra 014256f
update events package.json
ngundotra 76ee7be
add event instruction error code to anchor
ngundotra f4c225c
add event authority
ngundotra 25bc040
require event authority PDA to sign
ngundotra 4786e85
turn on seeds to hide eventAuthority
ngundotra b072f59
change feature to cpi-events
ngundotra 0b678cf
fix no-idl, no-cpi-events, and cpi-events features
ngundotra b7ccc2a
update tests
ngundotra 8c2fbdc
fix no-idl cfg dispatch
ngundotra e68be79
fix tests/events
ngundotra d9cd325
remove cpi-events from Anchor.toml
ngundotra f9bfeff
add documentation
ngundotra 5634cef
slightly better interface for self-program in ctx
ngundotra 9cd071f
Remove accounts and bump argument
acheroncrypto 8b7f515
Add `event_cpi` attribute macro
acheroncrypto 1f456ea
Generate IDL accounts with `event_cpi` macro
acheroncrypto fe49ef6
Resolve event CPI accounts in client
acheroncrypto 397108b
Update tests
acheroncrypto cdd9776
Fix clippy
acheroncrypto 8cc2642
Remove accounts from test
acheroncrypto 690e8c7
Remove Anchor.toml features in tests
acheroncrypto 66d72b1
Add malicious invocation test
acheroncrypto 87652d2
Validate authority in the self-cpi handler to block malicious invocat…
acheroncrypto eb051ef
Make `event-cpi` feature opt-in instead of opt-out
acheroncrypto fd182fe
Fix parsing multiple fields
acheroncrypto 852b8bd
Generate attributes and fields inside the main `TokenStream`
acheroncrypto aa11826
Add documentation
acheroncrypto ac45fc7
Add a note about `ctx` being in scope
acheroncrypto 9b17a4c
Merge master
acheroncrypto 22b902a
Update CHANGELOG
acheroncrypto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| // Sha256(anchor:event)[..8] | ||
| pub const EVENT_IX_TAG: u64 = 0x1d9acb512ea545e4; | ||
| pub const EVENT_IX_TAG_LE: [u8; 8] = EVENT_IX_TAG.to_le_bytes(); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.