Skip to content

Commit f70b407

Browse files
Nagaprasadvrkespinolalorisleiva
authored
Integrate yellowstone-vixen-parser with codama (#348)
* create a new package for vixen parser and add account parser template * WIP: acc parser * fix account parsing * WIP : add idl parsing logic * WIP: add acc and ix parser * fix:imports * add anchor idl support * chore : cleanup * merge imports to single import and add comments * check cargo build and fix imports * fix : handle single ix without discriminator * fix build errors * resolve comments * degrade borsh version for compatibility * add yellowstone-vixen service to test generated parsers * cleanup lock files * add tests * add e2e tests * fix lint * make e2e test scripts executable * fix codama-idl generation and add meteora example * cleanup * delect config * resolve comments * fix linting and tests * Update main.yml * Rerun tests * Add changesets --------- Co-authored-by: Kyle Espinola <[email protected]> Co-authored-by: Loris Leiva <[email protected]>
1 parent 3fb8c17 commit f70b407

File tree

200 files changed

+73701
-12462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+73701
-12462
lines changed

.changeset/many-cooks-dream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codama/renderers-rust': patch
3+
---
4+
5+
Add `Debug` trait to instruction structs

.changeset/thin-jobs-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codama/renderers-vixen-parser': patch
3+
---
4+
5+
Add new Vixen parser renderer

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ jobs:
6666
run: pnpm run test
6767

6868
- name: Ensure working directory is clean
69-
run: test -z "$(git status --porcelain)"
69+
run: |
70+
git status
71+
test -z "$(git status --porcelain)"
7072
7173
release:
7274
name: Release

packages/nodes-from-anchor/src/v00/ProgramNode.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import { instructionNodeFromAnchorV00 } from './InstructionNode';
88
import { pdaNodeFromAnchorV00 } from './PdaNode';
99

1010
export function programNodeFromAnchorV00(idl: IdlV00): ProgramNode {
11-
const origin = (idl.metadata as { origin?: 'anchor' | 'shank' }).origin ?? 'anchor';
11+
const origin = (idl?.metadata as { origin?: 'anchor' | 'shank' })?.origin ?? 'anchor';
1212
const pdas = (idl.accounts ?? []).filter(account => (account.seeds ?? []).length > 0).map(pdaNodeFromAnchorV00);
1313
const accounts = (idl.accounts ?? []).map(a => accountNodeFromAnchorV00(a, origin));
1414
const instructions = (idl.instructions ?? []).map(i => instructionNodeFromAnchorV00(i, origin));
1515
return programNode({
1616
accounts,
17-
definedTypes: (idl.types ?? []).map(definedTypeNodeFromAnchorV00),
18-
errors: (idl.errors ?? []).map(errorNodeFromAnchorV00),
17+
definedTypes: (idl?.types ?? []).map(definedTypeNodeFromAnchorV00),
18+
errors: (idl?.errors ?? []).map(errorNodeFromAnchorV00),
1919
instructions,
20-
name: idl.name ?? '',
20+
name: idl?.name ?? '',
2121
origin,
2222
pdas,
23-
publicKey: (idl.metadata as { address?: string })?.address ?? '',
23+
publicKey: (idl?.metadata as { address?: string })?.address ?? '',
2424
version: idl.version as ProgramVersion,
2525
});
2626
}

0 commit comments

Comments
 (0)