Repository: ecadlabs/taquito
Pull request #1015 (2021-08-12 21:03:55)

Reverted possibility to send several operations in the same block
Thank you for your contribution to Taquito.

Before submitting this PR, please make sure:

- [ ] Your code builds cleanly without any errors or warnings
- [ ] You have added unit tests
- [ ] You have added integration tests (if relevant/appropriate)
- [ ] All public methods or types have TypeDoc coverage with a complete description, and ideally an @example
- [ ] You have added or updated corresponding documentation
- [ ] If relevant, you have written a first draft summary describing the change for inclusion in Release Notes. 

## Release Note Draft Snippet

__If relevant, please write a summary of your change that will be suitable for
inclusion in the Release Notes for the next Taquito release.__



Patch:
diff --git a/packages/taquito/src/batch/rpc-batch-provider.ts b/packages/taquito/src/batch/rpc-batch-provider.ts
index 597b56ea8..54ef4e98a 100644
--- a/packages/taquito/src/batch/rpc-batch-provider.ts
+++ b/packages/taquito/src/batch/rpc-batch-provider.ts
@@ -105,9 +105,8 @@ export class OperationBatch extends OperationEmitter {
       case OpKind.ORIGINATION:
         return createOriginationOperation(
           await this.context.parser.prepareCodeOrigination({
-            ...param,
-          })
-        );
+          ...param,
+        }));
       case OpKind.DELEGATION:
         return createSetDelegateOperation({
           ...param,
@@ -175,26 +174,24 @@ export class OperationBatch extends OperationEmitter {
       i++;
     }
     if (revealNeeded) {
-      const reveal: withKind<RevealParams, OpKind.REVEAL> = { kind: OpKind.REVEAL };
+      const reveal: withKind<RevealParams, OpKind.REVEAL> = { kind: OpKind.REVEAL }
       const estimatedReveal = await this.estimate(reveal, async () => estimates[0]);
-      ops.unshift(await createRevealOperation({ ...estimatedReveal }, publicKeyHash, publicKey));
+      ops.unshift(await createRevealOperation({ ...estimatedReveal }, publicKeyHash, publicKey))
     }
 
     const source = (params && params.source) || publicKeyHash;
-    const prepared = await this.prepareOpAndSimulation({
+    const prepared = await this.prepareOperation({
       operation: ops,
-      source
+      source,
     });
-    const forgedBytes = await this.forge(prepared.preparedOp);
-    const signedOperation = await this.signOperation(forgedBytes);
-    const opResponse = await this.preValidate(prepared, signedOperation);
-    const hash = await this.injectOperation(signedOperation.opbytes);
-    return new BatchOperation(hash, ops, source, forgedBytes, opResponse, this.context.clone());
+    const opBytes = await this.forge(prepared);
+    const { hash, context, forgedBytes, opResponse } = await this.signAndInject(opBytes);
+    return new BatchOperation(hash, ops, source, forgedBytes, opResponse, context);
   }
 }
 
 export class RPCBatchProvider {
-  constructor(private context: Context, private estimator: EstimationProvider) {}
+  constructor(private context: Context, private estimator: EstimationProvider) { }
 
   /***
    *
diff --git a/packages/taquito/src/context.ts b/packages/taquito/src/context.ts
index 52b1f9487..a356e58ce 100644
--- a/packages/taquito/src/context.ts
+++ b/packages/taquito/src/context.ts
@@ -42,7 +42,7 @@ export const defaultConfigConfirmation: Partial<ConfigConfirmation> = {
 export interface ConfigStreamer {
   streamerPollingIntervalMilliseconds?: number;
   shouldObservableSubscriptionRetry?: boolean;
-  observableSubscriptionRetryFunction?: OperatorFunction<any, any>;
+  observableSubscriptionRetryFunction?: OperatorFunction<any,any>;
 }
 
 export const defaultConfigStreamer: Required<ConfigStreamer> = {
@@ -55,7 +55,6 @@ export const defaultConfigStreamer: Required<ConfigStreamer> = {
  * @description Encapsulate common service used throughout different part of the library
  */
 export class Context {
-  private _counters: { [key: string]: number } = {};
   private _rpcClient: RpcClient;
   private _forger: Forger;
   private _parser: ParserProvider;
@@ -79,7 +78,7 @@ export class Context {
     injector?: Injector,
     packer?: Packer,
     wallet?: WalletProvider,
-    parser?: ParserProvider
+    parser?: ParserProvider,
   ) {
     if (typeof this._rpc === 'string') {
       this._rpcClient = new RpcClient(this._rpc);
@@ -91,8 +90,8 @@ export class Context {
     this._injector = injector ? injector : new RpcInjector(this);
     this.operationFactory = new OperationFactory(this);
     this._walletProvider = wallet ? wallet : new LegacyWalletProvider(this);
-    this._parser = parser ? parser : new MichelCodecParser(this);
-    this._packer = packer ? packer : new RpcPacker(this);
+    this._parser = parser? parser: new MichelCodecParser(this);
+    this._packer = packer? packer: new RpcPacker(this);
   }
 
   get config(): Partial<ConfigConfirmation> & Required<ConfigStreamer> {
@@ -171,14 +170,6 @@ export class Context {
     this._packer = value;
   }
 
-  get counters() {
-    return this._counters;
-  }
-
-  set counters(value: { [key: string]: number }) {
-    this._counters[value.key] = value.counter;
-  }
-
   async isAnyProtocolActive(protocol: string[] = []) {
     if (this._proto) {
       return protocol.includes(this._proto);
@@ -202,7 +193,7 @@ export class Context {
         new BigNumber(constants.delay_per_missing_endorsement!)
         .multipliedBy(Math.max(0, constants.initial_endorsers! - constants.endorsers_per_block))
       );
-
+      
       // Divide the polling interval by a constant 3
       // to improvise for polling time to work in prod,
       // testnet and sandbox enviornment.   
@@ -224,7 +215,7 @@ export class Context {
       return defaultInterval;
     }
   }
-
+  
   /**
    * @description Create a copy of the current context. Useful when you have long running operation and you do not want a context change to affect the operation
    */
diff --git a/packages/taquito/src/contract/rpc-contract-provider.ts b/packages/taquito/src/contract/rpc-contract-provider.ts
index 6933f202b..70821c980 100644
--- a/packages/taquito/src/contract/rpc-contract-provider.ts
+++ b/packages/taquito/src/contract/rpc-contract-provider.ts
@@ -32,10 +32,8 @@ import {
 } from './prepare';
 import { smartContractAbstractionSemantic } from './semantic';
 
-export class RpcContractProvider
-  extends OperationEmitter
-  implements ContractProvider, StorageProvider
-{
+export class RpcContractProvider extends OperationEmitter
+  implements ContractProvider, StorageProvider {
   constructor(context: Context, private estimator: EstimationProvider) {
     super(context);
   }
@@ -124,7 +122,7 @@ export class RpcContractProvider
   /**
    *
    * @description Fetch multiple values in a big map
-   * All values will be fetched on the same block level. If a block is specified in the request, the values will be fetched at it.
+   * All values will be fetched on the same block level. If a block is specified in the request, the values will be fetched at it. 
    * Otherwise, a first request will be done to the node to fetch the level of the head and all values will be fetched at this level.
    * If one of the keys does not exist in the big map, its value will be set to undefined.
    *
@@ -182,10 +180,10 @@ export class RpcContractProvider
    * @param block optional block level to fetch the value from
    *
    */
-  async getSaplingDiffByID(id: string, block?: number) {
-    const saplingState = block ? await this.context.rpc.getSaplingDiffById(id.toString(), { block: String(block) }) : await this.context.rpc.getSaplingDiffById(id.toString());
-    return saplingState;
-  }
+ async getSaplingDiffByID(id: string, block?: number) {
+  const saplingState = block? await this.context.rpc.getSaplingDiffById(id.toString(), { block: String(block) }) : await this.context.rpc.getSaplingDiffById(id.toString());
+  return saplingState;
+}
 
   private async addRevealOperationIfNeeded(operation: RPCOperation, publicKeyHash: string){
     if(isOpRequireReveal(operation)){
@@ -218,26 +216,14 @@ export class RpcContractProvider
     const publicKeyHash = await this.signer.publicKeyHash();
     const operation = await createOriginationOperation(
       await this.context.parser.prepareCodeOrigination({
-        ...params,
+      ...params,
       ...estimate,
     }));
     const ops = await this.addRevealOperationIfNeeded(operation, publicKeyHash);
-    const preparedOrigination = await this.prepareOpAndSimulation({
-      operation: ops,
-      source: publicKeyHash
-    });
-    const forgedOrigination = await this.forge(preparedOrigination.preparedOp);
-    const signedOperation = await this.signOperation(forgedOrigination);
-    const opResponse = await this.preValidate(preparedOrigination, signedOperation);
-    const hash = await this.injectOperation(signedOperation.opbytes);
-    return new OriginationOperation(
-      hash,
-      operation,
-      signedOperation,
-      opResponse,
-      this.context.clone(),
-      this
-    );
+    const preparedOrigination = await this.prepareOperation({ operation: ops, source: publicKeyHash });
+    const forgedOrigination = await this.forge(preparedOrigination);
+    const { hash, context, forgedBytes, opResponse } = await this.signAndInject(forgedOrigination);
+    return new OriginationOperation(hash, operation, forgedBytes, opResponse, context, this);
   }
 
   /**
@@ -255,25 +241,23 @@ export class RpcContractProvider
     }
 
     const estimate = await this.estimate(params, this.estimator.setDelegate.bind(this.estimator));
-    const publicKeyHash = await this.signer.publicKeyHash();
+    const publicKeyHash = await this.signer.publicKeyHash()
     const operation = await createSetDelegateOperation({ ...params, ...estimate });
     const sourceOrDefault = params.source || publicKeyHash;
     const ops = await this.addRevealOperationIfNeeded(operation, publicKeyHash);
-    const prepared = await this.prepareOpAndSimulation({
+    const prepared = await this.prepareOperation({
       operation: ops,
-      source: sourceOrDefault
+      source: sourceOrDefault,
     });
-    const opBytes = await this.forge(prepared.preparedOp);
-    const signedOperation = await this.signOperation(opBytes);
-    const opResponse = await this.preValidate(prepared, signedOperation);
-    const hash = await this.injectOperation(signedOperation.opbytes);
+    const opBytes = await this.forge(prepared);
+    const { hash, context, forgedBytes, opResponse } = await this.signAndInject(opBytes);
     return new DelegateOperation(
       hash,
       operation,
       sourceOrDefault,
-      signedOperation,
+      forgedBytes,
       opResponse,
-      this.context.clone()
+      context
     );
   }
 
@@ -293,19 +277,10 @@ export class RpcContractProvider
     const source = await this.signer.publicKeyHash();
     const operation = await createRegisterDelegateOperation({ ...params, ...estimate }, source);
     const ops = await this.addRevealOperationIfNeeded(operation, source);
-    const prepared = await this.prepareOpAndSimulation({ operation: ops, source });
-    const opBytes = await this.forge(prepared.preparedOp);
-    const signedOperation = await this.signOperation(opBytes);
-    const opResponse = await this.preValidate(prepared, signedOperation);
-    const hash = await this.injectOperation(signedOperation.opbytes);
-    return new DelegateOperation(
-      hash,
-      operation,
-      source,
-      signedOperation,
-      opResponse,
-      this.context.clone()
-    );
+    const prepared = await this.prepareOperation({ operation: ops });
+    const opBytes = await this.forge(prepared);
+    const { hash, context, forgedBytes, opResponse } = await this.signAndInject(opBytes);
+    return new DelegateOperation(hash, operation, source, forgedBytes, opResponse, context);
   }
 
   /**
@@ -317,30 +292,18 @@ export class RpcContractProvider
    * @param Transfer operation parameter
    */
   async transfer(params: TransferParams) {
-    const publicKeyHash = await this.signer.publicKeyHash();
+    const publickKeyHash = await this.signer.publicKeyHash();
     const estimate = await this.estimate(params, this.estimator.transfer.bind(this.estimator));
     const operation = await createTransferOperation({
       ...params,
       ...estimate,
     });
-    const source = params.source || publicKeyHash;
-    const ops = await this.addRevealOperationIfNeeded(operation, publicKeyHash);
-    const prepared = await this.prepareOpAndSimulation({
-      operation: ops,
-      source
-    });
-    const forgedOperation = await this.forge(prepared.preparedOp);
-    const signedOperation = await this.signOperation(forgedOperation);
-    const opResponse = await this.preValidate(prepared, signedOperation);
-    const hash = await this.injectOperation(signedOperation.opbytes);
-    return new TransactionOperation(
-      hash,
-      operation,
-      source,
-      signedOperation,
-      opResponse,
-      this.context.clone()
-    );
+    const source = params.source || publickKeyHash;
+    const ops = await this.addRevealOperationIfNeeded(operation, publickKeyHash);
+    const prepared = await this.prepareOperation({ operation: ops, source: params.source });
+    const opBytes = await this.forge(prepared);
+    const { hash, context, forgedBytes, opResponse } = await this.signAndInject(opBytes);
+    return new TransactionOperation(hash, operation, source, forgedBytes, opResponse, context);
   }
 
   /**
@@ -351,40 +314,24 @@ export class RpcContractProvider
    *
    * @param RevealParams operation parameter
    */
-  async reveal(params: RevealParams) {
+  async reveal(params: RevealParams){
     const publicKeyHash = await this.signer.publicKeyHash();
     const estimateReveal = await this.estimator.reveal(params);
-    if (estimateReveal) {
+    if(estimateReveal){
       const estimated = await this.estimate(params, async () => estimateReveal);
-      const operation = await createRevealOperation(
-        {
-          ...estimated,
-        },
-        publicKeyHash,
-        await this.signer.publicKey()
-      );
-      const prepared = await this.prepareOpAndSimulation({ operation, source: publicKeyHash });
-      const opBytes = await this.forge(prepared.preparedOp);
-      const signedOperation = await this.signOperation(opBytes);
-      const opResponse = await this.preValidate(prepared, signedOperation);
-      const hash = await this.injectOperation(signedOperation.opbytes);
-      return new RevealOperation(
-        hash,
-        operation,
-        publicKeyHash,
-        signedOperation,
-        opResponse,
-        this.context.clone()
-      );
+      const operation = await createRevealOperation({
+        ...estimated,
+      }, publicKeyHash, await this.signer.publicKey());
+      const prepared = await this.prepareOperation({ operation, source: publicKeyHash });
+      const opBytes = await this.forge(prepared);
+      const { hash, context, forgedBytes, opResponse } = await this.signAndInject(opBytes);
+      return new RevealOperation(hash, operation, publicKeyHash, forgedBytes, opResponse, context);
     } else {
-      throw new Error('The current address is already revealed.');
+      throw new Error('The current address is already revealed.')
     }
   }
 
-  async at<T extends ContractAbstraction<ContractProvider>>(
-    address: string,
-    contractAbstractionComposer: ContractAbstractionComposer<T> = (x) => x as any
-  ): Promise<T> {
+  async at<T extends ContractAbstraction<ContractProvider>>(address: string, contractAbstractionComposer: ContractAbstractionComposer<T> = x => x as any): Promise<T> {
     const script = await this.rpc.getScript(address);
     const entrypoints = await this.rpc.getEntrypoints(address);
     const blockHeader = await this.rpc.getBlockHeader();
@@ -398,7 +345,7 @@ export class RpcContractProvider
    * @description Batch a group of operation together. Operations will be applied in the order in which they are added to the batch
    *
    * @returns A batch object from which we can add more operation or send a command to execute the batch
-   *
+   * 
    * @param params List of operation to batch together
    */
   batch(params?: ParamsWithKind[]) {
@@ -410,9 +357,7 @@ export class RpcContractProvider
 
     return batch;
   }
+
 }
 
-type ContractAbstractionComposer<T> = (
-  abs: ContractAbstraction<ContractProvider>,
-  context: Context
-) => T;
+type ContractAbstractionComposer<T> = (abs: ContractAbstraction<ContractProvider>, context: Context) => T
diff --git a/packages/taquito/src/contract/rpc-estimate-provider.ts b/packages/taquito/src/contract/rpc-estimate-provider.ts
index ed25c61ed..e5723bd4a 100644
--- a/packages/taquito/src/contract/rpc-estimate-provider.ts
+++ b/packages/taquito/src/contract/rpc-estimate-provider.ts
@@ -1,7 +1,7 @@
 import { PreapplyResponse, RPCRunOperationParam, OpKind } from '@taquito/rpc';
 import BigNumber from 'bignumber.js';
 import { DEFAULT_FEE, DEFAULT_GAS_LIMIT, DEFAULT_STORAGE_LIMIT } from '../constants';
-import { OperationEmitter, SIGNATURE_STUB } from '../operations/operation-emitter';
+import { OperationEmitter } from '../operations/operation-emitter';
 import {
   flattenErrors,
   flattenOperationResult,
@@ -51,6 +51,10 @@ const mergeLimits = (
   };
 };
 
+// RPC requires a signature but does not verify it
+const SIGNATURE_STUB =
+  'edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg';
+
 export class RPCEstimateProvider extends OperationEmitter implements EstimationProvider {
   private readonly ALLOCATION_STORAGE = 257;
   private readonly ORIGINATION_STORAGE = 257;
@@ -139,14 +143,13 @@ export class RPCEstimateProvider extends OperationEmitter implements EstimationP
   }
 
   private async prepareEstimate(params: PrepareOperationParams) {
-    const preparedSimulation = await this.prepareOperationEstimation(params);
-    const opbytes = await this.forgeOperation(preparedSimulation);
+    const prepared = await this.prepareOperation(params);
+    const {
+      opbytes,
+      opOb: { branch, contents },
+    } = await this.forge(prepared);
     let operation: RPCRunOperationParam = {
-      operation: {
-        branch: preparedSimulation.opOb.branch,
-        contents: preparedSimulation.opOb.contents,
-        signature: SIGNATURE_STUB,
-      },
+      operation: { branch, contents, signature: SIGNATURE_STUB },
       chain_id: await this.rpc.getChainId(),
     };
 
@@ -196,10 +199,7 @@ export class RPCEstimateProvider extends OperationEmitter implements EstimationP
     );
     const isRevealNeeded = await this.isRevealOpNeeded([op], pkh);
     const ops = isRevealNeeded ? await this.addRevealOp([op], pkh) : op;
-    const estimateProperties = await this.prepareEstimate({
-      operation: ops,
-      source: pkh,
-    });
+    const estimateProperties = await this.prepareEstimate({ operation: ops, source: pkh });
     if (isRevealNeeded) {
       estimateProperties.shift();
     }
@@ -222,10 +222,7 @@ export class RPCEstimateProvider extends OperationEmitter implements EstimationP
     });
     const isRevealNeeded = await this.isRevealOpNeeded([op], pkh);
     const ops = isRevealNeeded ? await this.addRevealOp([op], pkh) : op;
-    const estimateProperties = await this.prepareEstimate({
-      operation: ops,
-      source: pkh
-    });
+    const estimateProperties = await this.prepareEstimate({ operation: ops, source: pkh });
     if (isRevealNeeded) {
       estimateProperties.shift();
     }
@@ -250,10 +247,7 @@ export class RPCEstimateProvider extends OperationEmitter implements EstimationP
     });
     const isRevealNeeded = await this.isRevealOpNeeded([op], pkh);
     const ops = isRevealNeeded ? await this.addRevealOp([op], pkh) : op;
-    const estimateProperties = await this.prepareEstimate({
-      operation: ops,
-      source: pkh
-    });
+    const estimateProperties = await this.prepareEstimate({ operation: ops, source: pkh });
     if (isRevealNeeded) {
       estimateProperties.shift();
     }
@@ -310,10 +304,7 @@ export class RPCEstimateProvider extends OperationEmitter implements EstimationP
     }
     const isRevealNeeded = await this.isRevealOpNeeded(operations, pkh);
     operations = isRevealNeeded ? await this.addRevealOp(operations, pkh) : operations;
-    const estimateProperties = await this.prepareEstimate({
-      operation: operations,
-      source: pkh
-    });
+    const estimateProperties = await this.prepareEstimate({ operation: operations, source: pkh });
 
     return Estimate.createArrayEstimateInstancesFromProperties(estimateProperties);
   }
@@ -332,10 +323,7 @@ export class RPCEstimateProvider extends OperationEmitter implements EstimationP
     const op = await createRegisterDelegateOperation({ ...params, ...DEFAULT_PARAMS }, pkh);
     const isRevealNeeded = await this.isRevealOpNeeded([op], pkh);
     const ops = isRevealNeeded ? await this.addRevealOp([op], pkh) : op;
-    const estimateProperties = await this.prepareEstimate({
-      operation: ops,
-      source: pkh
-    });
+    const estimateProperties = await this.prepareEstimate({ operation: ops, source: pkh });
     if (isRevealNeeded) {
       estimateProperties.shift();
     }
diff --git a/packages/taquito/src/operations/operation-emitter.ts b/packages/taquito/src/operations/operation-emitter.ts
index 48ef9488c..a933f4794 100644
--- a/packages/taquito/src/operations/operation-emitter.ts
+++ b/packages/taquito/src/operations/operation-emitter.ts
@@ -1,9 +1,8 @@
 import {
+  BlockHeaderResponse,
   OperationContents,
   OperationContentsAndResult,
-  OperationObject,
   OpKind,
-  PreapplyResponse,
   RpcClient,
   RPCRunOperationParam,
 } from '@taquito/rpc';
@@ -18,13 +17,9 @@ import {
   PrepareOperationParams,
   RPCOperation,
   RPCOpWithFee,
-  RPCOpWithSource,
+  RPCOpWithSource
 } from './types';
 
-// RPC requires a signature but does not verify it
-export const SIGNATURE_STUB =
-  'edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg';
-
 export interface PreparedOperation {
   opOb: {
     branch: string;
@@ -34,19 +29,6 @@ export interface PreparedOperation {
   counter: number;
 }
 
-export interface PreparedOperationSimulation {
-  opOb: {
-    branch: string;
-    contents: OperationContents[];
-  };
-  counter: number;
-}
-
-export interface PreparedOpAndSimulation {
-  preparedOp: PreparedOperation;
-  preparedOpSimulation?: PreparedOperationSimulation;
-}
-
 export abstract class OperationEmitter {
   get rpc(): RpcClient {
     return this.context.rpc;
@@ -59,15 +41,13 @@ export abstract class OperationEmitter {
   constructor(protected context: Context) {}
 
   protected async isRevealOpNeeded(op: RPCOperation[] | ParamsWithKind[], pkh: string) {
-    return !(await this.isAccountRevealRequired(pkh)) || !this.isRevealRequiredForOpType(op)
-      ? false
-      : true;
+    return (!await this.isAccountRevealRequired(pkh) || !this.isRevealRequiredForOpType(op)) ? false : true;
   }
 
   protected async isAccountRevealRequired(publicKeyHash: string) {
     const manager = await this.rpc.getManagerKey(publicKeyHash);
-    const haveManager = manager && typeof manager === 'object' ? !!manager.key : !!manager;
-    return !haveManager;
+      const haveManager = manager && typeof manager === 'object' ? !!manager.key : !!manager;
+      return !haveManager;
   }
 
   protected isRevealRequiredForOpType(op: RPCOperation[] | ParamsWithKind[]) {
@@ -78,91 +58,20 @@ export abstract class OperationEmitter {
       }
     }
     return opRequireReveal;
-  }
-
-  private constructOps = (
-    cOps: RPCOperation[],
-    publicKeyHash: string,
-    headCounter: number,
-    counterFunction: (
-      publicKeyHash: string,
-      counter: number,
-      counterScope: { [key: string]: number }
-    ) => { counter: string },
-    source?: string
-  ): OperationContents[] => {
-    const counters = {};
-    // tslint:disable strict-type-predicates
-    return cOps.map((op: RPCOperation) => {
-      switch (op.kind) {
-        case OpKind.ACTIVATION:
-          return {
-            ...op,
-          };
-        case OpKind.REVEAL:
-          return {
-            ...op,
-            ...this.getSource(op, publicKeyHash, source),
-            ...counterFunction(publicKeyHash, headCounter, counters),
-            ...this.getFee(op),
-          };
-        case OpKind.ORIGINATION:
-          return {
-            ...op,
-            balance: typeof op.balance !== 'undefined' ? `${op.balance}` : '0',
-            ...this.getSource(op, publicKeyHash, source),
-            ...counterFunction(publicKeyHash, headCounter, counters),
-            ...this.getFee(op),
-          };
-        case OpKind.TRANSACTION:
-          const cops = {
-            ...op,
-            amount: typeof op.amount !== 'undefined' ? `${op.amount}` : '0',
-            ...this.getSource(op, publicKeyHash, source),
-            ...counterFunction(publicKeyHash, headCounter, counters),
-            ...this.getFee(op),
-          };
-          if (cops.source.toLowerCase().startsWith('kt1')) {
-            throw new Error(
-              `KT1 addresses are not supported as source since ${Protocols.PsBabyM1}`
-            );
-          }
-          return cops;
-        case OpKind.DELEGATION:
-          return {
-            ...op,
-            ...this.getSource(op, publicKeyHash, source),
-            ...counterFunction(publicKeyHash, headCounter, counters),
-            ...this.getFee(op),
-          };
-        default:
-          throw new Error('Unsupported operation');
-      }
-    });
-  };
-
-  private getFee = (op: RPCOpWithFee) => {
-    return {
-      // tslint:disable-next-line: strict-type-predicates
-      fee: typeof op.fee === 'undefined' ? '0' : `${op.fee}`,
-      // tslint:disable-next-line: strict-type-predicates
-      gas_limit: typeof op.gas_limit === 'undefined' ? '0' : `${op.gas_limit}`,
-      // tslint:disable-next-line: strict-type-predicates
-      storage_limit: typeof op.storage_limit === 'undefined' ? '0' : `${op.storage_limit}`,
-    };
   };
 
-  private getSource = (op: RPCOpWithSource, publicKeyHash: string, source?: string) => {
-    return {
-      source: typeof op.source === 'undefined' ? source || publicKeyHash : op.source,
-    };
-  };
-
-  protected async prepareOpAndSimulation({
+  // Originally from sotez (Copyright (c) 2018 Andrew Kishino)
+  protected async prepareOperation({
     operation,
-    source
-  }: PrepareOperationParams): Promise<PreparedOpAndSimulation> {
+    source,
+  }: PrepareOperationParams): Promise<PreparedOperation> {
+    let counter;
+    const counters: { [key: string]: number } = {};
     let ops: RPCOperation[] = [];
+    let head: BlockHeaderResponse;
+
+    const blockHeaderPromise = this.rpc.getBlockHeader();
+    const blockMetaPromise = this.rpc.getBlockMetadata();
 
     if (Array.isArray(operation)) {
       ops = [...operation];
@@ -172,46 +81,6 @@ export abstract class OperationEmitter {
 
     // Implicit account who emit the operation
     const publicKeyHash = await this.signer.publicKeyHash();
-
-    const { counter, hash, protocol } = await this.getCounterHashAndProtocol(ops, publicKeyHash);
-
-    if (!this.context.counters[publicKeyHash] || this.context.counters[publicKeyHash] < counter) {
-      this.context.counters[publicKeyHash] = counter;
-    }
-
-    let preparedOpSimulation;
-    // This is a work around to the counter_in_the_future error returned by the RPC when calling the run_operation
-    // The preparedOpSimulation will be used to prevalidate the operation instead of the preparedOp
-    // The counter of an operation in preparedOpSimulation will be the head counter + 1
-    // The counter in preparedOp will be incremented accordingly if sending many operations in a row by keeping it on the context
-    if (counter !== this.context.counters[publicKeyHash]) {
-      preparedOpSimulation = {
-        opOb: {
-          branch: hash,
-          contents: this.constructOps(ops, publicKeyHash, counter, this.getScopeCounter, source),
-        },
-        counter,
-      };
-    }
-
-    const preparedOp = {
-      opOb: {
-        branch: hash,
-        contents: this.constructOps(ops, publicKeyHash, counter, this.getContextCounter, source),
-        protocol: protocol,
-      },
-      counter,
-    };
-
-    return {
-      preparedOp,
-      preparedOpSimulation,
-    };
-  }
-
-  private async getCounterHashAndProtocol(ops: RPCOperation[], publicKeyHash: string) {
-    const blockHeaderPromise = this.rpc.getBlockHeader();
-    const blockMetaPromise = this.rpc.getBlockMetadata();
     let counterPromise: Promise<string | undefined> = Promise.resolve(undefined);
 
     for (let i = 0; i < ops.length; i++) {
@@ -225,7 +94,7 @@ export abstract class OperationEmitter {
     const [header, metadata, headCounter] = await Promise.all([
       blockHeaderPromise,
       blockMetaPromise,
-      counterPromise,
+      counterPromise
     ]);
 
     if (!header) {
@@ -236,95 +105,92 @@ export abstract class OperationEmitter {
       throw new Error('Unable to fetch latest metadata');
     }
 
-    const counter = parseInt(headCounter || '0', 10);
-    return {
-      counter,
-      hash: header.hash,
-      protocol: metadata.next_protocol,
-    };
-  }
+    head = header;
 
-  private getContextCounter = (publicKeyHash: string, headCounter: number) => {
-    if (
-      !this.context.counters[publicKeyHash] ||
-      this.context.counters[publicKeyHash] < headCounter
-    ) {
-      this.context.counters[publicKeyHash] = headCounter;
+    counter = parseInt(headCounter || '0', 10);
+    if (!counters[publicKeyHash] || counters[publicKeyHash] < counter) {
+      counters[publicKeyHash] = counter;
     }
-    const opCounter = ++this.context.counters[publicKeyHash];
-    return {
-      counter: `${opCounter}`,
-    };
-  };
 
-  private getScopeCounter = (
-    publicKeyHash: string,
-    headCounter: number,
-    countersScope: { [key: string]: number }
-  ) => {
-    if (!countersScope[publicKeyHash] || countersScope[publicKeyHash] < headCounter) {
-      countersScope[publicKeyHash] = headCounter;
-    }
-    return {
-      counter: `${++countersScope[publicKeyHash]}`,
+    const getFee = (op: RPCOpWithFee) => {
+      const opCounter = ++counters[publicKeyHash];
+      return {
+        counter: `${opCounter}`,
+        // tslint:disable-next-line: strict-type-predicates
+        fee: typeof op.fee === 'undefined' ? '0' : `${op.fee}`,
+        // tslint:disable-next-line: strict-type-predicates
+        gas_limit: typeof op.gas_limit === 'undefined' ? '0' : `${op.gas_limit}`,
+        // tslint:disable-next-line: strict-type-predicates
+        storage_limit: typeof op.storage_limit === 'undefined' ? '0' : `${op.storage_limit}`,
+      };
     };
-  };
-
-  protected async prepareOperationEstimation({
-    operation,
-    source
-  }: PrepareOperationParams): Promise<PreparedOperationSimulation> {
-    const countersScope: { [key: string]: number } = {};
-    let ops: RPCOperation[] = [];
 
-    if (Array.isArray(operation)) {
-      ops = [...operation];
-    } else {
-      ops = [operation];
-    }
-
-    const publicKeyHash = source? source: await this.signer.publicKeyHash();
-
-    const { counter, hash } = await this.getCounterHashAndProtocol(ops, publicKeyHash);
+    const getSource = (op: RPCOpWithSource) => {
+      return {
+        source: typeof op.source === 'undefined' ? source || publicKeyHash : op.source,
+      };
+    };
 
-    if (!countersScope[publicKeyHash] || countersScope[publicKeyHash] < counter) {
-      countersScope[publicKeyHash] = counter;
-    }
+    const constructOps = (cOps: RPCOperation[]): OperationContents[] =>
+      // tslint:disable strict-type-predicates
+      cOps.map((op: RPCOperation) => {
+        switch (op.kind) {
+          case OpKind.ACTIVATION:
+            return {
+              ...op,
+            };
+          case OpKind.REVEAL:
+            return {
+              ...op,
+              ...getSource(op),
+              ...getFee(op),
+            };
+          case OpKind.ORIGINATION:
+            return {
+              ...op,
+              balance: typeof op.balance !== 'undefined' ? `${op.balance}` : '0',
+              ...getSource(op),
+              ...getFee(op),
+            };
+          case OpKind.TRANSACTION:
+            const cops = {
+              ...op,
+              amount: typeof op.amount !== 'undefined' ? `${op.amount}` : '0',
+              ...getSource(op),
+              ...getFee(op),
+            };
+            if (cops.source.toLowerCase().startsWith('kt1')) {
+              throw new Error(
+                `KT1 addresses are not supported as source since ${Protocols.PsBabyM1}`
+              );
+            }
+            return cops;
+          case OpKind.DELEGATION:
+            return {
+              ...op,
+              ...getSource(op),
+              ...getFee(op),
+            };
+          default:
+            throw new Error('Unsupported operation');
+        }
+      });
+
+    const branch = head.hash;
+    const contents = constructOps(ops);
+    const protocol = metadata.next_protocol;
 
     return {
       opOb: {
-        branch: hash,
-        contents: this.constructOps(ops, publicKeyHash, counter, this.getScopeCounter, source),
+        branch,
+        contents,
+        protocol,
       },
       counter,
     };
   }
 
-  protected async preValidate(prepared: PreparedOpAndSimulation, forgedOperation: ForgedBytes) {
-    return prepared.preparedOpSimulation
-      ? // If we want to inject many operations in a same block
-        // we call runOperation instead of preapply
-        // to avoid having to produce 2 signatures (op with incremented counter and op used for simulation)
-        this.runOperation({
-          operation: {
-            signature: SIGNATURE_STUB,
-            ...prepared.preparedOpSimulation.opOb,
-          },
-          chain_id: await this.rpc.getChainId(),
-        })
-      : this.preapplyOperation(forgedOperation.opOb);
-  }
-
-  protected async forgeOperation({
-    opOb: { branch, contents },
-  }: PreparedOperation | PreparedOperationSimulation) {
-    return this.context.forger.forge({ branch, contents });
-  }
-
-  protected async forge({
-    opOb: { branch, contents, protocol },
-    counter,
-  }: PreparedOperation): Promise<ForgedBytes> {
+  protected async forge({ opOb: { branch, contents, protocol }, counter }: PreparedOperation) {
     let forgedBytes = await this.context.forger.forge({ branch, contents });
 
     return {
@@ -377,33 +243,13 @@ export abstract class OperationEmitter {
     };
   }
 
-  protected async signOperation(forgedBytes: ForgedBytes) {
+  protected async signAndInject(forgedBytes: ForgedBytes) {
     const signed = await this.signer.sign(forgedBytes.opbytes, new Uint8Array([3]));
     forgedBytes.opbytes = signed.sbytes;
     forgedBytes.opOb.signature = signed.prefixSig;
-    return forgedBytes;
-  }
-
-  protected async runOperation(op: RPCRunOperationParam) {
-    const opResponse: OperationContentsAndResult[] = [];
-    const results = await this.rpc.runOperation(op);
-
-    for (let j = 0; j < results.contents.length; j++) {
-      opResponse.push(results.contents[j]);
-    }
-    const errors = flattenErrors(results);
 
-    if (errors.length) {
-      // @ts-ignore
-      throw new TezosOperationError(errors);
-    }
-
-    return opResponse;
-  }
-
-  protected async preapplyOperation(opOb: OperationObject) {
     const opResponse: OperationContentsAndResult[] = [];
-    const results = await this.rpc.preapplyOperations([opOb]);
+    const results = await this.rpc.preapplyOperations([forgedBytes.opOb]);
 
     if (!Array.isArray(results)) {
       throw new TezosPreapplyFailureError(results);
@@ -421,10 +267,12 @@ export abstract class OperationEmitter {
       // @ts-ignore
       throw new TezosOperationError(errors);
     }
-    return opResponse;
-  }
 
-  protected async injectOperation(signedOperationBytes: string) {
-    return this.context.injector.inject(signedOperationBytes);
+    return {
+      hash: await this.context.injector.inject(forgedBytes.opbytes),
+      forgedBytes,
+      opResponse,
+      context: this.context.clone(),
+    };
   }
 }
diff --git a/packages/taquito/src/operations/types.ts b/packages/taquito/src/operations/types.ts
index 38751ecfe..02f5e8fc1 100644
--- a/packages/taquito/src/operations/types.ts
+++ b/packages/taquito/src/operations/types.ts
@@ -15,7 +15,9 @@ export type ParamsWithKind =
   | withKind<TransferParams, OpKind.TRANSACTION>
   | withKind<ActivationParams, OpKind.ACTIVATION>;
 
-export type ParamsWithKindExtended = ParamsWithKind | withKind<RevealParams, OpKind.REVEAL>;
+export type ParamsWithKindExtended =
+  | ParamsWithKind
+  | withKind<RevealParams, OpKind.REVEAL>
 
 export const attachKind = <T, K extends OpKind>(op: T, kind: K) => {
   return { ...op, kind } as withKind<T, K>;
@@ -26,7 +28,7 @@ export const findWithKind = <T extends { kind: OpKind }, K extends OpKind>(
   kind: K
 ): (T & { kind: K }) | undefined => {
   if (Array.isArray(arr)) {
-    const found = arr.find((op) => op.kind === kind);
+    const found = arr.find(op => op.kind === kind);
 
     if (found && isKind(found, kind)) {
       return found;
@@ -129,15 +131,15 @@ export type OriginateParamsBase = {
 export type OriginateParams = OriginateParamsBase &
   (
     | {
-        init?: never;
-        /** JS representation of a storage object */
-        storage: any;
-      }
+      init?: never;
+      /** JS representation of a storage object */
+      storage: any;
+    }
     | {
-        /** Initial storage object value. Either Micheline or JSON encoded */
-        init: string | object;
-        storage?: never;
-      }
+      /** Initial storage object value. Either Micheline or JSON encoded */
+      init: string | object;
+      storage?: never;
+    }
   );
 
 export interface ActivationParams {
@@ -180,6 +182,7 @@ export interface RevealParams {
   storageLimit?: number;
 }
 
+
 /**
  * @description Result of a forge operation contains the operation plus its encoded version
  */
diff --git a/packages/taquito/src/tz/rpc-tz-provider.ts b/packages/taquito/src/tz/rpc-tz-provider.ts
index e249b76a0..fe64dc5bb 100644
--- a/packages/taquito/src/tz/rpc-tz-provider.ts
+++ b/packages/taquito/src/tz/rpc-tz-provider.ts
@@ -26,11 +26,8 @@ export class RpcTzProvider extends OperationEmitter implements TzProvider {
       secret,
     };
 
-    const prepared = await this.prepareOpAndSimulation({
-      operation: [operation],
-      source: pkh
-    });
-    const forgedBytes = await this.forge(prepared.preparedOp);
+    const prepared = await this.prepareOperation({ operation: [operation], source: pkh });
+    const forgedBytes = await this.forge(prepared);
     const bytes = `${forgedBytes.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;
     return new Operation(
       await this.rpc.injectOperation(bytes),


Test patch:
diff --git a/integration-tests/contract-send-multiple-tx-in-a-block.spec.ts b/integration-tests/contract-send-multiple-tx-in-a-block.spec.ts
deleted file mode 100644
index f69200029..000000000
--- a/integration-tests/contract-send-multiple-tx-in-a-block.spec.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-import { importKey } from '@taquito/signer';
-import { OpKind } from '@taquito/taquito';
-import { CONFIGS } from './config';
-import { booleanCode } from './data/boolean_parameter';
-
-CONFIGS().forEach(({ lib, rpc, setup, knownContract }) => {
-  const Tezos = lib;
-
-  describe(`Test send more than 1 tx in the same block: ${rpc}`, () => {
-    beforeEach(async (done) => {
-      await setup();
-      // temporarily use a faucet key waiting to update the keygen
-      await importKey(
-        Tezos,
-        'peqjckge.qkrrajzs@tezos.example.org',
-        'y4BX7qS1UE',
-        [
-          'skate',
-          'damp',
-          'faculty',
-          'morning',
-          'bring',
-          'ridge',
-          'traffic',
-          'initial',
-          'piece',
-          'annual',
-          'give',
-          'say',
-          'wrestle',
-          'rare',
-          'ability'
-        ].join(' '),
-        '7d4c8c3796fdbf4869edb5703758f0e5831f5081'
-      );
-      done();
-    });
-    it('send multiple operations in a block using the contract api', async (done) => {
-      const contract = await Tezos.contract.at(knownContract);
-
-      const op1 = await Tezos.contract.transfer({
-        to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu',
-        amount: 2,
-        gasLimit: 1527,
-        fee: 443,
-        storageLimit: 0
-      });
-
-      const op2 = await Tezos.contract.transfer({ to: 'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY', amount: 2 });
-      
-      const op3 = await Tezos.contract.transfer({
-        to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu',
-        amount: 1,
-        gasLimit: 1527,
-        fee: 480,
-        storageLimit: 0
-      });
-      
-      const op4 = await Tezos.contract.originate({
-        balance: '1',
-        code: booleanCode,
-        storage: true
-      });
-      
-      const op5 = await Tezos.contract.originate({
-        balance: '1',
-        code: booleanCode,
-        storage: true,
-        fee: 150000,
-        storageLimit: 10000,
-        gasLimit: 400000
-      });
-      
-      const op6 = await Tezos.contract
-        .batch([
-          {
-            kind: OpKind.TRANSACTION,
-            to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu',
-            amount: 2,
-            gasLimit: 1527,
-            fee: 442,
-            storageLimit: 0
-          },
-          { kind: OpKind.TRANSACTION, to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu', amount: 2 },
-          { kind: OpKind.TRANSACTION, ...contract.methods.default([['Unit']]).toTransferParams() }
-        ])
-        .send();
-
-      await Promise.all([
-        op1.confirmation(),
-        op2.confirmation(),
-        op3.confirmation(),
-        op4.confirmation(),
-        op5.confirmation(),
-        op6.confirmation()
-      ]);
-
-      expect(op1.status).toBe('applied');
-      expect(op2.status).toBe('applied');
-      expect(op3.status).toBe('applied');
-      expect(op4.status).toBe('applied');
-      expect(op5.status).toBe('applied');
-      expect(op6.status).toBe('applied');
-
-      done();
-    });
-  });
-});
diff --git a/integration-tests/wallet-send-multiple-tx-in-a-block.spec.ts b/integration-tests/wallet-send-multiple-tx-in-a-block.spec.ts
deleted file mode 100644
index 820f85a29..000000000
--- a/integration-tests/wallet-send-multiple-tx-in-a-block.spec.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import { OpKind } from "@taquito/taquito";
-import { importKey } from "@taquito/signer";
-import { CONFIGS } from "./config";
-import { booleanCode } from "./data/boolean_parameter";
-
-CONFIGS().forEach(({ lib, rpc, setup, knownContract }) => {
-    const Tezos = lib;
-
-    describe(`Test send more than 1 tx in the same block: ${rpc}`, () => {
-
-        beforeEach(async (done) => {
-            await setup()
-            // temporarily use a faucet key waiting to update the keygen
-            await importKey(
-                Tezos,
-                'oeqmgekb.yidlohon@tezos.example.org',
-                'CH7w7xY62N',
-                [
-                    "now",
-                    "device",
-                    "cost",
-                    "dance",
-                    "depend",
-                    "picture",
-                    "fatal",
-                    "smile",
-                    "blast",
-                    "leader",
-                    "push",
-                    "famous",
-                    "health",
-                    "evolve",
-                    "orange"
-                ].join(' '),
-                '929737d82bcbfb2ff53daef282dcf70a2f3400e2'
-            );
-
-            done()
-        })
-
-        it('send multiple operations in a block using the contract api', async (done) => {
-            const contract = await Tezos.wallet.at(knownContract);
-
-            const op1 = await Tezos.wallet.transfer({
-                to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu',
-                amount: 2,
-                gasLimit: 1527,
-                fee: 443,
-                storageLimit: 0
-            }).send();
-
-            const op2 = await Tezos.wallet.transfer({ to: 'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY', amount: 2 }).send();
-
-            const op3 = await Tezos.wallet.transfer({
-                to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu',
-                amount: 1,
-                gasLimit: 1527,
-                fee: 480,
-                storageLimit: 0
-            }).send();
-
-            const op4 = await Tezos.wallet.originate({
-                balance: '1',
-                code: booleanCode,
-                storage: true
-            }).send();
-
-            const op5 = await Tezos.wallet.originate({
-                balance: '1',
-                code: booleanCode,
-                storage: true,
-                fee: 150000,
-                storageLimit: 10000,
-                gasLimit: 400000
-            }).send();
-
-            const op6 = await Tezos.wallet
-                .batch([
-                    {
-                        kind: OpKind.TRANSACTION,
-                        to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu',
-                        amount: 2,
-                        gasLimit: 1527,
-                        fee: 442,
-                        storageLimit: 0
-                    },
-                    { kind: OpKind.TRANSACTION, to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu', amount: 2 },
-                    { kind: OpKind.TRANSACTION, ...contract.methods.default([['Unit']]).toTransferParams() }
-                ]).send();
-
-            await Promise.all([
-                op1.confirmation(),
-                op2.confirmation(),
-                op3.confirmation(),
-                op4.confirmation(),
-                op5.confirmation(),
-                op6.confirmation()
-            ]);
-
-            expect(op1.opHash).toBeDefined();
-            expect(op2.opHash).toBeDefined();
-            expect(op3.opHash).toBeDefined();
-            expect(op4.opHash).toBeDefined();
-            expect(op5.opHash).toBeDefined();
-            expect(op6.opHash).toBeDefined();
-
-            done();
-        });
-    });
-})
diff --git a/packages/taquito/test/contract/rpc-contract-provider.spec.ts b/packages/taquito/test/contract/rpc-contract-provider.spec.ts
index dfbc728c2..7117848ed 100644
--- a/packages/taquito/test/contract/rpc-contract-provider.spec.ts
+++ b/packages/taquito/test/contract/rpc-contract-provider.spec.ts
@@ -23,11 +23,7 @@ import {
   DEFAULT_FEE,
   DEFAULT_GAS_LIMIT,
 } from '../../src/constants';
-import {
-  InvalidCodeParameter,
-  InvalidDelegationSource,
-  InvalidInitParameter,
-} from '../../src/contract/errors';
+import { InvalidCodeParameter, InvalidDelegationSource, InvalidInitParameter } from '../../src/contract/errors';
 import { preapplyResultFrom } from './helper';
 import { MichelsonMap, Schema } from '@taquito/michelson-encoder';
 import { BigMapAbstraction } from '../../src/contract/big-map';
@@ -58,7 +54,6 @@ describe('RpcContractProvider test', () => {
     preapplyOperations: jest.Mock<any, any>;
     getChainId: jest.Mock<any, any>;
     getSaplingDiffById: jest.Mock<any, any>;
-    runOperation: jest.Mock<any, any>;
   };
 
   let mockSigner: {
@@ -105,8 +100,7 @@ describe('RpcContractProvider test', () => {
       packData: jest.fn(),
       preapplyOperations: jest.fn(),
       getChainId: jest.fn(),
-      getSaplingDiffById: jest.fn(),
-      runOperation: jest.fn(),
+      getSaplingDiffById: jest.fn()
     };
 
     mockSigner = {
@@ -121,7 +115,7 @@ describe('RpcContractProvider test', () => {
       registerDelegate: jest.fn(),
       setDelegate: jest.fn(),
       batch: jest.fn(),
-      reveal: jest.fn(),
+      reveal: jest.fn()
     };
 
     // Required for operations confirmation polling
@@ -158,7 +152,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('getStorage', () => {
-    it('should call getStorage', async (done) => {
+    it('should call getStorage', async done => {
       mockRpcClient.getScript.mockResolvedValue({ code: [sample] });
       mockRpcClient.getStorage.mockResolvedValue(sampleStorage);
       const result = await rpcContractProvider.getStorage('test');
@@ -173,7 +167,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('getBigMapKey', () => {
-    it('should call getBigMapKey', async (done) => {
+    it('should call getBigMapKey', async done => {
       mockRpcClient.getScript.mockResolvedValue({ code: [sample] });
       mockRpcClient.getBigMapKey.mockResolvedValue(sampleBigMapValue);
       // tslint:disable-next-line: deprecation
@@ -199,114 +193,114 @@ describe('RpcContractProvider test', () => {
     });
   });
 
-  describe('getBigMapKeyByID', () => {
-    it('should call getBigMapKeyByID', async (done) => {
+  describe("getBigMapKeyByID", () => {
+    it("should call getBigMapKeyByID", async (done) => {
       mockRpcClient.packData.mockResolvedValue({
-        packed: '050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+        packed: "050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValue({ int: '3' });
+      mockRpcClient.getBigMapExpr.mockResolvedValue({ int: "3" });
 
       const result = await rpcContractProvider.getBigMapKeyByID(
-        '133',
-        'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
+        "133",
+        "tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn",
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         })
       );
       expect(result).toEqual(new BigNumber(3));
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+          bytes: "000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic'
+        "expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][2]).toBeUndefined();
       done();
     });
 
-    it('should call getBigMapKeyByID when a block level is specified', async (done) => {
+    it("should call getBigMapKeyByID when a block level is specified", async (done) => {
       mockRpcClient.packData.mockResolvedValue({
-        packed: '050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+        packed: "050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValue({ int: '3' });
+      mockRpcClient.getBigMapExpr.mockResolvedValue({ int: "3" });
 
       const result = await rpcContractProvider.getBigMapKeyByID(
-        '133',
-        'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
+        "133",
+        "tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn",
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         }),
         123456
       );
       expect(result).toEqual(new BigNumber(3));
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+          bytes: "000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic'
+        "expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
       done();
     });
   });
 
-  describe('getBigMapKeysByID', () => {
-    it('should call getBigMapKeysByID', async (done) => {
+  describe("getBigMapKeysByID", () => {
+    it("should call getBigMapKeysByID", async (done) => {
       mockRpcClient.getBlock.mockResolvedValue({ header: { level: 123456 } });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+        packed: "050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '3' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "3" });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+        packed: "050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '7' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "7" });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a00000016000002298c03ed7d454a101eb7022bc95f7e5f41ac78',
+        packed: "050a00000016000002298c03ed7d454a101eb7022bc95f7e5f41ac78",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '6' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "6" });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a000000160000eadc0855adb415fa69a76fc10397dc2fb37039a0',
+        packed: "050a000000160000eadc0855adb415fa69a76fc10397dc2fb37039a0",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '5' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "5" });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a000000160000cf49f66b9ea137e11818f2a78b4b6fc9895b4e50',
+        packed: "050a000000160000cf49f66b9ea137e11818f2a78b4b6fc9895b4e50",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '4' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "4" });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a0000001600001bc28a6b8fb2fb6af99fe3bba054e614539e5f12',
+        packed: "050a0000001600001bc28a6b8fb2fb6af99fe3bba054e614539e5f12",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '1' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "1" });
 
       const result = await rpcContractProvider.getBigMapKeysByID(
-        '133',
+        "133",
         [
-          'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
-          'tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN',
-          'tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx',
-          'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY',
-          'tz1eY5Aqa1kXDFoiebL28emyXFoneAoVg1zh',
-          'tz1NAozDvi5e7frVq9cUaC3uXQQannemB8Jw',
+          "tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn",
+          "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
+          "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx",
+          "tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY",
+          "tz1eY5Aqa1kXDFoiebL28emyXFoneAoVg1zh",
+          'tz1NAozDvi5e7frVq9cUaC3uXQQannemB8Jw'
         ],
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         })
       );
       expect(result.get('tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn')).toEqual(new BigNumber(3));
@@ -318,102 +312,102 @@ describe('RpcContractProvider test', () => {
 
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+          bytes: "000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[1][0]).toEqual({
         data: {
-          bytes: '0000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+          bytes: "0000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[2][0]).toEqual({
         data: {
-          bytes: '000002298c03ed7d454a101eb7022bc95f7e5f41ac78',
+          bytes: "000002298c03ed7d454a101eb7022bc95f7e5f41ac78",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[3][0]).toEqual({
         data: {
-          bytes: '0000eadc0855adb415fa69a76fc10397dc2fb37039a0',
+          bytes: "0000eadc0855adb415fa69a76fc10397dc2fb37039a0",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[4][0]).toEqual({
         data: {
-          bytes: '0000cf49f66b9ea137e11818f2a78b4b6fc9895b4e50',
+          bytes: "0000cf49f66b9ea137e11818f2a78b4b6fc9895b4e50",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[5][0]).toEqual({
         data: {
-          bytes: '00001bc28a6b8fb2fb6af99fe3bba054e614539e5f12',
+          bytes: "00001bc28a6b8fb2fb6af99fe3bba054e614539e5f12",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic'
+        "expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[1][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[1][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[1][1]).toEqual(
-        'exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7'
+        "exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[1][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[2][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[2][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[2][1]).toEqual(
-        'expruH3qgknRBJVLVkwdzf6wfBxd7Y1uqNxr7zuMFxTC12e5PacLfv'
+        "expruH3qgknRBJVLVkwdzf6wfBxd7Y1uqNxr7zuMFxTC12e5PacLfv"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[2][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[3][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[3][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[3][1]).toEqual(
-        'exprvEVwRjW3or3tGBSmpyXeqxzzp6XSJGRiKdxV5W1m4s5CceC83b'
+        "exprvEVwRjW3or3tGBSmpyXeqxzzp6XSJGRiKdxV5W1m4s5CceC83b"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[3][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[4][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[4][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[4][1]).toEqual(
-        'exprvPo6agtDv551oeRrjSDcETVHBi8TkRvFy7W6f3fGvygU6Un8NX'
+        "exprvPo6agtDv551oeRrjSDcETVHBi8TkRvFy7W6f3fGvygU6Un8NX"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[4][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[5][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[5][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[5][1]).toEqual(
-        'exprtzAeDbQY935rEquwCdbZaaTYgXttwjkBNAVkRGck1EY6smmFUF'
+        "exprtzAeDbQY935rEquwCdbZaaTYgXttwjkBNAVkRGck1EY6smmFUF"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[5][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
 
       done();
     });
 
-    it('getBigMapKeysByID should set value to undefined for key that does not exist', async (done) => {
+    it("getBigMapKeysByID should set value to undefined for key that does not exist", async (done) => {
       mockRpcClient.getBlock.mockResolvedValue({ header: { level: 123456 } });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+        packed: "050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
       });
       const expectedError = new HttpResponseError(
         'fail',
@@ -424,19 +418,19 @@ describe('RpcContractProvider test', () => {
       );
       mockRpcClient.getBigMapExpr.mockRejectedValueOnce(expectedError);
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+        packed: "050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '3' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "3" });
 
       const result = await rpcContractProvider.getBigMapKeysByID(
-        '133',
+        "133",
         [
-          'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn', // this is not a key of the big map
-          'tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN',
+          "tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn", // this is not a key of the big map
+          "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
         ],
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         })
       );
       expect(result.get('tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn')).toBeUndefined();
@@ -444,53 +438,56 @@ describe('RpcContractProvider test', () => {
 
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+          bytes: "000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[1][0]).toEqual({
         data: {
-          bytes: '0000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+          bytes: "0000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic'
+        "expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[1][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[1][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[1][1]).toEqual(
-        'exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7'
+        "exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[1][2]).toEqual({
-        block: '123456',
+        block: "123456",
       });
       done();
     });
 
     it("getBigMapKeysByID should accept a level has a parameter and don't fetch the level form the rpc", async (done) => {
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+        packed: "050a00000016000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '34' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "34" });
       mockRpcClient.packData.mockResolvedValueOnce({
-        packed: '050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+        packed: "050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: '3' });
+      mockRpcClient.getBigMapExpr.mockResolvedValueOnce({ int: "3" });
 
       const result = await rpcContractProvider.getBigMapKeysByID(
-        '133',
-        ['tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn', 'tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN'],
+        "133",
+        [
+          "tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn",
+          "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
+        ],
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         }),
         654321
       );
@@ -500,40 +497,40 @@ describe('RpcContractProvider test', () => {
       expect(mockRpcClient.getBlock.mock.calls[0]).toBeUndefined();
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '000035e993d8c7aaa42b5e3ccd86a33390ececc73abd',
+          bytes: "000035e993d8c7aaa42b5e3ccd86a33390ececc73abd",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
       expect(mockRpcClient.packData.mock.calls[1][0]).toEqual({
         data: {
-          bytes: '0000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+          bytes: "0000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic'
+        "expruc6BZL8Lz2pipLAwGEqGwUjbdMzbVikNvD589fhVf4tKSG58ic"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][2]).toEqual({
-        block: '654321',
+        block: "654321",
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[1][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[1][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[1][1]).toEqual(
-        'exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7'
+        "exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7"
       );
       expect(mockRpcClient.getBigMapExpr.mock.calls[1][2]).toEqual({
-        block: '654321',
+        block: "654321",
       });
       done();
     });
 
-    it('getBigMapKeysByID should set value to undefined if only 1 key to fetch and that it does not exist', async (done) => {
+    it("getBigMapKeysByID should set value to undefined if only 1 key to fetch and that it does not exist", async (done) => {
       mockRpcClient.packData.mockResolvedValue({
-        packed: '050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+        packed: "050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
       });
       const expectedError = new HttpResponseError(
         'fail',
@@ -545,11 +542,13 @@ describe('RpcContractProvider test', () => {
       mockRpcClient.getBigMapExpr.mockRejectedValue(expectedError);
 
       const result = await rpcContractProvider.getBigMapKeysByID(
-        '133',
-        ['tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN'],
+        "133",
+        [
+          "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
+        ],
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         })
       );
 
@@ -558,31 +557,33 @@ describe('RpcContractProvider test', () => {
       expect(mockRpcClient.getBlock.mock.calls[0]).toBeUndefined();
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '0000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+          bytes: "0000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7'
+        "exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7"
       );
       done();
     });
 
-    it('getBigMapKeysByID should not call getBlock when there is only 1 key to fetch', async (done) => {
+    it("getBigMapKeysByID should not call getBlock when there is only 1 key to fetch", async (done) => {
       mockRpcClient.packData.mockResolvedValue({
-        packed: '050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+        packed: "050a000000160000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
       });
-      mockRpcClient.getBigMapExpr.mockResolvedValue({ int: '3' });
+      mockRpcClient.getBigMapExpr.mockResolvedValue({ int: "3" });
 
       const result = await rpcContractProvider.getBigMapKeysByID(
-        '133',
-        ['tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN'],
+        "133",
+        [
+          "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
+        ],
         new Schema({
-          prim: 'big_map',
-          args: [{ prim: 'address' }, { prim: 'nat' }],
+          prim: "big_map",
+          args: [{ prim: "address" }, { prim: "nat" }],
         })
       );
 
@@ -591,69 +592,57 @@ describe('RpcContractProvider test', () => {
       expect(mockRpcClient.getBlock.mock.calls[0]).toBeUndefined();
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          bytes: '0000e7670f32038107a59a2b9cfefae36ea21f5aa63c',
+          bytes: "0000e7670f32038107a59a2b9cfefae36ea21f5aa63c",
         },
         type: {
-          prim: 'bytes',
+          prim: "bytes",
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7'
+        "exprvPCPwzweu2FnFYTpZJoAM2vEWmPtHDXvsvNsrsKM6ZHMzeahE7"
       );
       done();
     });
 
-    it('getBigMapKeysByID with a pair as key and a pair as value', async (done) => {
+    it("getBigMapKeysByID with a pair as key and a pair as value", async (done) => {
       mockRpcClient.packData.mockResolvedValue({
-        packed: '0507070100000005746573743201000000057465737433',
-      });
-      mockRpcClient.getBigMapExpr.mockResolvedValue({
-        prim: 'Pair',
-        args: [{ int: '2' }, { string: '3' }],
+        packed: "0507070100000005746573743201000000057465737433",
       });
+      mockRpcClient.getBigMapExpr.mockResolvedValue({ prim: "Pair", args: [{ int: "2" }, { string: "3" }] });
 
       const result = await rpcContractProvider.getBigMapKeysByID(
-        '133',
-        [{ test: 'test2', test2: 'test3' }],
+        "133",
+        [
+          { 'test': 'test2', 'test2': 'test3' },
+        ],
         new Schema({
-          prim: 'big_map',
-          args: [
-            {
-              prim: 'pair',
-              args: [
-                { prim: 'string', annots: ['%test'] },
-                { prim: 'string', annots: ['%test2'] },
-              ],
-            },
-            { prim: 'pair', args: [{ prim: 'int' }, { prim: 'int' }] },
-          ],
+          prim: "big_map",
+          args: [{ "prim": "pair", "args": [{ "prim": "string", annots: ["%test"] }, { "prim": "string", annots: ["%test2"] }] }, { "prim": "pair", "args": [{ "prim": "int" }, { "prim": "int" }] }],
         })
       );
-      expect(result.has({ test: 'test2', test2: 'test3' })).toBeTruthy();
-      expect(result.get({ test: 'test2', test2: 'test3' })).toEqual({
+      expect(result.has({ 'test': 'test2', 'test2': 'test3' })).toBeTruthy();
+      expect(result.get({ 'test': 'test2', 'test2': 'test3' })).toEqual({
         0: new BigNumber(2),
-        1: new BigNumber(3),
+        1: new BigNumber(3)
       });
       expect(mockRpcClient.getBlock.mock.calls[0]).toBeUndefined();
       expect(mockRpcClient.packData.mock.calls[0][0]).toEqual({
         data: {
-          prim: 'Pair',
-          args: [{ string: 'test2' }, { string: 'test3' }],
+          prim: "Pair", args: [{ string: "test2" }, { string: "test3" }]
         },
         type: {
-          prim: 'pair',
-          args: [{ prim: 'string' }, { prim: 'string' }],
+          prim: "pair", args: [{ prim: "string" }, { prim: "string" }]
         },
       });
-      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual('133');
+      expect(mockRpcClient.getBigMapExpr.mock.calls[0][0]).toEqual("133");
       expect(mockRpcClient.getBigMapExpr.mock.calls[0][1]).toEqual(
-        'exprteZPr9h8pkyKKw9PMFEXqG1jbMBkj4A2KC9Mp5cAAjSrDWvfXs'
+        "exprteZPr9h8pkyKKw9PMFEXqG1jbMBkj4A2KC9Mp5cAAjSrDWvfXs"
       );
       done();
     });
 
-    it('getBigMapKeysByID unexpected exception', async (done) => {
+    it("getBigMapKeysByID unexpected exception", async (done) => {
       mockRpcClient.getBlock.mockResolvedValue({ header: { level: 123456 } });
       const expectedError = new HttpResponseError(
         'fail',
@@ -666,13 +655,16 @@ describe('RpcContractProvider test', () => {
 
       try {
         await rpcContractProvider.getBigMapKeysByID(
-          '133',
-          ['tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn', 'tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN'],
+          "133",
+          [
+            "tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn",
+            "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
+          ],
           new Schema({
-            prim: 'big_map',
-            args: [{ prim: 'address' }, { prim: 'nat' }],
+            prim: "big_map",
+            args: [{ prim: "address" }, { prim: "nat" }],
           })
-        );
+        )
       } catch (err) {
         expect(err).toBeInstanceOf(HttpResponseError);
       }
@@ -681,7 +673,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('BigMapAbstraction', () => {
-    it('returns undefined on bad key in BigMap', async (done) => {
+    it('returns undefined on bad key in BigMap', async done => {
       const expectedError = new HttpResponseError(
         'fail',
         STATUS_CODE.NOT_FOUND,
@@ -700,7 +692,7 @@ describe('RpcContractProvider test', () => {
       expect(returnValue).toEqual(undefined);
       done();
     });
-    it('returns error if error is not 404 from key lookup in BigMap', async (done) => {
+    it('returns error if error is not 404 from key lookup in BigMap', async done => {
       const expectedError = new HttpResponseError(
         'fail',
         STATUS_CODE.FORBIDDEN,
@@ -721,7 +713,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('originate', () => {
-    it('should produce a reveal and origination operation', async (done) => {
+    it('should produce a reveal and origination operation', async done => {
       mockRpcClient.getManagerKey.mockResolvedValue(null);
       const result = await rpcContractProvider.originate({
         delegate: 'test_delegate',
@@ -762,7 +754,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should not convert balance to mutez when mutez flag is set to true', async (done) => {
+    it('should not convert balance to mutez when mutez flag is set to true', async done => {
       const result = await rpcContractProvider.originate({
         delegate: 'test_delegate',
         balance: '200',
@@ -803,7 +795,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('estimate when no fees are specified', async (done) => {
+    it('estimate when no fees are specified', async done => {
       const estimate = new Estimate(1000, 1000, 180, 1000);
       mockEstimate.originate.mockResolvedValue(estimate);
 
@@ -843,7 +835,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should not alter code and init object when they are array and object', async (done) => {
+    it('should not alter code and init object when they are array and object', async done => {
       const result = await rpcContractProvider.originate({
         delegate: 'test_delegate',
         balance: '200',
@@ -882,7 +874,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should deal with code properties in atypical order', async (done) => {
+    it('should deal with code properties in atypical order', async done => {
       const order1 = ['storage', 'code', 'parameter'];
       const result = await rpcContractProvider.originate({
         delegate: 'test_delegate',
@@ -927,7 +919,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('transfer', () => {
-    it('should produce a reveal and transaction operation', async (done) => {
+    it('should produce a reveal and transaction operation', async done => {
       const result = await rpcContractProvider.transfer({
         to: 'test_to',
         amount: 2,
@@ -960,7 +952,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should estimate when no fee are specified', async (done) => {
+    it('should estimate when no fee are specified', async done => {
       const estimate = new Estimate(1000, 1000, 180, 1000);
       mockEstimate.transfer.mockResolvedValue(estimate);
 
@@ -993,7 +985,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should omit reveal operation if manager is defined (BABY)', async (done) => {
+    it('should omit reveal operation if manager is defined (BABY)', async done => {
       mockRpcClient.getContract.mockResolvedValue({ counter: 0 });
       mockRpcClient.getBlockHeader.mockResolvedValue({ hash: 'test' });
       mockRpcClient.preapplyOperations.mockResolvedValue([]);
@@ -1034,7 +1026,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should return parsed error from RPC result', async (done) => {
+    it('should return parsed error from RPC result', async done => {
       const params = {
         to: 'test_to',
         amount: 2,
@@ -1057,7 +1049,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should return parsed error from RPC result', async (done) => {
+    it('should return parsed error from RPC result', async done => {
       const params = {
         to: 'test_to',
         amount: 2,
@@ -1082,7 +1074,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should return internal error when received from preapply', async (done) => {
+    it('should return internal error when received from preapply', async done => {
       const params = {
         to: 'test_to',
         amount: 2,
@@ -1107,7 +1099,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should omit reveal operation if manager is defined', async (done) => {
+    it('should omit reveal operation if manager is defined', async done => {
       mockRpcClient.getContract.mockResolvedValue({ counter: 0 });
       mockRpcClient.getBlockHeader.mockResolvedValue({ hash: 'test' });
       mockRpcClient.preapplyOperations.mockResolvedValue([]);
@@ -1150,7 +1142,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('setDelegate', () => {
-    it('should produce a reveal and delegation operation', async (done) => {
+    it('should produce a reveal and delegation operation', async done => {
       const estimate = new Estimate(1000000, 1000, 180, 1000);
       mockEstimate.setDelegate.mockResolvedValue(estimate);
       const result = await rpcContractProvider.setDelegate({
@@ -1181,7 +1173,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should throw InvalidDelegationSource when setting a KT1 address in babylon', async (done) => {
+    it('should throw InvalidDelegationSource when setting a KT1 address in babylon', async done => {
       const estimate = new Estimate(1000, 1000, 180, 1000);
       mockEstimate.setDelegate.mockResolvedValue(estimate);
       mockRpcClient.getBlockMetadata.mockResolvedValue({
@@ -1202,7 +1194,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('registerDelegate', () => {
-    it('should produce a reveal and delegation operation', async (done) => {
+    it('should produce a reveal and delegation operation', async done => {
       const estimate = new Estimate(1000000, 1000, 180, 1000);
       mockEstimate.registerDelegate.mockResolvedValue(estimate);
       const result = await rpcContractProvider.registerDelegate({});
@@ -1232,7 +1224,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('reveal', () => {
-    it('should produce a reveal operation', async (done) => {
+    it('should produce a reveal operation', async done => {
       const estimate = new Estimate(1000000, 0, 64, 250);
       mockEstimate.reveal.mockResolvedValue(estimate);
       const result = await rpcContractProvider.reveal({});
@@ -1249,7 +1241,7 @@ describe('RpcContractProvider test', () => {
               public_key: 'test_pub_key',
               source: 'test_pub_key_hash',
               storage_limit: '0',
-            },
+            }
           ],
           protocol: 'test_proto',
           signature: 'test_sig',
@@ -1261,7 +1253,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('at', () => {
-    it('should return contract method', async (done) => {
+    it('should return contract method', async done => {
       mockRpcClient.getContract.mockResolvedValue({ counter: 0 });
       mockRpcClient.getBlockHeader.mockResolvedValue({ hash: 'test' });
       mockRpcClient.getEntrypoints.mockResolvedValue({
@@ -1287,7 +1279,7 @@ describe('RpcContractProvider test', () => {
   });
 
   describe('originate with noop parser', () => {
-    it('should throw InvalidCodeParameter', async (done) => {
+    it('should throw InvalidCodeParameter', async done => {
       rpcContractProvider['context'].parser = new NoopParser();
       try {
         await rpcContractProvider.originate({
@@ -1306,7 +1298,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should throw InvalidCodeParameter when missing storage part', async (done) => {
+    it('should throw InvalidCodeParameter when missing storage part', async done => {
       rpcContractProvider['context'].parser = new NoopParser();
       try {
         await rpcContractProvider.originate({
@@ -1316,8 +1308,8 @@ describe('RpcContractProvider test', () => {
             { prim: 'parameter', args: [{ prim: 'int' }] },
             {
               prim: 'code',
-              args: [[{ prim: 'DUP' }]],
-            },
+              args: [[{ prim: 'DUP' }]]
+            }
           ],
           storage: 'test',
           fee: 10000,
@@ -1331,7 +1323,7 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should throw InvalidInitParameter', async (done) => {
+    it('should throw InvalidInitParameter', async done => {
       rpcContractProvider['context'].parser = new NoopParser();
       try {
         await rpcContractProvider.originate({
@@ -1341,12 +1333,9 @@ describe('RpcContractProvider test', () => {
             { prim: 'parameter', args: [{ prim: 'int' }] },
             {
               prim: 'code',
-              args: [[{ prim: 'DUP' }]],
-            },
-            {
-              prim: 'storage',
-              args: [{ prim: 'pair', args: [{ prim: 'int' }, { prim: 'address' }] }],
+              args: [[{ prim: 'DUP' }]]
             },
+            { prim: 'storage', args: [{ prim: 'pair', args: [{ prim: 'int' }, { prim: 'address' }] }] }
           ],
           init: 'test',
           fee: 10000,
@@ -1361,41 +1350,42 @@ describe('RpcContractProvider test', () => {
     });
 
     describe('batch', () => {
-      it('should produce a batch operation', async (done) => {
+      it('should produce a batch operation', async done => {
+
         const opToBatch: ParamsWithKind[] = [
           {
             kind: OpKind.TRANSACTION,
             to: 'test',
-            amount: 2,
+            amount: 2
           },
           {
             kind: OpKind.TRANSACTION,
             to: 'test',
-            amount: 2,
-          },
+            amount: 2
+          }
         ];
 
+        const opBatch = new OperationBatch(rpcContractProvider['context'], mockEstimate);
+
         expect(rpcContractProvider.batch()).toBeInstanceOf(OperationBatch);
-        expect(rpcContractProvider.batch(opToBatch)).toBeInstanceOf(OperationBatch);
+        expect(rpcContractProvider.batch()).toEqual(opBatch);
+
+        expect(rpcContractProvider.batch(opToBatch)).toEqual(opBatch.with(opToBatch));
 
         done();
       });
     });
   });
 
-  describe('getSaplingDiffByID', () => {
-    it('should call getSaplingDiffById', async (done) => {
+  describe("getSaplingDiffByID", () => {
+    it("should call getSaplingDiffById", async (done) => {
       mockRpcClient.getBlock.mockResolvedValue({ header: { level: 123456 } });
-      mockRpcClient.getSaplingDiffById.mockResolvedValue({
-        root: 'fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e',
-        commitments_and_ciphertexts: [],
-        nullifiers: [],
-      });
+      mockRpcClient.getSaplingDiffById.mockResolvedValue({"root":"fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e","commitments_and_ciphertexts":[],"nullifiers":[]})
 
-      const result = await rpcContractProvider.getSaplingDiffByID('133');
-      expect(result.root).toEqual(
-        'fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e'
+      const result = await rpcContractProvider.getSaplingDiffByID(
+        "133"
       );
+      expect(result.root).toEqual('fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e');
       expect(result.commitments_and_ciphertexts).toEqual([]);
       expect(result.nullifiers).toEqual([]);
 
@@ -1404,108 +1394,17 @@ describe('RpcContractProvider test', () => {
       done();
     });
 
-    it('should call getSaplingDiffById with a specified block level', async (done) => {
+    it("should call getSaplingDiffById with a specified block level", async (done) => {
       mockRpcClient.getBlock.mockResolvedValue({ header: { level: 123456 } });
-      mockRpcClient.getSaplingDiffById.mockResolvedValue({
-        root: 'fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e',
-        commitments_and_ciphertexts: [],
-        nullifiers: [],
-      });
+      mockRpcClient.getSaplingDiffById.mockResolvedValue({"root":"fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e","commitments_and_ciphertexts":[],"nullifiers":[]})
 
-      const result = await rpcContractProvider.getSaplingDiffByID('133', 654321);
-      expect(result.root).toEqual(
-        'fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e'
-      );
+      const result = await rpcContractProvider.getSaplingDiffByID("133", 654321);
+      expect(result.root).toEqual('fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e');
       expect(result.commitments_and_ciphertexts).toEqual([]);
       expect(result.nullifiers).toEqual([]);
 
       expect(mockRpcClient.getSaplingDiffById.mock.calls[0][0]).toEqual('133');
-      expect(mockRpcClient.getSaplingDiffById.mock.calls[0][1]).toEqual({ block: '654321' });
-      done();
-    });
-  });
-
-  describe('Multiple subsequent operations (to send more than one operation in a block)', () => {
-    it('should increment context counter between operations', async (done) => {
-      mockRpcClient.getContract.mockResolvedValue({ counter: 0 });
-      mockRpcClient.getBlockHeader.mockResolvedValue({ hash: 'test' });
-      mockRpcClient.preapplyOperations.mockResolvedValue([]);
-      mockRpcClient.getManagerKey.mockResolvedValue('test');
-      mockRpcClient.getBlockMetadata.mockResolvedValue({ next_protocol: 'test_proto' });
-      mockSigner.sign.mockResolvedValue({ sbytes: 'test', prefixSig: 'test_sig' });
-      mockSigner.publicKey.mockResolvedValue('test_pub_key');
-      mockSigner.publicKeyHash.mockResolvedValue('test_pub_key_hash');
-      mockEstimate.reveal.mockResolvedValue(undefined);
-      mockRpcClient.runOperation.mockReturnValue({ contents: [] });
-
-      expect(rpcContractProvider['context'].counters['test_pub_key_hash']).toBeUndefined();
-
-      await rpcContractProvider.transfer({
-        to: 'test_to',
-        amount: 2,
-        fee: 10000,
-        gasLimit: 10600,
-        storageLimit: 300,
-      });
-      expect(rpcContractProvider['context'].counters['test_pub_key_hash']).toBe(1);
-
-      await rpcContractProvider.registerDelegate({
-        fee: 10000,
-        gasLimit: 10600,
-        storageLimit: 257,
-      });
-      expect(rpcContractProvider['context'].counters['test_pub_key_hash']).toBe(2);
-
-      await rpcContractProvider.setDelegate({
-        source: 'test_source',
-        delegate: 'test_delegate',
-        fee: 10000,
-        gasLimit: 10600,
-        storageLimit: 257,
-      });
-      expect(rpcContractProvider['context'].counters['test_pub_key_hash']).toBe(3);
-
-      await rpcContractProvider.originate({
-        delegate: 'test_delegate',
-        balance: '200',
-        code: miStr,
-        init: miInit,
-        fee: 10000,
-        gasLimit: 10600,
-        storageLimit: 257,
-        mutez: true,
-      });
-      expect(rpcContractProvider['context'].counters['test_pub_key_hash']).toBe(4);
-
-      const resultLastTransfer = await rpcContractProvider.transfer({
-        to: 'test_to',
-        amount: 2,
-        fee: 10000,
-        gasLimit: 10600,
-        storageLimit: 300,
-      });
-      expect(rpcContractProvider['context'].counters['test_pub_key_hash']).toBe(5);
-      expect(resultLastTransfer.raw).toEqual({
-        counter: 0,
-        opOb: {
-          branch: 'test',
-          contents: [
-            {
-              amount: '2000000',
-              counter: '5',
-              destination: 'test_to',
-              fee: '10000',
-              gas_limit: '10600',
-              kind: 'transaction',
-              source: 'test_pub_key_hash',
-              storage_limit: '300',
-            },
-          ],
-          protocol: 'test_proto',
-          signature: 'test_sig',
-        },
-        opbytes: 'test',
-      });
+      expect(mockRpcClient.getSaplingDiffById.mock.calls[0][1]).toEqual({block:'654321'});
       done();
     });
   });
diff --git a/packages/taquito/test/contract/rpc-estimate-provider.spec.ts b/packages/taquito/test/contract/rpc-estimate-provider.spec.ts
index 08db94711..dbb9f12a3 100644
--- a/packages/taquito/test/contract/rpc-estimate-provider.spec.ts
+++ b/packages/taquito/test/contract/rpc-estimate-provider.spec.ts
@@ -706,23 +706,4 @@ describe('RPCEstimateProvider test', () => {
       done();
     });
   });
-
-  describe('Multiple subsequent operations (to send more than one operation in a block)', () => {
-    test('should not increment context counter between operation estimations', async (done) => {
-      mockRpcClient.getManagerKey.mockResolvedValue(null);
-      mockRpcClient.runOperation.mockResolvedValue(multipleInternalOrigination());
-      // Simulate real op size
-      mockRpcClient.forgeOperations.mockResolvedValue(new Array(297).fill('aa').join(''));
-      await estimateProvider.transfer({
-        to: 'test_to',
-        amount: 2,
-      });
-      await estimateProvider.transfer({
-        to: 'test_to',
-        amount: 2,
-      });
-      expect(estimateProvider['context'].counters).toEqual({});
-      done();
-    });
-  });
 });