From 7d6549ad57a525b314ad326b4b5b971682f88013 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 29 Mar 2022 19:04:15 +0300 Subject: [PATCH] refactor(getNetworkId)!: drop unnecessary `force` option BREAKING CHANGE: `getNetworkId` ignores `force` option So, it would throw exception in case networkId is not provided. Use `try/catch` instead. --- src/node.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node.js b/src/node.js index 8383f94b8d..b6b2622f33 100644 --- a/src/node.js +++ b/src/node.js @@ -34,11 +34,10 @@ import { MissingParamError, UnsupportedVersionError } from './utils/errors' * @rtype () => networkId: String * @return {String} NetworkId */ -export function getNetworkId ({ networkId, force = false } = {}) { +export function getNetworkId ({ networkId } = {}) { const res = networkId || this.networkId || this.selectedNode?.networkId if (res) return res - if (force) return null - else throw new MissingParamError('networkId is not provided') + throw new MissingParamError('networkId is not provided') } /**