function fromTxoAttr(attr, {tape, t}) {
  const n = tape.length - 1
  const i = tape[n].i
  const index = attr.ii

  // Handle opcode
  if (attr.o) {
    tape[n].cell = tape[n].cell || []
    tape[n].cell.push({
      op: OpCode[attr.o],
      ops: attr.o,
      i: index - t,
      ii: index
    })

    if (attr.o === 'OP_RETURN') {
      tape.push({ i: i+1 })
      return { tape, t: index + 1 }
    } else {
      return { tape, t }
    }

  // Handle pipe
  } else if (attr.s === '|') {
    tape.push({ i: i+1 })
    return { tape, t: index + 1 }

  // Everything else
  } else {
    tape[n].cell = tape[n].cell || []
    tape[n].cell.push({ ...attr, i: index - t })
    return { tape, t }
  }
}
/**
 * Creates a BOB formatted cell from the given TXO attr.
 * @private
 */
Creates a BOB formatted cell from the given TXO attr.
@private
Creates a BOB formatted cell from the given TXO attr . @private
function fromTxoAttr(attr, {tape, t}) {
  const n = tape.length - 1
  const i = tape[n].i
  const index = attr.ii
  if (attr.o) {
    tape[n].cell = tape[n].cell || []
    tape[n].cell.push({
      op: OpCode[attr.o],
      ops: attr.o,
      i: index - t,
      ii: index
    })
    if (attr.o === 'OP_RETURN') {
      tape.push({ i: i+1 })
      return { tape, t: index + 1 }
    } else {
      return { tape, t }
    }
  } else if (attr.s === '|') {
    tape.push({ i: i+1 })
    return { tape, t: index + 1 }
  } else {
    tape[n].cell = tape[n].cell || []
    tape[n].cell.push({ ...attr, i: index - t })
    return { tape, t }
  }
}
function fromTxoAttr ( attr , { tape , t } ) { const n = tape . length - 1 const i = tape [ n ] . i const index = attr . ii if ( attr . o ) { tape [ n ] . cell = tape [ n ] . cell || [ ] tape [ n ] . cell . push ( { op : OpCode [ attr . o ] , ops : attr . o , i : index - t , ii : index } ) if ( attr . o === 'OP_RETURN' ) { tape . push ( { i : i + 1 } ) return { tape , t : index + 1 } } else { return { tape , t } } } else if ( attr . s === '|' ) { tape . push ( { i : i + 1 } ) return { tape , t : index + 1 } } else { tape [ n ] . cell = tape [ n ] . cell || [ ] tape [ n ] . cell . push ( { ... attr , i : index - t } ) return { tape , t } } }
Creates a BOB formatted cell from the given TXO attr.
Creates a BOB formatted cell from the given TXO attr .
// Handle opcode // Handle pipe // Everything else