fix: catch up to recent upstream changes

This commit is contained in:
Michael Vines
2018-10-17 09:35:24 -07:00
parent 972f68b16e
commit 011a2abd0c
10 changed files with 245 additions and 70 deletions

View File

@ -83,6 +83,8 @@ function jsonRpcResult(resultDescription: any) {
* Expected JSON RPC response for the "getAccountInfo" message
*/
const GetAccountInfoRpcResult = jsonRpcResult({
executable: 'boolean',
loader_program_id: 'array',
program_id: 'array',
tokens: 'number',
userdata: 'array',
@ -138,8 +140,9 @@ const SendTokensRpcResult = jsonRpcResult('string');
* @property {?Buffer} userdata Optional userdata assigned to the account
*/
type AccountInfo = {
tokens: number,
executable: boolean;
programId: PublicKey,
tokens: number,
userdata: Buffer,
}
@ -201,8 +204,10 @@ export class Connection {
assert(typeof result !== 'undefined');
return {
executable: result.executable,
tokens: result.tokens,
programId: new PublicKey(result.program_id),
loaderProgramId: new PublicKey(result.loader_program_id),
userdata: Buffer.from(result.userdata),
};
}