Merge pull request #1090 from bitcoinjs/standard
fix standard 11 issues
This commit is contained in:
commit
736bdf64ad
5 changed files with 9 additions and 9 deletions
|
@ -187,7 +187,7 @@ function isCanonicalPubKey (buffer) {
|
||||||
function isDefinedHashType (hashType) {
|
function isDefinedHashType (hashType) {
|
||||||
var hashTypeMod = hashType & ~0x80
|
var hashTypeMod = hashType & ~0x80
|
||||||
|
|
||||||
// return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE
|
// return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE
|
||||||
return hashTypeMod > 0x00 && hashTypeMod < 0x04
|
return hashTypeMod > 0x00 && hashTypeMod < 0x04
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ function decode (buffer, maxLength, minimal) {
|
||||||
|
|
||||||
function scriptNumSize (i) {
|
function scriptNumSize (i) {
|
||||||
return i > 0x7fffffff ? 5
|
return i > 0x7fffffff ? 5
|
||||||
: i > 0x7fffff ? 4
|
: i > 0x7fffff ? 4
|
||||||
: i > 0x7fff ? 3
|
: i > 0x7fff ? 3
|
||||||
: i > 0x7f ? 2
|
: i > 0x7f ? 2
|
||||||
: i > 0x00 ? 1
|
: i > 0x00 ? 1
|
||||||
: 0
|
: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function encode (number) {
|
function encode (number) {
|
||||||
|
|
|
@ -255,7 +255,7 @@ describe('ECPair', function () {
|
||||||
it('wraps ecdsa.verify', hoodwink(function () {
|
it('wraps ecdsa.verify', hoodwink(function () {
|
||||||
this.mock(ecdsa, 'verify', function (h, s, q) {
|
this.mock(ecdsa, 'verify', function (h, s, q) {
|
||||||
assert.strictEqual(h, hash)
|
assert.strictEqual(h, hash)
|
||||||
// assert.strictEqual(s, signature)
|
// assert.strictEqual(s, signature)
|
||||||
assert.deepEqual(s, {
|
assert.deepEqual(s, {
|
||||||
r: BigInteger.fromBuffer(signature.slice(0, 32)),
|
r: BigInteger.fromBuffer(signature.slice(0, 32)),
|
||||||
s: BigInteger.fromBuffer(signature.slice(32, 64))
|
s: BigInteger.fromBuffer(signature.slice(32, 64))
|
||||||
|
|
|
@ -88,7 +88,7 @@ describe('bitcoinjs-lib (BIP32)', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can use BIP39 to generate BIP32 addresses', function () {
|
it('can use BIP39 to generate BIP32 addresses', function () {
|
||||||
// var mnemonic = bip39.generateMnemonic()
|
// var mnemonic = bip39.generateMnemonic()
|
||||||
var mnemonic = 'praise you muffin lion enable neck grocery crumble super myself license ghost'
|
var mnemonic = 'praise you muffin lion enable neck grocery crumble super myself license ghost'
|
||||||
assert(bip39.validateMnemonic(mnemonic))
|
assert(bip39.validateMnemonic(mnemonic))
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe('bitcoinjs-lib (blocks)', function () {
|
||||||
|
|
||||||
assert.strictEqual(tx.ins.length, 1)
|
assert.strictEqual(tx.ins.length, 1)
|
||||||
let script = tx.ins[0].script
|
let script = tx.ins[0].script
|
||||||
// bitcoin.script.decompile(script) // returns [] :(
|
// bitcoin.script.decompile(script) // returns [] :(
|
||||||
|
|
||||||
assert.strictEqual(script[0], 0x03)
|
assert.strictEqual(script[0], 0x03)
|
||||||
let heightBuffer = script.slice(1, 4)
|
let heightBuffer = script.slice(1, 4)
|
||||||
|
|
Loading…
Reference in a new issue