Skip to content

Commit d2a32d5

Browse files
committed
add unit test for hasWitnessSignature
1 parent e887c0e commit d2a32d5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/org/tron/core/capsule/BlockCapsuleTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ public void testGetInsHash() {
119119
Sha256Hash.wrap(blockCapsule0.getParentHashStr()));
120120
}
121121

122+
@Test
123+
public void testHasWitnessSignature() {
124+
125+
Assert.assertFalse(blockCapsule0.hasWitnessSignature());
126+
blockCapsule0
127+
.sign(ByteArray.fromHexString(Args.getInstance().getLocalWitnesses().getPrivateKey()));
128+
Assert.assertTrue(blockCapsule0.hasWitnessSignature());
129+
}
130+
122131
@Test
123132
public void testGetTimeStamp() {
124133
Assert.assertEquals(1234L, blockCapsule0.getTimeStamp());

0 commit comments

Comments
 (0)