Version: 23.1.0

This documentation is for Taquito version 23.1.0 and is no longer being updated. Some information may be outdated. View the latest version.

RPC tests

Written by Roxane Letourneau

Steps to run the tests

seoulnet: npm run test:seoulnet __tests__/rpc/nodes.spec.ts

When all endpoints are accessible for a node, you will obtain:

  Test calling all methods from RPC node: https://rpc.seoulnet.teztnets.com
    ✓ Verify that rpcClient.getBlockHash returns the head block hash (167 ms)
    ✓ Verify that rpcClient.getLiveBlocks returns the ancestors of the head block (381 ms)
    ✓ Verify that rpcClient.getBalance for knownBaker returns the spendable balance excluding frozen bonds (169 ms)
    ✓ Verify that rpcClient.getSpendable for knownBaker returns the spendable balance excluding frozen bonds (163 ms)
    ✓ Verify that rpcClient.getBalanceAndFrozenBonds for knownBaker returns the full balance (153 ms)
    ✓ Verify that rpcClient.getSpendableAndFrozenBonds for knownBaker returns the full balance (176 ms)
    ✓ Verify that rpcClient.getFullBalance for knownBaker returns the full balance (151 ms)
    ✓ Verify that rpcClient.getStakedBalance for knownBaker returns the staked balance (154 ms)
    ✓ Verify that rpcClient.getUnstakedFinalizableBalance for knownBaker returns the unstaked finalizable balance (149 ms)
    ✓ Verify that rpcClient.getUnstakedFrozenBalance for knownBaker returns the unstaked frozen balance (160 ms)
    ✓ Verify that rpcClient.getUnstakeRequests for knownBaker returns the unstaked requests (157 ms)
    ✓ Verify that rpcClient.getStorage for knownContract returns the data of a contract (158 ms)
    ✓ Verify that rpcClient.getScript for know contract returns the code and data of a contract (170 ms)
    ✓ Verify that rpcClient.getNormalizedScript for known contract returns the script of the contract and normalize it using the requested unparsing mode (202 ms)
    ✓ Verify that rpcClient.getContract returns the complete status of a contract (171 ms)
    ✓ Verify that rpcClient.getManagerKey for known baker returns the manager key of the contract (166 ms)
    ✓ Verify that rpcClient.getDelegate for known baker returns the delegate of the contract (165 ms)
    ✓ Verify that rpcClient.getBigMapExpr for encoded expression returns the value associated with a key in a big map (728 ms)
    ✓ Verify that rpcClient.getAllDelegates returns all delegates from RPC (326 ms)
    ✓ Verify that rpcClient.getDelegates for known baker returns information about a delegate from RPC (173 ms)
    ✓ Verify that rpc.getVotingInfo for known baker returns voting information about a delegate from RPC (155 ms)
    ✓ Verify that rpcClient.getConstants returns all constants from RPC (174 ms)
    ✓ Verify that rpcClient.getBlock returns all the information about a block (156 ms)
    ✓ Verify that rpcClient.getBlockHeader returns whole block header (165 ms)
    ✓ Verify that rpcClient.getBlockMetadata returns all metadata associated to the block (173 ms)
    ✓ Verify that rpcClient.getBakingRights retrieves the list of delegates allowed to bake a block (173 ms)
    ✓ Verify that rpcClient.getAttestationRights retrieves the list of delegates allowed to attest a block (166 ms)
    ✓ Verify that rpcClient.getBallotList returns ballots casted so far during a voting period (171 ms)
    ✓ Verify that rpcClient.getBallots returns sum of ballots casted so far during a voting period (191 ms)
    ✓ Verify that rpcClient.getCurrentPeriod returns current period kind (175 ms)
    ✓ Verify that rpcClient.getCurrentProposal returns current proposal under evaluation (165 ms)
    ✓ Verify that rpcClient.getCurrentQuorum returns current expected quorum (149 ms)
    ✓ Verify that rpcClient.getVotesListings returns list of delegates with their voting weight, in number of rolls (166 ms)
    ✓ Verify that rpcClient.getProposals returns list of proposals with number of supporters (184 ms)
    ✓ Verify that rpcClient.forgeOperations forges an operation and returns the unsigned bytes (152 ms)
    ✓ Verify that rpcClient.injectOperation injects an operation in node and broadcast it (164 ms)
    ✓ Verify that rpcClient.preapplyOperations simulates the validation of an operation (365 ms)
    ✓ Verify that rpcClient.getEntrypoints for known contract returns list of entrypoints of the contract (162 ms)
    ✓ Verify that rpcClient.getChainId returns chain ID (166 ms)
    ✓ Verify that rpcClient.runOperation runs an operation without signature checks (159 ms)
    ✓ Verify that rpcClient.simulateOperation simulates an operation without signature checks (156 ms)
    ✓ Verify that rpcClient.runView executes tzip4 views (329 ms)
    ✓ Verify that rpcClient.runScriptView executes michelson view (326 ms)
    ✓ Verify that rpcClient.getSuccessorPeriod will get the voting period of next block (167 ms)
    ✓ Verify that rpcClient.getSaplingDiffById will access the value associated with a sapling state ID (344 ms)
    ✓ Verify that rpcClient.getSaplingDiffByContract will access the value associated with a sapling state (173 ms)
    ✓ Verify that rpcClient.getProtocols will list past and present Tezos protocols (162 ms)
    ✓ Verify that rpcClient.getProtocolActivations will list all protocol activations info (165 ms)
    ✓ Verify that rpcClient.getProtocolActivations will list a protocol activations info (167 ms)
    ✓ Verify that rpcClient.getStorageUsedSpace will retrieve the used space of a contract storage (159 ms)
    ✓ Verify that rpcClient.getStoragePaidSpace will retrieve the paid space of a contract storage (191 ms)
    ✓ Verify that rpcClient.ticketBalance will retrieve the specified ticket owned by the given contract (165 ms)
    ✓ Verify that rpcClient.allTicketBalances will retrieve all tickets owned by the given contract (176 ms)
    ✓ Verify that rpcClient.getAdaptiveIssuanceLaunchCycle will retrieve launch cycle 6 for https://rpc.seoulnet.teztnets.com (148 ms)
    ✓ Verify that rpcClient.getPendingOperations v2 will retrieve the pending operations in mempool with property validated (522 ms)

