Skip to content

Commit 41f9b20

Browse files
committed
Multisig: Added test for address order stability
1 parent bad8317 commit 41f9b20

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib-impl/src/test/java/org/ergoplatform/appkit/impl/MultisigAddressTests.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ class MultisigAddressTests extends PropSpec with Matchers with ScalaCheckDrivenP
3838
}
3939
}
4040

41+
property("address order stability") {
42+
// do create a multisig address, convert to Address and back
43+
forAll(thresholdGen, MinSuccessful(50)) { threshold: CTHRESHOLD =>
44+
val addresses = threshold.children.map(Address.fromSigmaBoolean(_, NetworkType.MAINNET))
45+
val multisigAddress = MultisigAddress.buildFromParticipants(
46+
threshold.k,
47+
addresses.asJava,
48+
NetworkType.MAINNET)
49+
50+
val multisigAddress2 = MultisigAddress.buildFromParticipants(
51+
threshold.k,
52+
addresses.reverse.asJava,
53+
NetworkType.MAINNET)
54+
55+
multisigAddress.getAddress shouldBe multisigAddress2.getAddress
56+
}
57+
}
58+
4159
property("fromAddress negative") {
4260
// check that fromAddress fails on non-P2S addresses
4361
forAll(proveDlogGen) { dlog: ProveDlog =>

0 commit comments

Comments
 (0)