From 7073310e2b5257a55d18d1e32acbc37809d502dd Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Tue, 11 Feb 2020 15:22:12 +0800 Subject: [PATCH] fix: add Buffer to loader elf data arg type --- web3.js/module.d.ts | 4 ++-- web3.js/module.flow.js | 4 ++-- web3.js/src/bpf-loader.js | 2 +- web3.js/src/loader.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web3.js/module.d.ts b/web3.js/module.d.ts index 781039980b..d4cc2e453f 100644 --- a/web3.js/module.d.ts +++ b/web3.js/module.d.ts @@ -443,7 +443,7 @@ declare module '@solana/web3.js' { payer: Account, program: Account, programId: PublicKey, - data: Array, + data: Buffer | Array, ): Promise; } @@ -454,7 +454,7 @@ declare module '@solana/web3.js' { static load( connection: Connection, payer: Account, - elfBytes: Array, + elfBytes: Buffer | Array, ): Promise; } diff --git a/web3.js/module.flow.js b/web3.js/module.flow.js index 6fa03f1168..f366e4d2d2 100644 --- a/web3.js/module.flow.js +++ b/web3.js/module.flow.js @@ -457,7 +457,7 @@ declare module '@solana/web3.js' { payer: Account, program: Account, programId: PublicKey, - data: Array, + data: Buffer | Array, ): Promise; } @@ -468,7 +468,7 @@ declare module '@solana/web3.js' { static load( connection: Connection, payer: Account, - elfBytes: Array, + elfBytes: Buffer | Array, ): Promise; } diff --git a/web3.js/src/bpf-loader.js b/web3.js/src/bpf-loader.js index 9cc2629050..3d140a67cc 100644 --- a/web3.js/src/bpf-loader.js +++ b/web3.js/src/bpf-loader.js @@ -36,7 +36,7 @@ export class BpfLoader { static load( connection: Connection, payer: Account, - elf: Array, + elf: Buffer | Array, ): Promise { const program = new Account(); return Loader.load(connection, payer, program, BpfLoader.programId, elf); diff --git a/web3.js/src/loader.js b/web3.js/src/loader.js index d1a3edd715..cff3a87f5c 100644 --- a/web3.js/src/loader.js +++ b/web3.js/src/loader.js @@ -52,7 +52,7 @@ export class Loader { payer: Account, program: Account, programId: PublicKey, - data: Array, + data: Buffer | Array, ): Promise { { const balanceNeeded = await connection.getMinimumBalanceForRentExemption(