Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 3, 2023
1 parent 602beff commit 3de201c
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/lib/candid/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IDL } from '@dfinity/candid';
import { AzleBlob, blob } from './types/constructed/blob';
import { AzleVec } from './types/constructed/vector';
import { AzleOpt, Opt } from './types/constructed/option';
import { AzleVec } from './types/constructed/vec';
import { AzleOpt, Opt } from './types/constructed/opt';
import { AzleTuple } from './types/constructed/tuple';
import { AzleNull, Null } from './types/primitive/null';
import { AzleReserved, reserved } from './types/primitive/reserved';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/candid/types/constructed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { CandidType, Parent, toIDLType } from '../../index';
import { IDL } from '@dfinity/candid';

export * from './blob';
export * from './option';
export * from './opt';
export * from './record';
export * from './tuple';
export * from './variant';
export * from './vector';
export * from './vec';

type CandidMap = { [key: string]: CandidType };
type IdlMap = { [key: string]: IDL.Type<any> };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CandidType, Parent, toIDLType } from '../../index';
import { RequireExactlyOne } from '../constructed/variant';
import { RequireExactlyOne } from './variant';
import { IDL } from '@dfinity/candid';

/**
Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions src/lib/ic/accept_message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ import { Void } from '../candid/types/primitive/void';
* Accepts the ingress message. Calling from outside the
* {@link $inspectMessage} context will cause the canister to trap.
*/
export function acceptMessage(): Void {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const acceptMessage = () => Void;
6 changes: 1 addition & 5 deletions src/lib/ic/arg_data_raw_size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ import { nat } from '../candid/types/primitive/nats/nat';
* Gets the length of the raw-argument-data-bytes
* @returns the data size
*/
export function argDataRawSize(): nat {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const argDataRawSize = () => nat;
2 changes: 1 addition & 1 deletion src/lib/ic/data_certificate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { blob } from '../candid/types/constructed/blob';
import { None, Opt, Some } from '../candid/types/constructed/option';
import { None, Opt, Some } from '../candid/types/constructed/opt';

/**
* When called from a query call, returns the data certificate
Expand Down
6 changes: 1 addition & 5 deletions src/lib/ic/method_name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ import { text } from '../candid/types/primitive/text';
* Returns the name of the current canister methods
* @returns the current canister method
*/
export function methodName(): text {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const methodName = () => text;
6 changes: 1 addition & 5 deletions src/lib/ic/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ import { Void } from '../candid/types/primitive/void';
* Prints the given message
* @param args the message to print
*/
export function print(...args: any): Void {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const print = (...args: any) => Void;
6 changes: 1 addition & 5 deletions src/lib/ic/reject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ import { Void } from '../candid/types/primitive/void';
* Rejects the current call with the provided message
* @param message the rejection message
*/
export function reject(message: text): Void {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const reject = (message: text) => Void;
6 changes: 1 addition & 5 deletions src/lib/ic/reject_message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ import { text } from '../candid/types/primitive/text';
*
* @returns the rejection message
*/
export function rejectMessage(): text {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const rejectMessage = () => text;
6 changes: 1 addition & 5 deletions src/lib/ic/trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ import { text } from '../candid/types/primitive/text';
* (5) rejection code and the provided message
* @param message the rejection message
*/
export function trap(message: text): empty {
throw new Error(
'This function should not be called directly. It is implemented directly on the ic object'
);
}
export const trap = (message: text) => empty;
2 changes: 1 addition & 1 deletion src/lib/stable_b_tree_map.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CandidType, TypeMapping, toIDLType } from './candid';
import { None, Opt, Some } from './candid/types/constructed/option';
import { None, Opt, Some } from './candid/types/constructed/opt';
import { IDL } from '@dfinity/candid';
import { nat64 } from './candid/types/primitive/nats/nat64';
import { nat8 } from './candid/types/primitive/nats/nat8';
Expand Down

0 comments on commit 3de201c

Please sign in to comment.