'NotAllowedError'
)
}
+ if (this.signature !== undefined) {
+ throw new TypeError('Block signature already exists', { cause: this.signature })
+ }
if (typeof input === 'string' && /^[A-F0-9]{128}$/i.test(input)) {
this.signature = input
return this
* @returns {Promise} Status, signature, and block hash
*/
static async #signBlock (index: number, block: Block): Promise<LedgerSignResponse> {
+ if (block.signature !== undefined) {
+ throw new TypeError('Block signature already exists', { cause: block.signature })
+ }
return this.#enqueue(async () => {
try {
if (typeof index !== 'number' || index < 0 || index >= HARDENED_OFFSET) {
if (!(block instanceof Block)) {
throw new TypeError('Invalid Block', { cause: block })
}
+ if (block.signature !== undefined) {
+ throw new TypeError('Block signature already exists', { cause: block.signature })
+ }
if (wallet.type === 'Ledger') {
if (frontier instanceof Block) {
try {