-
Notifications
You must be signed in to change notification settings - Fork 75
feat(svm): query events script #804
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
Conversation
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
70c4631 to
423dcaa
Compare
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
| type: "string", | ||
| demandOption: false, | ||
| describe: "Name of the event to query", | ||
| choices: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shouldn't event names start with capital letter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EventCoder returns them with the first letter in lowercase. I guess we could capitalize the events ourselves in the processEventFromTx function as a custom treatment, but we aren’t doing that. That’s why the event names should match those returned by the EventCoder.
src/svm/solanaProgramUtils.ts
Outdated
| */ | ||
| export function stringifyCpiEvent(obj: any): any { | ||
| if (obj?.constructor?.toString()?.includes("PublicKey")) { | ||
| if (obj.toString().includes("111111111111")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unlikely to have zeroes anywhere else than in the beginning, though, still better to restrict that only the first 12 bytes matching 0 are translated as EVM addresses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100%
Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Changes proposed in this PR: