fix: update node exit rpc to match solana changes
This commit is contained in:
parent
8949f321c5
commit
7191159377
|
@ -123,7 +123,7 @@ declare module '@solana/web3.js' {
|
||||||
callback: ProgramAccountChangeCallback,
|
callback: ProgramAccountChangeCallback,
|
||||||
): number;
|
): number;
|
||||||
removeProgramAccountChangeListener(id: number): Promise<void>;
|
removeProgramAccountChangeListener(id: number): Promise<void>;
|
||||||
fullnodeExit(): Promise<boolean>;
|
validatorExit(): Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// === src/system-program.js ===
|
// === src/system-program.js ===
|
||||||
|
|
|
@ -823,8 +823,8 @@ export class Connection {
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
async fullnodeExit(): Promise<boolean> {
|
async validatorExit(): Promise<boolean> {
|
||||||
const unsafeRes = await this._rpcRequest('fullnodeExit', []);
|
const unsafeRes = await this._rpcRequest('validatorExit', []);
|
||||||
const res = jsonRpcResult('boolean')(unsafeRes);
|
const res = jsonRpcResult('boolean')(unsafeRes);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
throw new Error(res.error.message);
|
throw new Error(res.error.message);
|
||||||
|
|
|
@ -86,9 +86,9 @@ test('get program accounts', async () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('fullnodeExit', async () => {
|
test('validatorExit', async () => {
|
||||||
if (!mockRpcEnabled) {
|
if (!mockRpcEnabled) {
|
||||||
console.log('fullnodeExit skipped on live node');
|
console.log('validatorExit skipped on live node');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const connection = new Connection(url);
|
const connection = new Connection(url);
|
||||||
|
@ -96,7 +96,7 @@ test('fullnodeExit', async () => {
|
||||||
mockRpc.push([
|
mockRpc.push([
|
||||||
url,
|
url,
|
||||||
{
|
{
|
||||||
method: 'fullnodeExit',
|
method: 'validatorExit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
error: null,
|
error: null,
|
||||||
|
@ -104,7 +104,7 @@ test('fullnodeExit', async () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const result = await connection.fullnodeExit();
|
const result = await connection.validatorExit();
|
||||||
expect(result).toBe(false);
|
expect(result).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue