From 427d0ff0b51636b626fceacf9e341e038028267b Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 10 Jul 2020 20:22:32 -0700 Subject: [PATCH] fix: ignore unknown fields in more RPC responses --- web3.js/src/connection.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index 32fe1318af..2a505f9926 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -615,7 +615,7 @@ const GetSlotLeader = jsonRpcResult('string'); */ const GetClusterNodes = jsonRpcResult( struct.array([ - struct({ + struct.pick({ pubkey: 'string', gossip: struct.union(['null', 'string']), tpu: struct.union(['null', 'string']), @@ -631,7 +631,7 @@ const GetClusterNodes = jsonRpcResult( const GetVoteAccounts = jsonRpcResult( struct({ current: struct.array([ - struct({ + struct.pick({ votePubkey: 'string', nodePubkey: 'string', activatedStake: 'number', @@ -645,7 +645,7 @@ const GetVoteAccounts = jsonRpcResult( }), ]), delinquent: struct.array([ - struct({ + struct.pick({ votePubkey: 'string', nodePubkey: 'string', activatedStake: 'number', @@ -737,7 +737,7 @@ const ConfirmedTransactionMetaResult = struct.union([ export const GetConfirmedBlockRpcResult = jsonRpcResult( struct.union([ 'null', - struct({ + struct.pick({ blockhash: 'string', previousBlockhash: 'string', parentSlot: 'number', @@ -766,7 +766,7 @@ export const GetConfirmedBlockRpcResult = jsonRpcResult( const GetConfirmedTransactionRpcResult = jsonRpcResult( struct.union([ 'null', - struct({ + struct.pick({ slot: 'number', transaction: ConfirmedTransactionResult, meta: ConfirmedTransactionMetaResult,