Fix wrong test data - p2sh address
This commit is contained in:
parent
5bfbab2bb7
commit
dc9b1b6b51
@ -6,9 +6,6 @@
|
||||
const Address = require('../lib/primitives/address');
|
||||
const Script = require('../lib/script/script');
|
||||
const assert = require('./util/assert');
|
||||
const common = require('../test/util/common');
|
||||
|
||||
const p2sh1 = common.readTX('p2sh1');
|
||||
|
||||
describe('Address', function() {
|
||||
it('should match mainnet p2pkh address', () => {
|
||||
@ -48,8 +45,19 @@ describe('Address', function() {
|
||||
});
|
||||
|
||||
it('should match mainnet p2sh address obtained from script', () => {
|
||||
const raw = p2sh1.getRaw();
|
||||
const script = Script.fromRaw(Buffer.from(raw, 'hex'));
|
||||
const p2sh = Buffer.from(''
|
||||
+ '52410491bba2510912a5bd37da1fb5b1673010e4'
|
||||
+ '3d2c6d812c514e91bfa9f2eb129e1c183329db55'
|
||||
+ 'bd868e209aac2fbc02cb33d98fe74bf23f0c235d'
|
||||
+ '6126b1d8334f864104865c40293a680cb9c020e7'
|
||||
+ 'b1e106d8c1916d3cef99aa431a56d253e69256da'
|
||||
+ 'c09ef122b1a986818a7cb624532f062c1d1f8722'
|
||||
+ '084861c5c3291ccffef4ec687441048d2455d240'
|
||||
+ '3e08708fc1f556002f1b6cd83f992d085097f997'
|
||||
+ '4ab08a28838f07896fbab08f39495e15fa6fad6e'
|
||||
+ 'dbfb1e754e35fa1c7844c41f322a1863d4621353ae',
|
||||
'hex');
|
||||
const script = Script.fromRaw(p2sh);
|
||||
const addr = Address.fromScript(script);
|
||||
const expectedAddr = '3QJmV3qfvL9SuYo34YihAf3sRCW3qSinyC';
|
||||
assert.strictEqual(addr.toString(), expectedAddr);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user