Skip to content

Commit

Permalink
refactor(getNetworkId)!: drop unnecessary force option
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `getNetworkId` ignores `force` option
So, it would throw exception in case networkId is not provided. Use `try/catch` instead.
  • Loading branch information
davidyuk committed Apr 22, 2022
1 parent 153fd89 commit 7d6549a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

/**
Expand Down

0 comments on commit 7d6549a

Please sign in to comment.