From 1935898edc4b3d704ed9a9ddb2f8d02672174ad3 Mon Sep 17 00:00:00 2001 From: Kai Peacock Date: Mon, 21 Oct 2024 11:00:44 -0700 Subject: [PATCH] prettier --- packages/agent/src/actor.ts | 28 +++++++++++++++------------- packages/agent/src/certificate.ts | 16 ++++++++-------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/packages/agent/src/actor.ts b/packages/agent/src/actor.ts index 8ea0f2b8..305177f6 100644 --- a/packages/agent/src/actor.ts +++ b/packages/agent/src/actor.ts @@ -1,4 +1,4 @@ -import { Buffer } from "buffer/"; +import { Buffer } from 'buffer/'; import { Agent, getDefaultAgent, @@ -9,16 +9,16 @@ import { SubmitResponse, v2ResponseBody, v3ResponseBody, -} from "./agent"; -import { AgentError } from "./errors"; -import { bufFromBufLike, IDL } from "@dfinity/candid"; -import { pollForResponse, PollStrategyFactory, strategy } from "./polling"; -import { Principal } from "@dfinity/principal"; -import { RequestId } from "./request_id"; -import { toHex } from "./utils/buffer"; -import { Certificate, CreateCertificateOptions, lookupResultToBuffer } from "./certificate"; -import managementCanisterIdl from "./canisters/management_idl"; -import _SERVICE, { canister_install_mode, canister_settings } from "./canisters/management_service"; +} from './agent'; +import { AgentError } from './errors'; +import { bufFromBufLike, IDL } from '@dfinity/candid'; +import { pollForResponse, PollStrategyFactory, strategy } from './polling'; +import { Principal } from '@dfinity/principal'; +import { RequestId } from './request_id'; +import { toHex } from './utils/buffer'; +import { Certificate, CreateCertificateOptions, lookupResultToBuffer } from './certificate'; +import managementCanisterIdl from './canisters/management_idl'; +import _SERVICE, { canister_install_mode, canister_settings } from './canisters/management_service'; export class ActorCallError extends AgentError { constructor( @@ -585,13 +585,15 @@ function _createActorMethod( } else if (!response.ok || response.body /* IC-1462 */) { // handle v2 response errors by throwing an UpdateCallRejectedError object const { reject_code, reject_message, error_code } = response.body as v2ResponseBody; - throw new UpdateCallRejectedError(cid, + throw new UpdateCallRejectedError( + cid, methodName, requestId, response, reject_code, reject_message, - error_code) + error_code, + ); } // Fall back to polling if we receive an Accepted response code diff --git a/packages/agent/src/certificate.ts b/packages/agent/src/certificate.ts index d20cb925..813cd704 100644 --- a/packages/agent/src/certificate.ts +++ b/packages/agent/src/certificate.ts @@ -1,11 +1,11 @@ -import * as cbor from "./cbor"; -import { AgentError } from "./errors"; -import { hash } from "./request_id"; -import { bufEquals, concat, fromHex, toHex } from "./utils/buffer"; -import { Principal } from "@dfinity/principal"; -import * as bls from "./utils/bls"; -import { decodeTime } from "./utils/leb"; -import { MANAGEMENT_CANISTER_ID } from "./agent"; +import * as cbor from './cbor'; +import { AgentError } from './errors'; +import { hash } from './request_id'; +import { bufEquals, concat, fromHex, toHex } from './utils/buffer'; +import { Principal } from '@dfinity/principal'; +import * as bls from './utils/bls'; +import { decodeTime } from './utils/leb'; +import { MANAGEMENT_CANISTER_ID } from './agent'; /** * A certificate may fail verification with respect to the provided public key