From 9358a4050056f5cc209aaa2d9f09fb810d202f4b Mon Sep 17 00:00:00 2001 From: Wei Lu Date: Mon, 24 Mar 2014 03:19:39 +0800 Subject: [PATCH] tabs -> spaces --- src/eckey.js | 4 +- test/eckey.js | 106 +++++++++++++++++++++++------------------------ test/hdwallet.js | 10 ++--- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/eckey.js b/src/eckey.js index 7be1688..23722d3 100644 --- a/src/eckey.js +++ b/src/eckey.js @@ -190,6 +190,6 @@ ECKey.prototype.verify = function (hash, sig) { * Parse an exported private key contained in a string. */ module.exports = { - ECKey: ECKey, - ECPubKey: ECPubKey + ECKey: ECKey, + ECPubKey: ECPubKey }; diff --git a/test/eckey.js b/test/eckey.js index 7c5f594..708baa4 100644 --- a/test/eckey.js +++ b/test/eckey.js @@ -70,72 +70,72 @@ describe('ECKey', function() { describe('toAddress', function() { var privkeys = [ - 'CA48EC9783CF3AD0DFEFF1FC254395A2E403CBBC666477B61B45E31D3B8AB458', - '1111111111111111111111111111111111111111111111111111111111111111', - '18E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725' - ]; + 'CA48EC9783CF3AD0DFEFF1FC254395A2E403CBBC666477B61B45E31D3B8AB458', + '1111111111111111111111111111111111111111111111111111111111111111', + '18E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725' + ]; - // compressed pubkeys - var cpubkeys = [ - '024B12D9D7C77DB68388B6FF7C89046174C871546436806BCD80D07C28EA811992', - '034F355BDCB7CC0AF728EF3CCEB9615D90684BB5B2CA5F859AB0F0B704075871AA', - '0250863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B2352' - ]; + // compressed pubkeys + var cpubkeys = [ + '024B12D9D7C77DB68388B6FF7C89046174C871546436806BCD80D07C28EA811992', + '034F355BDCB7CC0AF728EF3CCEB9615D90684BB5B2CA5F859AB0F0B704075871AA', + '0250863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B2352' + ]; - var pubkeys = cpubkeys.map(function(x) { - return new ECPubKey(x).pub.getEncoded(false); - }); + var pubkeys = cpubkeys.map(function(x) { + return new ECPubKey(x).pub.getEncoded(false); + }); it('mainnet', function() { - var addresses = [ - '19SgmoUj4xowEjwtXvNAtYTAgbvR9iBCui', - '1MsHWS1BnwMc3tLE8G35UXsS58fKipzB7a', - '16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM' - ]; - var compressedAddresses = [ - '1AA4sjKW2aUmbtN3MtegdvhYtDBbDEke1q', - '1Q1pE5vPGEEMqRcVRMbtBK842Y6Pzo6nK9', - '1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs', - ]; + var addresses = [ + '19SgmoUj4xowEjwtXvNAtYTAgbvR9iBCui', + '1MsHWS1BnwMc3tLE8G35UXsS58fKipzB7a', + '16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM' + ]; + var compressedAddresses = [ + '1AA4sjKW2aUmbtN3MtegdvhYtDBbDEke1q', + '1Q1pE5vPGEEMqRcVRMbtBK842Y6Pzo6nK9', + '1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs', + ]; - for (var i = 0; i < addresses.length; ++i) { - var priv = new ECKey(privkeys[i], false); - var pubcomp = new ECPubKey(cpubkeys[i], true); - var pub = new ECPubKey(pubkeys[i], false); + for (var i = 0; i < addresses.length; ++i) { + var priv = new ECKey(privkeys[i], false); + var pubcomp = new ECPubKey(cpubkeys[i], true); + var pub = new ECPubKey(pubkeys[i], false); - var addr = addresses[i]; - var caddr = compressedAddresses[i]; + var addr = addresses[i]; + var caddr = compressedAddresses[i]; - assert.equal(priv.getAddress().toString(), addr); - assert.equal(pub.getAddress().toString(), addr); - assert.equal(pubcomp.getAddress().toString(), caddr); - } + assert.equal(priv.getAddress().toString(), addr); + assert.equal(pub.getAddress().toString(), addr); + assert.equal(pubcomp.getAddress().toString(), caddr); + } }) it('testnet', function() { - var addresses = [ - '19SgmoUj4xowEjwtXvNAtYTAgbvR9iBCui', - '1MsHWS1BnwMc3tLE8G35UXsS58fKipzB7a', - '16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM' - ]; - var compressedAddresses = [ - '1AA4sjKW2aUmbtN3MtegdvhYtDBbDEke1q', - '1Q1pE5vPGEEMqRcVRMbtBK842Y6Pzo6nK9', - '1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs', - ]; + var addresses = [ + '19SgmoUj4xowEjwtXvNAtYTAgbvR9iBCui', + '1MsHWS1BnwMc3tLE8G35UXsS58fKipzB7a', + '16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM' + ]; + var compressedAddresses = [ + '1AA4sjKW2aUmbtN3MtegdvhYtDBbDEke1q', + '1Q1pE5vPGEEMqRcVRMbtBK842Y6Pzo6nK9', + '1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs', + ]; - for (var i = 0; i < addresses.length; ++i) { - var priv = new ECKey(privkeys[i], false); - var pubcomp = new ECPubKey(cpubkeys[i], true); - var pub = new ECPubKey(pubkeys[i], false); + for (var i = 0; i < addresses.length; ++i) { + var priv = new ECKey(privkeys[i], false); + var pubcomp = new ECPubKey(cpubkeys[i], true); + var pub = new ECPubKey(pubkeys[i], false); - var addr = addresses[i]; - var caddr = compressedAddresses[i]; + var addr = addresses[i]; + var caddr = compressedAddresses[i]; - assert.equal(priv.getAddress().toString(), addr); - assert.equal(pub.getAddress().toString(), addr); - assert.equal(pubcomp.getAddress().toString(), caddr); - } + assert.equal(priv.getAddress().toString(), addr); + assert.equal(pub.getAddress().toString(), addr); + assert.equal(pubcomp.getAddress().toString(), caddr); + } }) }); }) diff --git a/test/hdwallet.js b/test/hdwallet.js index 65b5db0..bc18a78 100644 --- a/test/hdwallet.js +++ b/test/hdwallet.js @@ -33,10 +33,10 @@ describe('HDWallet', function() { }) describe('constructor & seed deserialization', function() { - var expectedPrivateKey = '0fd71c652e847ba7ea7956e3cf3fc0a0985871846b1b2c23b9c6a29a38cee86001'; + var expectedPrivateKey = '0fd71c652e847ba7ea7956e3cf3fc0a0985871846b1b2c23b9c6a29a38cee86001'; var seed = [ - 99, 114, 97, 122, 121, 32, 104, 111, 114, 115, 101, 32, 98, - 97, 116, 116, 101, 114, 121, 32, 115, 116, 97, 112, 108, 101 + 99, 114, 97, 122, 121, 32, 104, 111, 114, 115, 101, 32, 98, + 97, 116, 116, 101, 114, 121, 32, 115, 116, 97, 112, 108, 101 ]; it('creates from binary seed', function() { @@ -244,12 +244,12 @@ describe('HDWallet', function() { describe('network types', function() { it('ensures that a mainnet Wallet generates mainnet addresses', function() { var wallet = new HDWallet('foobar', 'mainnet') - assert.equal(wallet.getAddress().toString(), '1JNymexJHEr5u1BndiChMStFkCgPm4EQ6o'); + assert.equal(wallet.getAddress().toString(), '1JNymexJHEr5u1BndiChMStFkCgPm4EQ6o'); }) it('ensures that a testnet Wallet generates testnet addresses', function() { var wallet = new HDWallet('foobar', 'testnet') - assert.equal(wallet.getAddress().toString(), 'mxtw4i3H6GHLg7fQMHB5BN6acCH6kQ7aoY'); + assert.equal(wallet.getAddress().toString(), 'mxtw4i3H6GHLg7fQMHB5BN6acCH6kQ7aoY'); }) it('throws an excption when unknown network type is passed in', function() {