How to use the bsv.Opcode function in bsv

To help you get started, we’ve selected a few bsv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github interplanaria / bpu / index.js View on Github external
xputres.tape.push({ cell: [item], i: tape_i++ })
              cell = [];
              cell_i = 0;
            } else {
              xputres.tape.push({ cell: cell, i: tape_i++ })
              cell = [];
              cell_i = 0;
            }
          } else {
            let item = o.transform({ b: c.buf.toString('base64'), s: c.buf.toString('utf8'), ii: chunk_index, i: cell_i++ }, c)
            cell.push(item)
          }
        } else {
          if (typeof c.opcodenum !== 'undefined') {
            let op = c.opcodenum;
            let ops = bsv.Opcode(op).toString()
            let splitter = false;
            let isSplitter = false;
            if (o.split && Array.isArray(o.split)) {
              o.split.forEach(function(setting) {
                if ((setting.token && setting.token.op && setting.token.op === op) ||
                    (setting.token && setting.token.ops && setting.token.ops === ops)) {
                  splitter = setting.include; 
                  isSplitter = true;
                }
              })
            }
            if (isSplitter) {
              if (splitter === 'l') {
                let item = o.transform({ op: op, ops: ops, ii: chunk_index, i: cell_i++ }, c)
                cell.push(item)
                xputres.tape.push({ cell: cell, i: tape_i++ })