@iota/bundle-validator
Advanced tools
Comparing version 1.0.0-beta.a1883550 to 1.0.0-beta.a4e57cc3
"use strict"; | ||
/** @module bundle-validator */ | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
@@ -31,6 +34,6 @@ exports.__esModule = true; | ||
var address = _a.address, signatureMessageFragment = _a.signatureMessageFragment, value = _a.value; | ||
var _b, _c; | ||
return value < 0 | ||
? __assign({}, acc, (_b = {}, _b[address] = [signatureMessageFragment], _b)) : value === 0 && acc.hasOwnProperty(address) && address === bundle[i - 1].address | ||
? __assign({}, acc, (_c = {}, _c[address] = acc[address].concat(signatureMessageFragment), _c)) : acc; | ||
var _b, _c; | ||
}, {}); | ||
@@ -37,0 +40,0 @@ return Object.keys(signatures).every(function (address) { return signing_1.validateSignatures(address, signatures[address], bundle[0].bundle); }); |
"use strict"; | ||
exports.__esModule = true; | ||
var samples_1 = require("@iota/samples"); | ||
var ava_1 = require("ava"); | ||
var samples_1 = require("@iota/samples"); | ||
var src_1 = require("../src"); | ||
@@ -6,0 +6,0 @@ ava_1["default"]('isBundle() returns true for valid bundle.', function (t) { |
"use strict"; | ||
exports.__esModule = true; | ||
var samples_1 = require("@iota/samples"); | ||
var ava_1 = require("ava"); | ||
var samples_1 = require("@iota/samples"); | ||
var src_1 = require("../src"); | ||
@@ -6,0 +6,0 @@ ava_1["default"]('validateSignatures() returns true for bundle with valid signatures.', function (t) { |
@@ -49,2 +49,3 @@ "use strict"; | ||
exports.inconsistentTransaction = function (reason) { return "Transaction is inconsistent. Reason: " + reason; }; | ||
exports.INVALID_DELAY = 'Invalid delay.'; | ||
//# sourceMappingURL=errors.js.map |
@@ -189,3 +189,4 @@ "use strict"; | ||
return function (arr, customMsg) { | ||
var _a = validator(arr[0]), _ = _a[0], isValid = _a[1], msg = _a[2]; | ||
var _a = validator(arr[0]), _ = _a[0], // tslint:disable-line no-unused-variable | ||
isValid = _a[1], msg = _a[2]; | ||
return [arr, function (x) { return x.every(function (value) { return isValid(value); }); }, customMsg || msg]; | ||
@@ -192,0 +193,0 @@ }; |
{ | ||
"name": "@iota/bundle-validator", | ||
"version": "1.0.0-beta.a1883550", | ||
"version": "1.0.0-beta.a4e57cc3", | ||
"description": "Syntactically validates bundle structure and signatures.", | ||
@@ -14,3 +14,3 @@ "main": "./out/bundle-validator/src/index.js", | ||
"test-ci": "nyc ava", | ||
"format": "prettier", | ||
"lint": "tslint --project .", | ||
"docs": "tsc && jsdoc2md --no-cache --plugin dmd-clear -t README_tpl.hbs --files './out/**/*.js' > README.md" | ||
@@ -68,11 +68,11 @@ }, | ||
"dependencies": { | ||
"@iota/converter": "^1.0.0-beta.a1883550", | ||
"@iota/kerl": "^1.0.0-beta.a1883550", | ||
"@iota/signing": "^1.0.0-beta.a1883550", | ||
"@iota/transaction": "^1.0.0-beta.a1883550", | ||
"@iota/transaction-converter": "^1.0.0-beta.a1883550" | ||
"@iota/converter": "^1.0.0-beta.a4e57cc3", | ||
"@iota/kerl": "^1.0.0-beta.a4e57cc3", | ||
"@iota/signing": "^1.0.0-beta.a4e57cc3", | ||
"@iota/transaction": "^1.0.0-beta.a4e57cc3", | ||
"@iota/transaction-converter": "^1.0.0-beta.a4e57cc3" | ||
}, | ||
"devDependencies": { | ||
"@iota/samples": "^1.0.0-beta.a1883550" | ||
"@iota/samples": "^1.0.0-beta.a4e57cc3" | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
import test from 'ava' | ||
import { | ||
@@ -11,2 +10,3 @@ bundle, | ||
} from '@iota/samples' | ||
import test from 'ava' | ||
import isBundle from '../src' | ||
@@ -13,0 +13,0 @@ |
@@ -0,3 +1,3 @@ | ||
import { bundle, bundleWithInvalidSignature, bundleWithInvalidTransactionOrder } from '@iota/samples' | ||
import test from 'ava' | ||
import { bundle, bundleWithInvalidSignature, bundleWithInvalidTransactionOrder } from '@iota/samples' | ||
import { validateBundleSignatures } from '../src' | ||
@@ -4,0 +4,0 @@ |
@@ -0,1 +1,2 @@ | ||
/** @module bundle-validator */ | ||
import { Validator } from '../../guards'; | ||
@@ -2,0 +3,0 @@ import { Bundle, Transaction } from '../../types'; |
@@ -47,1 +47,2 @@ export declare const ILLEGAL_LENGTH = "Illegal trits length"; | ||
export declare const inconsistentTransaction: (reason: string) => string; | ||
export declare const INVALID_DELAY = "Invalid delay."; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="bluebird" /> | ||
import * as Promise from 'bluebird'; | ||
@@ -72,3 +71,3 @@ export declare type Maybe<T> = T | void; | ||
CHECK_CONSISTENCY = "checkConsistency", | ||
WERE_ADDRESSES_SPENT_FROM = "wereAddressesSpentFrom", | ||
WERE_ADDRESSES_SPENT_FROM = "wereAddressesSpentFrom" | ||
} | ||
@@ -75,0 +74,0 @@ export interface BaseCommand { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85880
32
1155