Fix embed.ts and index.ts for payments lint

This commit is contained in:
junderw 2019-03-07 12:29:24 +09:00
parent 3f34fe457a
commit 389ec8cb33
No known key found for this signature in database
GPG key ID: B256185D3A971908
4 changed files with 28 additions and 24 deletions
src/payments

View file

@ -1,14 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const networks_1 = require("../networks");
const bscript = require("../script");
const lazy = require("./lazy");
const networks_1 = require("../networks");
const typef = require('typeforce');
const OPS = bscript.OPS;
function stacksEqual(a, b) {
if (a.length !== b.length)
return false;
return a.every(function (x, i) {
return a.every((x, i) => {
return x.equals(b[i]);
});
}
@ -24,12 +24,12 @@ function p2data(a, opts) {
}, a);
const network = a.network || networks_1.bitcoin;
const o = { network };
lazy.prop(o, 'output', function () {
lazy.prop(o, 'output', () => {
if (!a.data)
return;
return bscript.compile([OPS.OP_RETURN].concat(a.data));
});
lazy.prop(o, 'data', function () {
lazy.prop(o, 'data', () => {
if (!a.output)
return;
return bscript.decompile(a.output).slice(1);