Skip to content

TypeScript Non-Ascii encodings #14

@pouya-eghbali

Description

@pouya-eghbali

In our TypeScript generator, we throw if encoding is not ascii, see:

private getSerializeFunctionName(field: FieldDefinition): string {
if (field.type === "string") {
if (field.encoding === "ascii") {
return "sia.addAscii";
}
throw new Error(`Unknown encoding: ${field.encoding}`);
}

If encoding is not specified or is anything other than ascii, we should use one of sia.addString{N|8|16|32|64}. I also noticed we are using string type, which is incorrect. It should be string{8|16|32|64}. I checked and string{N|8|16|32|64} is valid. @Hamedblue1381, check and make sure string is not a valid type anymore, and make sure the TypeScript generator works with any other encoding.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions