-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(klesia): handle unfunded accounts
- Loading branch information
Showing
18 changed files
with
220 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import type { RpcErrorType, RpcMethodType } from "../schema"; | ||
import type { RpcErrorType } from "../schema"; | ||
|
||
export const buildResponse = ({ | ||
result, | ||
error, | ||
method, | ||
}: { result?: unknown; error?: RpcErrorType; method: RpcMethodType }) => { | ||
}: { result?: unknown; error?: RpcErrorType }) => { | ||
if (error) { | ||
return { | ||
jsonrpc: "2.0", | ||
error, | ||
method, | ||
}; | ||
} | ||
return { jsonrpc: "2.0", result, method }; | ||
return { jsonrpc: "2.0", result }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { expect, it } from "bun:test"; | ||
import { mnemonic } from "../test/constants"; | ||
import { Test } from "@mina-js/shared"; | ||
import { mnemonicToAccount } from "./mnemonic-to-account"; | ||
|
||
it("matches the snapshot", () => { | ||
const mnemonicAccount = mnemonicToAccount({ mnemonic }); | ||
const mnemonicAccount = mnemonicToAccount({ mnemonic: Test.mnemonic }); | ||
expect(mnemonicAccount).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`matches snapshot of local source 1`] = ` | ||
{ | ||
"getAccounts": [Function: AsyncFunction], | ||
"getBalance": [Function: AsyncFunction], | ||
} | ||
`; | ||
|
||
exports[`matches snapshot of json-rpc source 1`] = ` | ||
{ | ||
"getAccounts": [Function: AsyncFunction], | ||
"getBalance": [Function: AsyncFunction], | ||
} | ||
`; |
Oops, something went wrong.