use of org.tron.core.capsule.TransactionCapsule in project java-tron by tronprotocol.
the class TransactionStoreTest method init.
@BeforeClass
public static void init() {
Args.setParam(new String[] { "-d", dbPath, "-w" }, Configuration.getByPath(Constant.TEST_CONF));
transactionStore = TransactionStore.create(dbPath);
TransactionCapsule transactionCapsule = new TransactionCapsule(key, value);
transactionStore.put(data, transactionCapsule);
}
use of org.tron.core.capsule.TransactionCapsule in project java-tron by tronprotocol.
the class TransactionStoreTest method findTransactionByHash.
@Test
public void findTransactionByHash() {
// test findTransactionByHash method
TransactionCapsule transactionCapsuleByHash = new TransactionCapsule(transactionStore.findTransactionByHash(data));
Assert.assertEquals(key, ByteArray.toHexString(transactionCapsuleByHash.getInstance().getRawData().getVoutList().get(0).getPubKeyHash().toByteArray()));
Assert.assertEquals(value, transactionCapsuleByHash.getInstance().getRawData().getVoutList().get(0).getValue());
}
Aggregations