fix: getConfirmedBlock result pattern fixup

This commit is contained in:
Tyera Eulberg 2019-11-26 01:34:42 -07:00 committed by Michael Vines
parent a461d5f25f
commit 2d5ace244a
2 changed files with 10 additions and 8 deletions

View File

@ -75,7 +75,9 @@ declare module '@solana/web3.js' {
blockhash: Blockhash,
previousBlockhash: Blockhash,
parentSlot: number,
transactions: Array<[Transaction, SignatureSuccess | TransactionError | null]>,
transactions: Array<
[Transaction, SignatureSuccess | TransactionError | null],
>,
};
declare export type KeyedAccountInfo = {

View File

@ -399,15 +399,15 @@ const GetVoteAccounts = jsonRpcResult(
}),
);
const SignatureStatusResult = struct.union([
'null',
struct.union([struct({Ok: 'null'}), struct({Err: 'object'})]),
]);
/**
* Expected JSON RPC response for the "getSignatureStatus" message
*/
const GetSignatureStatusRpcResult = jsonRpcResult(
struct.union([
'null',
struct.union([struct({Ok: 'null'}), struct({Err: 'object'})]),
]),
);
const GetSignatureStatusRpcResult = jsonRpcResult(SignatureStatusResult);
/**
* Expected JSON RPC response for the "getTransactionCount" message
@ -463,7 +463,7 @@ export const GetConfirmedBlockRpcResult = jsonRpcResult(
struct.union([
'null',
struct({
status: GetSignatureStatusRpcResult,
status: SignatureStatusResult,
fee: 'number',
}),
]),