Skip to content

Commit

Permalink
fix: wc reports unsupported method correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dianasavvatina committed Feb 11, 2025
1 parent e13d2f4 commit 74ee934
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core/src/beaconUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type PartialTezosOperation, TezosOperationType } from "@airgap/beacon-wallet";
import { isValidImplicitPkh, parseImplicitPkh, parsePkh } from "@umami/tezos";
import { CustomError } from "@umami/utils";
import { WalletConnectError, WcErrorCode } from "@umami/utils";

import { type ImplicitAccount } from "./Account";
import { type ImplicitOperations } from "./AccountOperations";
Expand All @@ -19,7 +19,7 @@ export const toAccountOperations = (
signer: ImplicitAccount
): ImplicitOperations => {
if (operationDetails.length === 0) {
throw new CustomError("Empty operation details!");
throw new WalletConnectError("Empty operation details!", WcErrorCode.INVALID_PARAMS, null);
}

const operations = operationDetails.map(operation =>
Expand Down Expand Up @@ -106,6 +106,10 @@ export const partialOperationToOperation = (
};
}
default:
throw new CustomError(`Unsupported operation kind: ${partialOperation.kind}`);
throw new WalletConnectError(
`Unsupported operation kind: ${partialOperation.kind}`,
WcErrorCode.METHOD_UNSUPPORTED,
null
);
}
};

1 comment on commit 74ee934

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Lines Statements Branches Functions
apps/desktop Coverage: 83%
83.74% (1788/2135) 79.43% (850/1070) 78.27% (454/580)
apps/web Coverage: 83%
83.74% (1788/2135) 79.43% (850/1070) 78.27% (454/580)
packages/components Coverage: 97%
97.51% (196/201) 95.91% (94/98) 88.13% (52/59)
packages/core Coverage: 81%
82.37% (215/261) 72.51% (95/131) 81.66% (49/60)
packages/crypto Coverage: 100%
100% (43/43) 90.9% (10/11) 100% (7/7)
packages/data-polling Coverage: 96%
94.66% (142/150) 87.5% (21/24) 92.85% (39/42)
packages/multisig Coverage: 98%
98.47% (129/131) 85.71% (18/21) 100% (36/36)
packages/social-auth Coverage: 95%
95.45% (21/22) 91.66% (11/12) 100% (3/3)
packages/state Coverage: 83%
83.21% (833/1001) 79.58% (191/240) 76.7% (303/395)
packages/tezos Coverage: 89%
88.72% (118/133) 94.59% (35/37) 86.84% (33/38)
packages/tzkt Coverage: 89%
87.32% (62/71) 87.5% (14/16) 80.48% (33/41)

Please sign in to comment.