use standardjs formatting
This commit is contained in:
parent
09d8e440de
commit
399803affa
41 changed files with 1252 additions and 1177 deletions
test
|
@ -1,3 +1,5 @@
|
|||
/* global describe, it */
|
||||
|
||||
var assert = require('assert')
|
||||
var networks = require('../src/networks')
|
||||
|
||||
|
@ -8,10 +10,10 @@ var Message = require('../src/message')
|
|||
|
||||
var fixtures = require('./fixtures/message.json')
|
||||
|
||||
describe('Message', function() {
|
||||
describe('magicHash', function() {
|
||||
fixtures.valid.magicHash.forEach(function(f) {
|
||||
it('produces the correct magicHash for \"' + f.message + '\" (' + f.network + ')', function() {
|
||||
describe('Message', function () {
|
||||
describe('magicHash', function () {
|
||||
fixtures.valid.magicHash.forEach(function (f) {
|
||||
it('produces the correct magicHash for "' + f.message + '" (' + f.network + ')', function () {
|
||||
var network = networks[f.network]
|
||||
var actual = Message.magicHash(f.message, network)
|
||||
|
||||
|
@ -20,8 +22,8 @@ describe('Message', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('verify', function() {
|
||||
it('accepts an Address object', function() {
|
||||
describe('verify', function () {
|
||||
it('accepts an Address object', function () {
|
||||
var f = fixtures.valid.verify[0]
|
||||
var network = networks[f.network]
|
||||
|
||||
|
@ -29,8 +31,8 @@ describe('Message', function() {
|
|||
assert(Message.verify(address, f.signature, f.message, network))
|
||||
})
|
||||
|
||||
fixtures.valid.verify.forEach(function(f) {
|
||||
it('verifies a valid signature for \"' + f.message + '\" (' + f.network + ')', function() {
|
||||
fixtures.valid.verify.forEach(function (f) {
|
||||
it('verifies a valid signature for "' + f.message + '" (' + f.network + ')', function () {
|
||||
var network = networks[f.network]
|
||||
|
||||
assert(Message.verify(f.address, f.signature, f.message, network))
|
||||
|
@ -41,16 +43,16 @@ describe('Message', function() {
|
|||
})
|
||||
})
|
||||
|
||||
fixtures.invalid.verify.forEach(function(f) {
|
||||
it(f.description, function() {
|
||||
fixtures.invalid.verify.forEach(function (f) {
|
||||
it(f.description, function () {
|
||||
assert(!Message.verify(f.address, f.signature, f.message))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('signing', function() {
|
||||
fixtures.valid.signing.forEach(function(f) {
|
||||
it(f.description, function() {
|
||||
describe('signing', function () {
|
||||
fixtures.valid.signing.forEach(function (f) {
|
||||
it(f.description, function () {
|
||||
var network = networks[f.network]
|
||||
|
||||
var privKey = new ECKey(new BigInteger(f.d), false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue