Skip to content

Commit

Permalink
fix missing Principal import in Func, RequireExactlyOne import in Var…
Browse files Browse the repository at this point in the history
…iant, tsType for AzleBlob
  • Loading branch information
lastmjs committed Dec 6, 2023
1 parent 1c38ca2 commit fd555e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function generateImports(fields: Field[]): Set<string> {
const fieldImports = fields.flatMap((field) => [
...field[1].candidMeta.imports
]);
return new Set([...fieldImports, 'Variant']);
return new Set([...fieldImports, 'RequireExactlyOne', 'Variant']);
}

function generateVariableAliasDeclarations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export function FuncDefinitionArb(
const imports = new Set([
...params.flatMap((param) => [...param.candidMeta.imports]),
...returnFunc.candidMeta.imports,
'Func'
'Func',
'Principal'
]);

return {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/candid/types/constructed/blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export class AzleBlob {
_azleKind: 'AzleBlob' = 'AzleBlob';
static _azleKind: 'AzleBlob' = 'AzleBlob';

static tsType: AzleBlob;

static toBytes(data: any) {
return encode(this, data);
}
Expand Down

0 comments on commit fd555e0

Please sign in to comment.