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.
In our TypeScript generator, we throw if encoding is not
ascii, see:sia-schema/src/generator/ts/index.ts
Lines 267 to 274 in 703e1c7
If encoding is not specified or is anything other than
ascii, we should use one ofsia.addString{N|8|16|32|64}. I also noticed we are usingstringtype, which is incorrect. It should bestring{8|16|32|64}. I checked andstring{N|8|16|32|64}is valid. @Hamedblue1381, check and make surestringis not a valid type anymore, and make sure the TypeScript generator works with any other encoding.