|
|
@ -207,18 +207,28 @@ describe('Script', function() { |
|
|
|
Script('OP_RETURN').isDataOut().should.equal(true); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should know this is an OP_RETURN script', function() { |
|
|
|
it('validates that this 40-byte OP_RETURN is standard', function() { |
|
|
|
var buf = new Buffer(40); |
|
|
|
buf.fill(0); |
|
|
|
Script('OP_RETURN 40 0x' + buf.toString('hex')).isDataOut().should.equal(true); |
|
|
|
}); |
|
|
|
it('validates that this 80-byte OP_RETURN is standard', function() { |
|
|
|
var buf = new Buffer(80); |
|
|
|
buf.fill(0); |
|
|
|
Script('OP_RETURN OP_PUSHDATA1 80 0x' + buf.toString('hex')).isDataOut().should.equal(true); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should know this is not an OP_RETURN script', function() { |
|
|
|
it('validates that this 40-byte long OP_CHECKMULTISIG is not standard op_return', function() { |
|
|
|
var buf = new Buffer(40); |
|
|
|
buf.fill(0); |
|
|
|
Script('OP_CHECKMULTISIG 40 0x' + buf.toString('hex')).isDataOut().should.equal(false); |
|
|
|
}); |
|
|
|
|
|
|
|
it('validates that this 81-byte OP_RETURN is not a valid standard OP_RETURN', function() { |
|
|
|
var buf = new Buffer(81); |
|
|
|
buf.fill(0); |
|
|
|
Script('OP_RETURN OP_PUSHDATA1 81 0x' + buf.toString('hex')).isDataOut().should.equal(false); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('#isPublicKeyHashIn', function() { |
|
|
|