Skip to content

Commit

Permalink
fix recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Jul 2, 2024
1 parent 255b6a4 commit e12a91e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { call, IDL, Principal, query, trap, update } from 'azle';

import { MyCanister as MyFullCanister } from '../recursive_canister';
import { MyCanister as MyFullCanister } from '../recursive_canister/types';

// These are the types that can be recursive
// Record
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { IDL, init, Principal, query } from 'azle';
import { IDL, init, query } from 'azle';

let myMessage = '';
import { MyCanister } from './types';

export const MyCanister = IDL.Rec();
MyCanister.fill(
IDL.Service({
myQuery: IDL.Func([MyCanister], [MyCanister], ['query']),
getMessage: IDL.Func([], [IDL.Text], ['query'])
})
);
export type MyCanister = Principal;
let myMessage = '';

export default class {
@init([IDL.Text])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IDL, Principal } from 'azle';

export const MyCanister = IDL.Rec();
MyCanister.fill(
IDL.Service({
myQuery: IDL.Func([MyCanister], [MyCanister], ['query']),
getMessage: IDL.Func([], [IDL.Text], ['query'])
})
);
export type MyCanister = Principal;

0 comments on commit e12a91e

Please sign in to comment.