Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class DigestStateSpecification extends ErgoCorePropertyTest {
val state = DigestState.create(None, None, dir2, settings)
state.version shouldEqual fb.header.id
state.rootDigest shouldEqual fb.header.stateRoot
state.close()
us.closeStorage()
}
}

Expand Down Expand Up @@ -69,6 +71,8 @@ class DigestStateSpecification extends ErgoCorePropertyTest {

val ds = createDigestState(us.version, us.rootDigest)
ds.applyModifier(block, None)(_ => ()) shouldBe 'success
ds.close()
us.closeStorage()
}
}

Expand Down Expand Up @@ -104,6 +108,9 @@ class DigestStateSpecification extends ErgoCorePropertyTest {
ds3.stateContext.lastHeaders.size shouldEqual 0

ds3.applyModifier(block, None)(_ => ()).get.rootDigest shouldBe ds2.rootDigest

ds.close()
us.closeStorage()
}
}

Expand Down Expand Up @@ -134,6 +141,9 @@ class DigestStateSpecification extends ErgoCorePropertyTest {

val txs3 = IndexedSeq(txWithDataInputs, headTx, nextTx)
ds.validateTransactions(txs3, digest2, proof2, emptyStateContext) shouldBe 'failure

ds.close()
us.closeStorage()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {
bh.take(1000)._1.foreach { box =>
us.boxById(box.id) shouldBe Some(box)
}
us.closeStorage()
}
}

Expand Down Expand Up @@ -244,6 +245,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {

ADProofs.proofDigest(proof1) shouldBe ADProofs.proofDigest(proof2)
digest1 shouldBe digest2
us.closeStorage()
}
}

Expand Down Expand Up @@ -271,6 +273,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {
val correctTransactions = IndexedSeq(txWithDataInputs)
val digest = us.proofsForTransactions(correctTransactions).get._2
us.applyTransactions(correctTransactions, emptyModifierId, digest, emptyStateContext).get
us.closeStorage()
}
}

Expand Down Expand Up @@ -328,6 +331,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {
// proof of non-existence
val d2 = us.proofsForTransactions(txsNext).get._2
us.applyTransactions(txsNext, emptyModifierId, d2, emptyStateContext) shouldBe 'success
us.closeStorage()
}
}

Expand All @@ -348,6 +352,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {
val block = wBlock.copy(header = wBlock.header.copy(height = 1))
val newSC = us.stateContext.appendFullBlock(block).get
us.applyTransactions(txs, emptyModifierId, digest, newSC).get
us.closeStorage()
}
}

Expand All @@ -373,6 +378,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {
val fb = new ErgoFullBlock(header, bt, genExtension(header, us.stateContext), None)
val newSC = us.stateContext.appendFullBlock(fb).get
us.applyTransactions(txs, emptyModifierId, digest, newSC).get
us.closeStorage()
}
}

Expand Down Expand Up @@ -413,6 +419,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {

// Fails on generating state root digest for the block
us.proofsForTransactions(txs).isSuccess shouldBe false
us.closeStorage()
}
}

Expand All @@ -427,6 +434,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {
us.proofsForTransactions(txsFromHolder).isSuccess shouldBe true
val d3 = us.rootDigest
d1.sameElements(d3) shouldBe true
us.closeStorage()
}
}

Expand All @@ -446,6 +454,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {

val us = createUtxoState(bh, parameters)
us.proofsForTransactions(txs).isSuccess shouldBe false
us.closeStorage()
}
}

Expand All @@ -456,6 +465,7 @@ class UtxoStateSpecification extends ErgoCorePropertyTest with OptionValues {

val block = validFullBlock(parentOpt = None, us, bh)
us.applyModifier(block, None)(_ => ()).get
us.closeStorage()
}
}

Expand Down
Loading