Otherwise, you will see which endpoints do not work for a specific node:

  Test calling all methods from RPC node: http://localhost:20000
    ✓ Verify that rpcClient.getBlockHash returns the head block hash (21 ms)
    ✓ Verify that rpcClient.getLiveBlocks returns the ancestors of the head block (20 ms)
    ✓ Verify that rpcClient.getBalance for knownBaker returns the spendable balance excluding frozen bonds (26 ms)
    ✓ Verify that rpcClient.getSpendable for knownBaker returns the spendable balance excluding frozen bonds (16 ms)
    ✓ Verify that rpcClient.getBalanceAndFrozenBonds for knownBaker returns the full balance (17 ms)
    ✓ Verify that rpcClient.getSpendableAndFrozenBonds for knownBaker returns the full balance (21 ms)
    ✓ Verify that rpcClient.getFullBalance for knownBaker returns the full balance (20 ms)
    ✓ Verify that rpcClient.getStakedBalance for knownBaker returns the staked balance (16 ms)
    ✓ Verify that rpcClient.getUnstakedFinalizableBalance for knownBaker returns the unstaked finalizable balance (16 ms)
    ✓ Verify that rpcClient.getUnstakedFrozenBalance for knownBaker returns the unstaked frozen balance (15 ms)
    ✓ Verify that rpcClient.getUnstakeRequests for knownBaker returns the unstaked requests (17 ms)
    ✓ Verify that rpcClient.getStorage for knownContract returns the data of a contract (19 ms)
    ✓ Verify that rpcClient.getScript for know contract returns the code and data of a contract (18 ms)
    ✓ Verify that rpcClient.getNormalizedScript for known contract returns the script of the contract and normalize it using the requested unparsing mode (17 ms)
    ✓ Verify that rpcClient.getContract returns the complete status of a contract (17 ms)
    ✓ Verify that rpcClient.getManagerKey for known baker returns the manager key of the contract (14 ms)
    ✓ Verify that rpcClient.getDelegate for known baker returns the delegate of the contract (16 ms)
    ✓ Verify that rpcClient.getBigMapExpr for encoded expression returns the value associated with a key in a big map (85 ms)
    ✓ Verify that rpcClient.getAllDelegates returns all delegates from RPC (850 ms)
    ✓ Verify that rpcClient.getDelegates for known baker returns information about a delegate from RPC (59 ms)
    ✓ Verify that rpc.getVotingInfo for known baker returns voting information about a delegate from RPC (15 ms)
    ✓ Verify that rpcClient.getConstants returns all constants from RPC (16 ms)
    ✓ Verify that rpcClient.getBlock returns all the information about a block (21 ms)
    ✓ Verify that rpcClient.getBlockHeader returns whole block header (15 ms)
    ✓ Verify that rpcClient.getBlockMetadata returns all metadata associated to the block (16 ms)
    ✓ Verify that rpcClient.getBakingRights retrieves the list of delegates allowed to bake a block (16 ms)
    ✓ Verify that rpcClient.getAttestationRights retrieves the list of delegates allowed to attest a block (23 ms)
    ✓ Verify that rpcClient.getBallotList returns ballots casted so far during a voting period (15 ms)
    ✓ Verify that rpcClient.getBallots returns sum of ballots casted so far during a voting period (15 ms)
    ✓ Verify that rpcClient.getCurrentPeriod returns current period kind (14 ms)
    ✓ Verify that rpcClient.getCurrentProposal returns current proposal under evaluation (15 ms)
    ✓ Verify that rpcClient.getCurrentQuorum returns current expected quorum (13 ms)
    ✓ Verify that rpcClient.getVotesListings returns list of delegates with their voting weight, in number of rolls (19 ms)
    ✓ Verify that rpcClient.getProposals returns list of proposals with number of supporters (14 ms)
    ✓ Verify that rpcClient.forgeOperations forges an operation and returns the unsigned bytes (18 ms)
    ✓ Verify that rpcClient.injectOperation injects an operation in node and broadcast it (17 ms)
    ✓ Verify that rpcClient.preapplyOperations simulates the validation of an operation (36 ms)
    ✓ Verify that rpcClient.getEntrypoints for known contract returns list of entrypoints of the contract (17 ms)
    ✓ Verify that rpcClient.getChainId returns chain ID (15 ms)
    ✓ Verify that rpcClient.runOperation runs an operation without signature checks (17 ms)
    ✓ Verify that rpcClient.simulateOperation simulates an operation without signature checks (16 ms)
    ✓ Verify that rpcClient.runView executes tzip4 views (34 ms)
    ✓ Verify that rpcClient.runScriptView executes michelson view (46 ms)
    ✓ Verify that rpcClient.getSuccessorPeriod will get the voting period of next block (16 ms)
    ✓ Verify that rpcClient.getSaplingDiffById will access the value associated with a sapling state ID (34 ms)
    ✓ Verify that rpcClient.getSaplingDiffByContract will access the value associated with a sapling state (16 ms)
    ✓ Verify that rpcClient.getProtocols will list past and present Tezos protocols (15 ms)
    ✓ Verify that rpcClient.getStorageUsedSpace will retrieve the used space of a contract storage (13 ms)
    ✓ Verify that rpcClient.getStoragePaidSpace will retrieve the paid space of a contract storage (13 ms)
    ✓ Verify that rpcClient.ticketBalance will retrieve the specified ticket owned by the given contract (23 ms)
    ✓ Verify that rpcClient.allTicketBalances will retrieve all tickets owned by the given contract (18 ms)
    ✓ Verify that rpcClient.getAdaptiveIssuanceLaunchCycle will retrieve launch cycle 6 for http://localhost:20000 (15 ms)
    ✓ Verify that rpcClient.getPendingOperations v2 will retrieve the pending operations in mempool with property validated (136 ms)
    ○ skipped Verify that rpcClient.getProtocolActivations will list all protocol activations info
    ○ skipped Verify that rpcClient.getProtocolActivations will list a protocol activations info