fix: adapt to GetRecentBlockhash RPC API signature change
This commit is contained in:
@ -173,7 +173,7 @@ const GetTransactionCountRpcResult = jsonRpcResult('number');
|
|||||||
/**
|
/**
|
||||||
* Expected JSON RPC response for the "getRecentBlockhash" message
|
* Expected JSON RPC response for the "getRecentBlockhash" message
|
||||||
*/
|
*/
|
||||||
const GetRecentBlockhash = jsonRpcResult('string');
|
const GetRecentBlockhash = jsonRpcResult(['string', 'object']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expected JSON RPC response for the "requestAirdrop" message
|
* Expected JSON RPC response for the "requestAirdrop" message
|
||||||
@ -435,7 +435,8 @@ export class Connection {
|
|||||||
throw new Error(res.error.message);
|
throw new Error(res.error.message);
|
||||||
}
|
}
|
||||||
assert(typeof res.result !== 'undefined');
|
assert(typeof res.result !== 'undefined');
|
||||||
return res.result;
|
// TODO: deserialize and expose FeeCalculator in res.result[1]
|
||||||
|
return res.result[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,10 @@ export function mockGetRecentBlockhash() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
error: null,
|
error: null,
|
||||||
result: recentBlockhash.publicKey.toBase58(),
|
result: [
|
||||||
|
recentBlockhash.publicKey.toBase58(),
|
||||||
|
{ /* empty fee calculator */}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user