Skip to content

Commit

Permalink
fix: update InstantAssetLockProof to support ISDLOCK
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Jul 29, 2023
1 parent 6b06121 commit 90bcda0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InstantAssetLockProof(
Converters.byteArrayFromBase64orByteArray(
rawAssetLockProof["instantLock"] ?: error("missing instantLock field")
),
InstantSendLock.ISLOCK_VERSION // Core 0.17
InstantSendLock.ISDLOCK_VERSION // Core 0.17
)
)

Expand Down
5 changes: 4 additions & 1 deletion src/test/kotlin/org/dashj/platform/dpp/Fixtures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ object Fixtures {
fun getInstantAssetLockProofFixture(oneTimePrivateKey: ECKey = ECKey()): InstantAssetLockProof {
val privateKeyHex = "cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY"
val privateKey = DumpedPrivateKey.fromBase58(PARAMS, privateKeyHex).key
val oneTimePublicKey = ECKey()

val transaction = Transaction(PARAMS)
transaction.addInput(
Expand All @@ -277,7 +278,8 @@ object Fixtures {
0, ScriptBuilder.createP2PKHOutputScript(privateKey)
)

transaction.addOutput(Coin.valueOf(90000), ScriptBuilder.createCreditBurnOutput(oneTimePrivateKey))
transaction.addOutput(Coin.COIN, ScriptBuilder.createCreditBurnOutput(oneTimePrivateKey))
transaction.addOutput(Coin.valueOf(5000), oneTimePublicKey)
transaction.addOutput(Coin.valueOf(5000), ScriptBuilder().op(OP_RETURN).data(byteArrayOf(1, 2, 3)).build())
transaction.addSignedInput(
TransactionOutPoint(
Expand All @@ -302,6 +304,7 @@ object Fixtures {
)
),
transaction.txId,
Sha256Hash.wrap("7c30826123d0f29fe4c4a8895d7ba4eb469b1fafa6ad7b23896a1a591766a536"),
BLSLazySignature(
PARAMS,
Converters.fromHex(
Expand Down

0 comments on commit 90bcda0

Please sign in to comment.