throw new Error('Confirmed frontier block info subtype not found')
}
const confirmedFrontierSubtype = resConfirmedFrontierBlockInfo.subtype
- if (!['change', 'epoch', 'open', 'receive', 'send'].includes(confirmedFrontierSubtype) {
+ if (!['change', 'epoch', 'open', 'receive', 'send'].includes(confirmedFrontierSubtype)) {
throw new RangeError('Invalid subtype for confirmed frontier block', { cause: confirmedFrontierSubtype })
}
if (!('contents' in resConfirmedFrontierBlockInfo) || resConfirmedFrontierBlockInfo.contents == null || typeof resConfirmedFrontierBlockInfo.contents !== 'object') {
throw new Error('Frontier block info subtype not found')
}
const frontierSubtype = resFrontierBlockInfo.subtype
- if (!['change', 'epoch', 'open', 'receive', 'send'].includes(frontierSubtype) {
+ if (!['change', 'epoch', 'open', 'receive', 'send'].includes(frontierSubtype)) {
throw new RangeError('Invalid subtype for frontier block', { cause: frontierSubtype })
}
if (!('contents' in resFrontierBlockInfo) || resFrontierBlockInfo.contents == null || typeof resFrontierBlockInfo.contents !== 'object') {
if (frontiers[account.address] != null) {
account.frontier = frontiers[account.address]
const { subtype, contents: { balance, link, previous, representative, signature } } = blocks[account.frontier]
+ if (!['change', 'epoch', 'open', 'receive', 'send'].includes(subtype)) {
+ throw new RangeError('Invalid subtype for account frontier block', { cause: subtype })
+ }
account.representative = representative
const frontierBlock = new Block(account, balance, previous, representative)
if (typeof frontierBlock[subtype] !== 'function') {