From 81253c9956c97203be69b5f4a393f971fb647f28 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 3 Mar 2021 14:42:10 -0800 Subject: [PATCH] chore: remove undocumented validatorExit method --- web3.js/module.d.ts | 1 - web3.js/module.flow.js | 1 - web3.js/src/connection.js | 12 ------------ web3.js/test/connection.test.js | 13 ------------- 4 files changed, 27 deletions(-) diff --git a/web3.js/module.d.ts b/web3.js/module.d.ts index 99441ac304..958dc247af 100644 --- a/web3.js/module.d.ts +++ b/web3.js/module.d.ts @@ -527,7 +527,6 @@ declare module '@solana/web3.js' { removeSignatureListener(id: number): Promise; onRootChange(callback: RootChangeCallback): number; removeRootChangeListener(id: number): Promise; - validatorExit(): Promise; getMinimumBalanceForRentExemption( dataLength: number, commitment?: Commitment, diff --git a/web3.js/module.flow.js b/web3.js/module.flow.js index 45c6f06640..a344a68276 100644 --- a/web3.js/module.flow.js +++ b/web3.js/module.flow.js @@ -531,7 +531,6 @@ declare module '@solana/web3.js' { removeSignatureListener(id: number): Promise; onRootChange(callback: RootChangeCallback): number; removeRootChangeListener(id: number): Promise; - validatorExit(): Promise; getMinimumBalanceForRentExemption( dataLength: number, commitment: ?Commitment, diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index d85169b13e..79c9554c92 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -2682,18 +2682,6 @@ export class Connection { return await this.sendRawTransaction(wireTransaction, options); } - /** - * @private - */ - async validatorExit(): Promise { - const unsafeRes = await this._rpcRequest('validatorExit', []); - const res = create(unsafeRes, jsonRpcResult(boolean())); - if (res.error) { - throw new Error('validator exit failed: ' + res.error.message); - } - return res.result; - } - /** * Send a transaction that has already been signed and serialized into the * wire format diff --git a/web3.js/test/connection.test.js b/web3.js/test/connection.test.js index 4ac03e06c1..7577bee5d6 100644 --- a/web3.js/test/connection.test.js +++ b/web3.js/test/connection.test.js @@ -258,19 +258,6 @@ describe('Connection', () => { } }); - if (!process.env.TEST_LIVE) { - it('validatorExit', async () => { - await mockRpcResponse({ - method: 'validatorExit', - params: [], - value: false, - }); - - const result = await connection.validatorExit(); - expect(result).to.eq(false); - }); - } - it('get balance', async () => { const account = new Account();