Repository: ecadlabs/taquito
Pull request #1039 (2021-08-31 23:51:19)

Bugfix where custom polling interval values were replaced with the de…
…fault ones

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.__


github-actions[bot]: A new deploy preview is available on Netlify at https://7451049b--tezostaquito.netlify.app
github-actions[bot]: New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/.

### Published packages:
```
npm i @taquito/rpc@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-signer@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/http-utils@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/signer@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/beacon-wallet@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/remote-signer@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/local-forging@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/ledger-signer@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip16@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/utils@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip12@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michel-codec@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-wallet@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michelson-encoder@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/taquito@10.1.0-7451049b--1039 --registry https://npm.preview.tezostaquito.io/
```
codecov-commenter: # [Codecov](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs) Report
> Merging [#1039](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs) (3b9213c) into [master](https://codecov.io/gh/ecadlabs/taquito/commit/a3a152f48cd0ecccbc934b0466fa908b7ec464ce?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs) (a3a152f) will **increase** coverage by `0.00%`.
> The diff coverage is `80.00%`.

[![Impacted file tree graph](https://codecov.io/gh/ecadlabs/taquito/pull/1039/graphs/tree.svg?width=650&height=150&src=pr&token=wXiK0M3HfY&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs)](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs)

```diff
@@           Coverage Diff           @@
##           master    #1039   +/-   ##
=======================================
  Coverage   80.84%   80.85%           
=======================================
  Files         165      165           
  Lines        8891     8889    -2     
  Branches     2255     2255           
=======================================
- Hits         7188     7187    -1     
+ Misses       1696     1695    -1     
  Partials        7        7           
```


| [Impacted Files](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs) | Coverage Δ | |
|---|---|---|
| [packages/taquito/src/context.ts](https://codecov.io/gh/ecadlabs/taquito/pull/1039/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs#diff-cGFja2FnZXMvdGFxdWl0by9zcmMvY29udGV4dC50cw==) | `91.48% <66.66%> (+0.76%)` | :arrow_up: |
| [packages/taquito/src/taquito.ts](https://codecov.io/gh/ecadlabs/taquito/pull/1039/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs#diff-cGFja2FnZXMvdGFxdWl0by9zcmMvdGFxdWl0by50cw==) | `94.26% <100.00%> (+0.04%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs). Last update [a3a152f...3b9213c](https://codecov.io/gh/ecadlabs/taquito/pull/1039?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecadlabs).

github-actions[bot]: New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/.

### Published packages:
```
npm i @taquito/utils@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/local-forging@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip16@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/signer@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michelson-encoder@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/http-utils@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/taquito@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/beacon-wallet@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-wallet@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/rpc@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip12@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michel-codec@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-signer@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/remote-signer@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/ledger-signer@10.1.0-79510a49--1039 --registry https://npm.preview.tezostaquito.io/
```
github-actions[bot]: A new deploy preview is available on Netlify at https://79510a49--tezostaquito.netlify.app
github-actions[bot]: New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/.

### Published packages:
```
npm i @taquito/utils@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/local-forging@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip16@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/signer@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michelson-encoder@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/http-utils@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/taquito@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/beacon-wallet@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-wallet@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/rpc@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip12@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michel-codec@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-signer@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/remote-signer@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/ledger-signer@10.1.0-19658bd1--1039 --registry https://npm.preview.tezostaquito.io/
```
github-actions[bot]: A new deploy preview is available on Netlify at https://19658bd1--tezostaquito.netlify.app
github-actions[bot]: New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/.

### Published packages:
```
npm i @taquito/utils@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/local-forging@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip16@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/signer@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michelson-encoder@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/http-utils@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/taquito@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/beacon-wallet@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-wallet@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/rpc@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip12@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michel-codec@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tezbridge-signer@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/remote-signer@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
npm i @taquito/ledger-signer@10.1.0-1c37e7a0--1039 --registry https://npm.preview.tezostaquito.io/
```
github-actions[bot]: A new deploy preview is available on Netlify at https://1c37e7a0--tezostaquito.netlify.app

Patch:
diff --git a/docs/rpc_nodes.md b/docs/rpc_nodes.md
index b0cfae574..f8b49c4c7 100644
--- a/docs/rpc_nodes.md
+++ b/docs/rpc_nodes.md
@@ -19,9 +19,6 @@ author: Roxane Letourneau
     - Mainnet: https://mainnet.api.tez.ie
     - Granadanet: https://granadanet.api.tez.ie
     - Florencenet: https://florencenet.api.tez.ie
-- Tezos Giga Node from Tezos Ukraine
-    - Mainnet: https://mainnet-tezos.giganode.io
-    - Granada testnet: https://testnet-tezos.giganode.io/
 - SmartPy nodes
     - Mainnet: https://mainnet.smartpy.io
     - Granadanet: https://granadanet.smartpy.io/
@@ -30,6 +27,10 @@ author: Roxane Letourneau
     - Next protocol/version testnet (Granadanet): https://rpczero.tzbeta.net/
 - Teznode from LetzBake!:
     - Mainnet: https://teznode.letzbake.com
+- ~~Tezos Giga Node from Tezos Ukraine~~ Will cease to operate on Oct 1st 2021. See
+  [Announcment](https://twitter.com/GigaNode/status/1435265400699342854)
+    - ~~Mainnet: https://mainnet-tezos.giganode.io~~
+    - ~~Granada testnet: https://testnet-tezos.giganode.io/~~
 
 ## How to run a node
 
diff --git a/packages/taquito/src/context.ts b/packages/taquito/src/context.ts
index a356e58ce..cb469e41a 100644
--- a/packages/taquito/src/context.ts
+++ b/packages/taquito/src/context.ts
@@ -27,11 +27,11 @@ export interface TaquitoProvider<T, K extends Array<any>> {
 
 export interface ConfigConfirmation {
   confirmationPollingIntervalSecond?: number;
-  confirmationPollingTimeoutSecond?: number;
-  defaultConfirmationCount?: number;
+  confirmationPollingTimeoutSecond: number;
+  defaultConfirmationCount: number;
 }
 
-export const defaultConfigConfirmation: Partial<ConfigConfirmation> = {
+export const defaultConfigConfirmation: ConfigConfirmation = {
   defaultConfirmationCount: 1,
   confirmationPollingTimeoutSecond: 180
 };
@@ -40,12 +40,12 @@ export const defaultConfigConfirmation: Partial<ConfigConfirmation> = {
 // When set to true, the observable won't die when getBlock rpc call fails; the error will be reported via the error callback,
 // and it will continue to poll for new blocks.
 export interface ConfigStreamer {
-  streamerPollingIntervalMilliseconds?: number;
-  shouldObservableSubscriptionRetry?: boolean;
-  observableSubscriptionRetryFunction?: OperatorFunction<any,any>;
+  streamerPollingIntervalMilliseconds: number;
+  shouldObservableSubscriptionRetry: boolean;
+  observableSubscriptionRetryFunction: OperatorFunction<any,any>;
 }
 
-export const defaultConfigStreamer: Required<ConfigStreamer> = {
+export const defaultConfigStreamer: ConfigStreamer = {
   streamerPollingIntervalMilliseconds: 20000,
   shouldObservableSubscriptionRetry: false,
   observableSubscriptionRetryFunction: retry()
@@ -85,7 +85,6 @@ export class Context {
     } else {
       this._rpcClient = this._rpc;
     }
-    this.config = _config as any;
     this._forger = forger ? forger : new RpcForger(this);
     this._injector = injector ? injector : new RpcInjector(this);
     this.operationFactory = new OperationFactory(this);
@@ -94,14 +93,19 @@ export class Context {
     this._packer = packer? packer: new RpcPacker(this);
   }
 
-  get config(): Partial<ConfigConfirmation> & Required<ConfigStreamer> {
+  get config(): ConfigConfirmation & ConfigStreamer {
     return this._config.getValue();
   }
 
-  set config(value: Partial<ConfigConfirmation> & Required<ConfigStreamer>) {
+  set config(value: ConfigConfirmation & ConfigStreamer) {
     this._config.next({
-      ...defaultConfigConfirmation,
-      ...defaultConfigStreamer,
+      ...value,
+    });
+  }
+
+  setPartialConfig(value: Partial<ConfigConfirmation> & Partial<ConfigStreamer>) {
+    this._config.next({
+      ...this._config.getValue(),
       ...value,
     });
   }
@@ -199,14 +203,9 @@ export class Context {
       // testnet and sandbox enviornment.   
       confirmationPollingInterval = confirmationPollingInterval.dividedBy(3);  
 
-      if (confirmationPollingInterval.toNumber() > defaultInterval) {
-        // Fix for the transistion from Florence to Granada
-        this.config.confirmationPollingIntervalSecond = defaultInterval;
-      } else {
-        this.config.confirmationPollingIntervalSecond = confirmationPollingInterval.toNumber() === 0 ?
-          0.1 :
-          confirmationPollingInterval.toNumber();
-      }
+      this.config.confirmationPollingIntervalSecond = confirmationPollingInterval.toNumber() === 0 ?
+        0.1 :
+        confirmationPollingInterval.toNumber();
       return this.config.confirmationPollingIntervalSecond;
     } catch (exception) {
       // Return default value if there is
diff --git a/packages/taquito/src/operations/operations.ts b/packages/taquito/src/operations/operations.ts
index 953157e58..8b964f616 100644
--- a/packages/taquito/src/operations/operations.ts
+++ b/packages/taquito/src/operations/operations.ts
@@ -163,10 +163,6 @@ export class Operation {
 
     const conf = confirmations !== undefined ? confirmations : defaultConfirmationCount;
 
-    if (conf === undefined) {
-      throw new Error('Default confirmation count can not be undefined!');
-    }
-
     return new Promise<number>((resolve, reject) => {
       this.confirmed$
         .pipe(
diff --git a/packages/taquito/src/taquito.ts b/packages/taquito/src/taquito.ts
index 0d21e4320..63771daef 100644
--- a/packages/taquito/src/taquito.ts
+++ b/packages/taquito/src/taquito.ts
@@ -101,7 +101,7 @@ export class TezosToolkit {
    *
    * @param options rpc url or rpcClient to use to interact with the Tezos network
    *
-   * @example Tezos.setProvider({rpc: 'https://api.tez.ie/rpc/mainnet', signer: new InMemorySigner.fromSecretKey(“edsk...”)})
+   * @example Tezos.setProvider({rpc: 'https://mainnet.api.tez.ie/', signer: new InMemorySigner.fromSecretKey(“edsk...”)})
    * @example Tezos.setProvider({ config: { confirmationPollingTimeoutSecond: 300 }})
    *
    */
@@ -124,7 +124,9 @@ export class TezosToolkit {
     this.setPackerProvider(packer);
 
     this._context.proto = protocol;
-    this._context.config = config as Partial<ConfigConfirmation> & Required<ConfigStreamer>;
+    if(config) {
+      this._context.setPartialConfig(config);
+    }
   }
 
   /**
@@ -150,7 +152,7 @@ export class TezosToolkit {
    *
    * @param options rpc url or rpcClient to use to interact with the Tezos network
    *
-   * @example Tezos.setRpcProvider('https://api.tez.ie/rpc/mainnet')
+   * @example Tezos.setRpcProvider('https://mainnet.api.tez.ie/')
    *
    */
   setRpcProvider(rpc?: SetProviderOptions['rpc']) {
diff --git a/packages/taquito/src/wallet/operation-factory.ts b/packages/taquito/src/wallet/operation-factory.ts
index af58fbab8..b3c081e10 100644
--- a/packages/taquito/src/wallet/operation-factory.ts
+++ b/packages/taquito/src/wallet/operation-factory.ts
@@ -52,10 +52,6 @@ export const createNewPollingBasedHeadObservable = (
   context: Context,
   scheduler?: SchedulerLike
 ): Observable<BlockResponse> => {  
-  
-  if (context.config.confirmationPollingTimeoutSecond === undefined) {
-    throw new Error('Confirmation polling timeout second can not be undefined!');
-  }
 
   return pollingTimer.pipe(
     switchMap(() => sharedHeadOb),


Test patch:
diff --git a/integration-tests/config.ts b/integration-tests/config.ts
index 4d321e55e..b1d490976 100644
--- a/integration-tests/config.ts
+++ b/integration-tests/config.ts
@@ -55,7 +55,7 @@ interface FaucetConfig {
 }
 
 const granadanetEphemeral = {
-  rpc: process.env['TEZOS_RPC_GRANADANET'] || 'https://api.tez.ie/rpc/granadanet',
+  rpc: process.env['TEZOS_RPC_GRANADANET'] || 'https://granadanet.api.tez.ie',
   knownBaker: 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD',
   knownContract: 'KT1JMwgeC7MwYiMiZd74gXK6wrY7QNf1NwLX',
   knownBigMapContract: 'KT1VniFqNCPEq4MXvnjYGvUqdWDhooJM5Nae',
@@ -68,7 +68,7 @@ const granadanetEphemeral = {
 }
 
 const florencenetEphemeral = {
-  rpc: process.env['TEZOS_RPC_FLORENCENET'] || 'https://api.tez.ie/rpc/florencenet',
+  rpc: process.env['TEZOS_RPC_FLORENCENET'] || 'https://florencenet.api.tez.ie',
   knownBaker: 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD',
   knownContract: 'KT1BRwtrBfiC2paqoSw4nakJ2EGLCGuoprLQ',
   knownBigMapContract: 'KT1W1jh5C5NbcVVvpnBLQT9ekMbR5a8fg6mc',
@@ -118,7 +118,7 @@ const key = {
 }
 
 const granadanetFaucet = {
-  rpc: 'https://api.tez.ie/rpc/granadanet',
+  rpc: 'https://granadanet.api.tez.ie',
   knownBaker: 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD',
   knownContract: 'KT1JMwgeC7MwYiMiZd74gXK6wrY7QNf1NwLX',
   knownBigMapContract: 'KT1VniFqNCPEq4MXvnjYGvUqdWDhooJM5Nae',
@@ -130,7 +130,7 @@ const granadanetFaucet = {
 }
 
 const florencenetFaucet = {
-  rpc: 'https://api.tez.ie/rpc/florencenet',
+  rpc: 'https://florencenet.api.tez.ie/',
   knownBaker: 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD',
   knownContract: 'KT1BRwtrBfiC2paqoSw4nakJ2EGLCGuoprLQ',
   knownBigMapContract: 'KT1W1jh5C5NbcVVvpnBLQT9ekMbR5a8fg6mc',
@@ -274,7 +274,7 @@ export const CONFIGS = () => {
           }
         },
         createAddress: async () => {
-          const tezos = new TezosToolkit(rpc)
+          const tezos = new TezosToolkit(rpc);
 
           const keyBytes = Buffer.alloc(32);
           nodeCrypto.randomFillSync(keyBytes)
diff --git a/packages/taquito/test/context.spec.ts b/packages/taquito/test/context.spec.ts
index 75bd3705a..441f2ed40 100644
--- a/packages/taquito/test/context.spec.ts
+++ b/packages/taquito/test/context.spec.ts
@@ -1,5 +1,77 @@
+import { retry, tap } from 'rxjs/operators';
 import { Context } from '../src/context';
 
+describe('Configurations for the confirmation methods and streamer', () => {
+    let mockRpcClient: any;
+    let context: Context;
+
+    beforeAll(() => {
+        mockRpcClient = {
+            getConstants: jest.fn()
+        };
+        context = new Context(mockRpcClient);
+    });
+
+    it('Context is initialized with default config values except for the confirmationPollingIntervalSecond property', () => {
+        expect(context.config.confirmationPollingIntervalSecond).toBeUndefined();
+        expect(context.config.confirmationPollingTimeoutSecond).toEqual(180);
+        expect(context.config.defaultConfirmationCount).toEqual(1);
+        expect(context.config.streamerPollingIntervalMilliseconds).toEqual(20000);
+        expect(context.config.shouldObservableSubscriptionRetry).toBeFalsy();
+        expect(context.config.observableSubscriptionRetryFunction.prototype).toEqual(retry().prototype);
+    });
+
+    it('Calling the getConfirmationPollingInterval should set the confirmationPollingIntervalSecond based on RPC constants', async (done) => {
+        mockRpcClient.getConstants.mockResolvedValue({
+            "time_between_blocks": [
+                "30",
+                "20"
+            ],
+            "endorsers_per_block": 32,
+            "minimal_block_delay": 15,
+            "initial_endorsers": 24,
+            "delay_per_missing_endorsement": "4"
+        });
+        await context.getConfirmationPollingInterval();
+        expect(context.config.confirmationPollingIntervalSecond).toEqual(5);
+        expect(context.config.confirmationPollingTimeoutSecond).toEqual(180);
+        expect(context.config.defaultConfirmationCount).toEqual(1);
+        expect(context.config.streamerPollingIntervalMilliseconds).toEqual(20000);
+        expect(context.config.shouldObservableSubscriptionRetry).toBeFalsy();
+        expect(context.config.observableSubscriptionRetryFunction.prototype).toEqual(retry().prototype);
+        done()
+    });
+
+    it('Configurations for the confirmation methods and streamer are customizable via the config setter', () => {
+        context.config = {
+            confirmationPollingIntervalSecond: 10,
+            confirmationPollingTimeoutSecond: 300,
+            defaultConfirmationCount: 2,
+            streamerPollingIntervalMilliseconds: 10000,
+            shouldObservableSubscriptionRetry: true,
+            observableSubscriptionRetryFunction: tap()
+        }
+        expect(context.config.confirmationPollingIntervalSecond).toEqual(10);
+        expect(context.config.confirmationPollingTimeoutSecond).toEqual(300);
+        expect(context.config.defaultConfirmationCount).toEqual(2);
+        expect(context.config.streamerPollingIntervalMilliseconds).toEqual(10000);
+        expect(context.config.shouldObservableSubscriptionRetry).toBeTruthy();
+        expect(context.config.observableSubscriptionRetryFunction.prototype).toEqual(tap().prototype);
+    });
+
+    it('Configurations for the confirmation methods and streamer can be partially customized using the setPartialConfig method', () => {
+        context.setPartialConfig({
+            defaultConfirmationCount: 3,
+            streamerPollingIntervalMilliseconds: 4000
+        });
+        expect(context.config.confirmationPollingIntervalSecond).toEqual(10);
+        expect(context.config.defaultConfirmationCount).toEqual(3);
+        expect(context.config.streamerPollingIntervalMilliseconds).toEqual(4000);
+        expect(context.config.shouldObservableSubscriptionRetry).toBeTruthy();
+        expect(context.config.observableSubscriptionRetryFunction.prototype).toEqual(tap().prototype);
+    });
+})
+
 describe('Taquito context class', () => {
 
     let mockRpcClient: any;
diff --git a/packages/taquito/test/taquito.spec.ts b/packages/taquito/test/taquito.spec.ts
index 5ac7c073c..b239be447 100644
--- a/packages/taquito/test/taquito.spec.ts
+++ b/packages/taquito/test/taquito.spec.ts
@@ -4,6 +4,7 @@ import { RpcContractProvider } from '../src/contract/rpc-contract-provider';
 import { PollingSubscribeProvider } from '../src/subscribe/polling-provider';
 import { NoopSigner } from '../src/signer/noop';
 import { RpcClient } from '@taquito/rpc';
+import { retry } from 'rxjs/operators';
 
 describe('TezosToolkit test', () => {
   let mockRpcClient: any;
@@ -98,4 +99,35 @@ describe('TezosToolkit test', () => {
     expect(versionInfo.commitHash).toBeTruthy();
     expect(versionInfo.version).toBeTruthy();
   });
+
+  it("setProvider allows to change configurations for the confirmation methods and streamer", () => {
+    // There is default config set on the context class:
+    expect(toolkit["_context"].config.confirmationPollingIntervalSecond).toBeUndefined();
+    expect(toolkit["_context"].config.confirmationPollingTimeoutSecond).toEqual(180);
+    expect(toolkit["_context"].config.defaultConfirmationCount).toEqual(1);
+    expect(toolkit["_context"].config.streamerPollingIntervalMilliseconds).toEqual(20000);
+    expect(toolkit["_context"].config.shouldObservableSubscriptionRetry).toBeFalsy();
+    expect(toolkit["_context"].config.observableSubscriptionRetryFunction.prototype).toEqual(retry().prototype);
+    
+    // can customize one of the config: confirmationPollingTimeoutSecond
+    toolkit.setProvider({ config: { confirmationPollingTimeoutSecond:2 } })
+    expect(toolkit["_context"].config.confirmationPollingIntervalSecond).toBeUndefined();
+    expect(toolkit["_context"].config.confirmationPollingTimeoutSecond).toEqual(2);
+    expect(toolkit["_context"].config.defaultConfirmationCount).toEqual(1);
+    expect(toolkit["_context"].config.streamerPollingIntervalMilliseconds).toEqual(20000);
+    expect(toolkit["_context"].config.shouldObservableSubscriptionRetry).toBeFalsy();
+    expect(toolkit["_context"].config.observableSubscriptionRetryFunction.prototype).toEqual(retry().prototype);
+
+    // can customize another config: confirmationPollingIntervalSecond
+    // confirmationPollingTimeoutSecond should remain to 2 as set precedently
+    toolkit.setProvider({ config: { confirmationPollingIntervalSecond:40 } });
+    expect(toolkit["_context"].config.confirmationPollingIntervalSecond).toBeDefined();
+    expect(toolkit["_context"].config.confirmationPollingIntervalSecond).toEqual(40);
+    expect(toolkit["_context"].config.confirmationPollingTimeoutSecond).toEqual(2);
+    expect(toolkit["_context"].config.defaultConfirmationCount).toEqual(1);
+    expect(toolkit["_context"].config.streamerPollingIntervalMilliseconds).toEqual(20000);
+    expect(toolkit["_context"].config.shouldObservableSubscriptionRetry).toBeFalsy();
+    expect(toolkit["_context"].config.observableSubscriptionRetryFunction.prototype).toEqual(retry().prototype);
+});
+
 });