Skip to content

Commit

Permalink
Merge branch 'commitment-redeem-wid' into 'dev'
Browse files Browse the repository at this point in the history
Commitment redeem wid

See merge request ergo/rosen-bridge/contract!84
  • Loading branch information
vorujack committed Feb 11, 2024
2 parents 39b5b59 + 1927690 commit 43f54b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/rosen/bridge/scripts/Commitment.es
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
// check WID copied
OUTPUTS(0).R4[Coll[Byte]].get == myWID,
// check user WID
INPUTS(1).tokens(0)._1 == myWID,
OUTPUTS(1).tokens(0)._1 == myWID,
// check permit contract address
blake2b256(OUTPUTS(0).propositionBytes) == SELF.R7[Coll[Byte]].get
)
Expand Down
3 changes: 2 additions & 1 deletion src/test/scala/contracts/ContractTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1196,10 +1196,11 @@ class ContractTest extends TestSuite {
val commitmentBox = Boxes.createCommitment(ctx, WID, commitment.requestId(), commitment.hash(WID), 1l).convertToInputWith(Boxes.getRandomHexString(), 1)
val box = Boxes.createBoxForUser(ctx, prover.getAddress, 1e9.toLong, new ErgoToken(WID, 1L))
val newPermit = Boxes.createPermitBox(ctx, 1, WID)
val WIDOut = Boxes.createBoxCandidateForUser(ctx, prover.getAddress, 1e8.toLong, new ErgoToken(WID, 1))
val inputs = Seq(commitmentBox, box)
val redeemUnsigned = ctx.newTxBuilder().addInputs(inputs: _*)
.fee(Configs.fee)
.addOutputs(newPermit)
.addOutputs(newPermit, WIDOut)
.sendChangeTo(prover.getAddress)
.build()
prover.sign(redeemUnsigned)
Expand Down

0 comments on commit 43f54b9

Please sign in to comment.