From 7191159377e3b3144322649a07a64463eb8b75dd Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Fri, 11 Oct 2019 11:55:08 -0600 Subject: [PATCH] fix: update node exit rpc to match solana changes --- web3.js/module.flow.js | 2 +- web3.js/src/connection.js | 4 ++-- web3.js/test/connection.test.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web3.js/module.flow.js b/web3.js/module.flow.js index ebab054478..48fef91095 100644 --- a/web3.js/module.flow.js +++ b/web3.js/module.flow.js @@ -123,7 +123,7 @@ declare module '@solana/web3.js' { callback: ProgramAccountChangeCallback, ): number; removeProgramAccountChangeListener(id: number): Promise; - fullnodeExit(): Promise; + validatorExit(): Promise; } // === src/system-program.js === diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index 5ab4387b27..bec9c24f14 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -823,8 +823,8 @@ export class Connection { /** * @private */ - async fullnodeExit(): Promise { - const unsafeRes = await this._rpcRequest('fullnodeExit', []); + async validatorExit(): Promise { + const unsafeRes = await this._rpcRequest('validatorExit', []); const res = jsonRpcResult('boolean')(unsafeRes); if (res.error) { throw new Error(res.error.message); diff --git a/web3.js/test/connection.test.js b/web3.js/test/connection.test.js index 2ec2320b2e..27d6d9af48 100644 --- a/web3.js/test/connection.test.js +++ b/web3.js/test/connection.test.js @@ -86,9 +86,9 @@ test('get program accounts', async () => { }); }); -test('fullnodeExit', async () => { +test('validatorExit', async () => { if (!mockRpcEnabled) { - console.log('fullnodeExit skipped on live node'); + console.log('validatorExit skipped on live node'); return; } const connection = new Connection(url); @@ -96,7 +96,7 @@ test('fullnodeExit', async () => { mockRpc.push([ url, { - method: 'fullnodeExit', + method: 'validatorExit', }, { error: null, @@ -104,7 +104,7 @@ test('fullnodeExit', async () => { }, ]); - const result = await connection.fullnodeExit(); + const result = await connection.validatorExit(); expect(result).toBe(false); });