Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/parser-lifetime-fix-and-i8-i16-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@codama/renderers-vixen-parser": patch
---

- Resolve build error regarding missing static lifetime on `id` method
- Expand generator support to `i8` and `i16`
2 changes: 1 addition & 1 deletion public/templates/accountsParserPage.njk
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl yellowstone_vixen_core::Parser for AccountParser {
type Input = yellowstone_vixen_core::AccountUpdate;
type Output = {{ programName | pascalCase }}ProgramState;

fn id(&self) -> std::borrow::Cow<str> {
fn id(&self) -> std::borrow::Cow<'static, str> {
"{{ programName | snakeCase }}::AccountParser".into()
}

Expand Down
2 changes: 1 addition & 1 deletion public/templates/instructionsParserPage.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl yellowstone_vixen_core::Parser for InstructionParser {
#[cfg(feature = "shared-data")]
type Output = InstructionUpdateOutput<{{ programName | pascalCase }}ProgramIx>;

fn id(&self) -> std::borrow::Cow<str> {
fn id(&self) -> std::borrow::Cow<'static, str> {
"{{ programName | pascalCase }}::InstructionParser".into()
}

Expand Down
2 changes: 2 additions & 0 deletions src/getRenderMapVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ function getNumberTypeTransform(type: NumberTypeNode) {

case 'u8':
case 'u16':
case 'i8':
case 'i16':
return `.into()`;

default:
Expand Down
2 changes: 1 addition & 1 deletion test/accountsParserPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('it renders accounts parsers', () => {
'impl yellowstone_vixen_core::Parser for AccountParser',
'async fn parse',
'fn prefilter(&self) -> yellowstone_vixen_core::Prefilter',
'fn id(&self) -> std::borrow::Cow<str>',
"fn id(&self) -> std::borrow::Cow<'static, str>",
'type Input = yellowstone_vixen_core::AccountUpdate',
'type Output = TestProgramState',
]);
Expand Down