2020-07-08 05:46:16 -07:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import type {TransactionSignature} from '../../src/transaction';
|
2020-09-07 22:12:47 -07:00
|
|
|
import {mockRpcSocket} from '../__mocks__/rpc-websockets';
|
2020-07-08 05:46:16 -07:00
|
|
|
|
|
|
|
export function mockConfirmTransaction(signature: TransactionSignature) {
|
2020-09-07 22:12:47 -07:00
|
|
|
mockRpcSocket.push([
|
2020-07-08 05:46:16 -07:00
|
|
|
{
|
2020-09-07 22:12:47 -07:00
|
|
|
method: 'signatureSubscribe',
|
2020-12-24 10:43:45 -08:00
|
|
|
params: [signature, {commitment: 'singleGossip'}],
|
2020-07-08 05:46:16 -07:00
|
|
|
},
|
|
|
|
{
|
2020-09-07 22:12:47 -07:00
|
|
|
context: {
|
|
|
|
slot: 11,
|
2020-07-08 05:46:16 -07:00
|
|
|
},
|
2020-09-07 22:12:47 -07:00
|
|
|
value: {err: null},
|
2020-07-08 05:46:16 -07:00
|
|
|
},
|
|
|
|
]);
|
|
|
|
}
|