Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/nns_proxy/tests/src/support/candid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface UpdateElectedReplicaVersionsPayload {

export function encodeUpdateElectedReplicaVersionsPayload(
arg: UpdateElectedReplicaVersionsPayload,
): ArrayBuffer {
): Uint8Array {
return IDL.encode([UpdateElectedReplicaVersionsPayload], [arg]);
}

Expand Down
36 changes: 18 additions & 18 deletions packages/pic/src/pocket-ic-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,15 @@ export interface SetupCanisterOptions extends CreateCanisterOptions {
/**
* The WASM module to install to the canister.
* If a string is passed, it is treated as a path to a file.
* If an `ArrayBufferLike` is passed, it is treated as the WASM module itself.
* If an `Uint8Array` is passed, it is treated as the WASM module itself.
*/
wasm: ArrayBufferLike | string;
wasm: Uint8Array | string;

/**
* Candid encoded argument to pass to the canister's init function.
* Defaults to an empty ArrayBuffer.
* Defaults to an empty Uint8Array.
*/
arg?: ArrayBufferLike;
arg?: Uint8Array;

/**
* The principal to setup the canister as.
Expand Down Expand Up @@ -584,15 +584,15 @@ export interface InstallCodeOptions {
/**
* The WASM module to install to the canister.
* If a string is passed, it is treated as a path to a file.
* If an `ArrayBufferLike` is passed, it is treated as the WASM module itself.
* If an `Uint8Array` is passed, it is treated as the WASM module itself.
*/
wasm: ArrayBufferLike | string;
wasm: Uint8Array | string;

/**
* Candid encoded argument to pass to the canister's init function.
* Defaults to an empty ArrayBuffer.
* Defaults to an empty Uint8Array.
*/
arg?: ArrayBufferLike;
arg?: Uint8Array;

/**
* The principal to install the code as.
Expand Down Expand Up @@ -622,14 +622,14 @@ export interface ReinstallCodeOptions {
/**
* The WASM module to install to the canister.
* If a string is passed, it is treated as a path to a file.
* If an `ArrayBufferLike` is passed, it is treated as the WASM module itself.
* If an `Uint8Array` is passed, it is treated as the WASM module itself.
*/
wasm: ArrayBufferLike | string;
wasm: Uint8Array | string;

/**
* Candid encoded argument to pass to the canister's init function.
*/
arg?: ArrayBufferLike;
arg?: Uint8Array;

/**
* The Principal to send the request as.
Expand All @@ -654,14 +654,14 @@ export interface UpgradeCanisterOptions {
/**
* The WASM module to install to the canister.
* If a string is passed, it is treated as a path to a file.
* If an `ArrayBufferLike` is passed, it is treated as the WASM module itself.
* If an `Uint8Array` is passed, it is treated as the WASM module itself.
*/
wasm: ArrayBufferLike | string;
wasm: Uint8Array | string;

/**
* Candid encoded argument to pass to the canister's init function.
*/
arg?: ArrayBufferLike;
arg?: Uint8Array;

/**
* The Principal to send the request as.
Expand Down Expand Up @@ -724,9 +724,9 @@ export interface QueryCallOptions {

/**
* A Candid encoded argument to pass to the canister's method.
* Defaults to an empty ArrayBuffer.
* Defaults to an empty Uint8Array.
*/
arg?: ArrayBufferLike;
arg?: Uint8Array;

/**
* The ID of the subnet that the canister resides on.
Expand Down Expand Up @@ -760,9 +760,9 @@ export interface UpdateCallOptions {

/**
* A Candid encoded argument to pass to the canister's method.
* Defaults to an empty ArrayBuffer.
* Defaults to an empty Uint8Array.
*/
arg?: ArrayBufferLike;
arg?: Uint8Array;

/**
* The ID of the subnet that the canister resides on.
Expand Down
12 changes: 5 additions & 7 deletions packages/pic/src/pocket-ic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ export class PocketIc {
arg = new Uint8Array(),
sender = Principal.anonymous(),
targetSubnetId,
}: QueryCallOptions): Promise<ArrayBufferLike> {
}: QueryCallOptions): Promise<Uint8Array> {
const res = await this.client.queryCall({
canisterId,
method,
Expand Down Expand Up @@ -731,7 +731,7 @@ export class PocketIc {
arg = new Uint8Array(),
sender = Principal.anonymous(),
targetSubnetId,
}: UpdateCallOptions): Promise<ArrayBufferLike> {
}: UpdateCallOptions): Promise<Uint8Array> {
const res = await this.client.updateCall({
canisterId,
method,
Expand Down Expand Up @@ -1056,7 +1056,7 @@ export class PocketIc {
* await picServer.stop();
* ```
*/
public async getPubKey(subnetId: Principal): Promise<ArrayBufferLike> {
public async getPubKey(subnetId: Principal): Promise<Uint8Array> {
return await this.client.getPubKey({ subnetId });
}

Expand Down Expand Up @@ -1289,7 +1289,7 @@ export class PocketIc {
*/
public async setStableMemory(
canisterId: Principal,
stableMemory: ArrayBufferLike,
stableMemory: Uint8Array,
): Promise<void> {
const { blobId } = await this.client.uploadBlob({
blob: new Uint8Array(stableMemory),
Expand Down Expand Up @@ -1322,9 +1322,7 @@ export class PocketIc {
* await picServer.stop();
* ```
*/
public async getStableMemory(
canisterId: Principal,
): Promise<ArrayBufferLike> {
public async getStableMemory(canisterId: Principal): Promise<Uint8Array> {
const { blob } = await this.client.getStableMemory({ canisterId });

return blob;
Expand Down