Skip to content

Commit

Permalink
test: split oxfordnet feature getPendingOperation with version2
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang committed Sep 12, 2023
1 parent b3b09c5 commit b7cbf71
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions integration-tests/rpc-nodes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CONFIGS } from './config';
import { DefaultContractType } from "@taquito/taquito";
import { CONFIGS, NetworkType } from './config';
import { DefaultContractType, Protocols } from "@taquito/taquito";
import { RpcClientCache, RpcClient, RPCRunViewParam, RPCRunScriptViewParam, PendingOperationsV1, PendingOperationsV2, PvmKind } from '@taquito/rpc';
import { encodeExpr } from '@taquito/utils';
import { Schema } from '@taquito/michelson-encoder';
Expand All @@ -20,6 +20,7 @@ CONFIGS().forEach(
}) => {
const Tezos = lib;
const unrestrictedRPCNode = rpc.endsWith("ecadinfra.com") ? test.skip : test;
const oxfordnetAndAlpha = protocol === Protocols.Proxford || protocol === Protocols.ProtoALpha ? test : test.skip;

let ticketContract: DefaultContractType;

Expand Down Expand Up @@ -488,15 +489,18 @@ CONFIGS().forEach(
done();
});

it('Verify that rpcClient.getPendingOperations will retrieve the pending operations in mempool', async (done) => {
it('Verify that rpcClient.getPendingOperations version1 will retrieve the pending operations in mempool with property applied', async (done) => {
const pendingOperations1 = await rpcClient.getPendingOperations() as PendingOperationsV1;
expect(pendingOperations1).toBeDefined();
expect(pendingOperations1.applied).toBeInstanceOf(Array);
expect(pendingOperations1.refused).toBeInstanceOf(Array);
expect(pendingOperations1.outdated).toBeInstanceOf(Array);
expect(pendingOperations1.branch_delayed).toBeInstanceOf(Array);
expect(pendingOperations1.branch_refused).toBeInstanceOf(Array);
done();
});

oxfordnetAndAlpha('Verify that rpcClient.getPendingOperations version2 will retrieve the pending operations in mempool with property validated', async (done) => {
const pendingOperations2 = await rpcClient.getPendingOperations({ version: '2' }) as PendingOperationsV2;
expect(pendingOperations2).toBeDefined();
expect(pendingOperations2.validated).toBeInstanceOf(Array);
Expand All @@ -505,7 +509,7 @@ CONFIGS().forEach(
expect(pendingOperations2.branch_delayed).toBeInstanceOf(Array);
expect(pendingOperations2.branch_refused).toBeInstanceOf(Array);
done();
});
})

it('Verify that rpcClient.getOriginationProof will retrieve the proof needed for smart rollup originate', async (done) => {
const proof = await rpcClient.getOriginationProof({
Expand Down

0 comments on commit b7cbf71

Please sign in to comment.