Test fromTransaction
This commit is contained in:
parent
e3efdbdb99
commit
dc23b8cce0
2 changed files with 16 additions and 1 deletions
6
test/fixtures/psbt.json
vendored
6
test/fixtures/psbt.json
vendored
|
@ -391,5 +391,11 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"fromTransaction": [
|
||||
{
|
||||
"transaction": "020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f00000000",
|
||||
"result": "cHNidP8BAJoCAAAAAljoeiG1ba8MI76OcHBFbDNvfLqlyHV5JPVFiHuyq911AAAAAAD/////g40EJ9DsZQpoqka7CwmK6kQiwHGyyng1Kgd5WdB86h0BAAAAAP////8CcKrwCAAAAAAWABTYXCtx0AYLCcmIauuBXlCZHdoSTQDh9QUAAAAAFgAUAK6pouXw+HaliN9VRuh0LR2HAI8AAAAAAAAAAAA="
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -169,4 +169,13 @@ describe(`Psbt`, () => {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('fromTransaction', () => {
|
||||
fixtures.fromTransaction.forEach(f => {
|
||||
it('Creates the expected PSBT from a transaction buffer', () => {
|
||||
const psbt = Psbt.fromTransaction(Buffer.from(f.transaction, 'hex'))
|
||||
assert.strictEqual(psbt.toBase64(), f.result)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue