use of org.bitcoinj.core.Transaction.SigHash in project balzac by balzac-lang.
the class ScriptBuilder2Test method test_serialize_signature1.
@Test
public void test_serialize_signature1() {
ECKey key = new ECKey();
SigHash hashType = SigHash.ALL;
ScriptBuilder2 sb = new ScriptBuilder2();
sb.number(15);
sb.signaturePlaceholder(key, hashType, false);
String expected = "15 [sig," + ECKeyStore.getUniqueID(key) + ",**]";
String actual = sb.serialize();
assertEquals(expected, actual);
}
use of org.bitcoinj.core.Transaction.SigHash in project balzac by balzac-lang.
the class ScriptBuilder2Test method test_serialize_signature2.
@Test
public void test_serialize_signature2() {
ECKey key = new ECKey();
SigHash hashType = SigHash.ALL;
ScriptBuilder2 sb = new ScriptBuilder2();
sb.number(15);
sb.signaturePlaceholder(key, hashType, true);
String expected = "15 [sig," + ECKeyStore.getUniqueID(key) + ",1*]";
String actual = sb.serialize();
assertEquals(expected, actual);
}
use of org.bitcoinj.core.Transaction.SigHash in project balzac by balzac-lang.
the class ScriptBuilder2Test method test_serialize_signature6.
@Test
public void test_serialize_signature6() {
ECKey key = new ECKey();
SigHash hashType = SigHash.NONE;
ScriptBuilder2 sb = new ScriptBuilder2();
sb.number(15);
sb.signaturePlaceholder(key, hashType, true);
String expected = "15 [sig," + ECKeyStore.getUniqueID(key) + ",10]";
String actual = sb.serialize();
assertEquals(expected, actual);
}
use of org.bitcoinj.core.Transaction.SigHash in project balzac by balzac-lang.
the class ScriptBuilder2Test method test_serialize_signature4.
@Test
public void test_serialize_signature4() {
ECKey key = new ECKey();
SigHash hashType = SigHash.SINGLE;
ScriptBuilder2 sb = new ScriptBuilder2();
sb.number(15);
sb.signaturePlaceholder(key, hashType, true);
String expected = "15 [sig," + ECKeyStore.getUniqueID(key) + ",11]";
String actual = sb.serialize();
assertEquals(expected, actual);
}
use of org.bitcoinj.core.Transaction.SigHash in project balzac by balzac-lang.
the class ScriptBuilder2Test method test_serialize_signature3.
@Test
public void test_serialize_signature3() {
ECKey key = new ECKey();
SigHash hashType = SigHash.SINGLE;
ScriptBuilder2 sb = new ScriptBuilder2();
sb.number(15);
sb.signaturePlaceholder(key, hashType, false);
String expected = "15 [sig," + ECKeyStore.getUniqueID(key) + ",*1]";
String actual = sb.serialize();
assertEquals(expected, actual);
}
Aggregations