def test_TestTransactionHash(): handle, _ = utils.makeTransaction() h = skycoin.cipher_SHA256() h2 = skycoin.cipher_SHA256() assert skycoin.SKY_coin_Transaction_Hash(handle, h) == skycoin.SKY_OK assert h != h2 assert skycoin.SKY_coin_Transaction_HashInner( handle, h2) == skycoin.SKY_OK assert h != h2
def test_TestTransactionsHashes(): handle = utils.makeTransactions(4) err, hashes = skycoin.SKY_coin_Transactions_Hashes(handle) assert err == skycoin.SKY_OK len_hashes = len(hashes) assert len_hashes == 4 for i in range(len_hashes): err, tx = skycoin.SKY_coin_Transactions_GetAt(handle, i) assert err == skycoin.SKY_OK h = skycoin.cipher_SHA256() assert skycoin.SKY_coin_Transaction_Hash(tx, h) == skycoin.SKY_OK assert h == hashes[i] i += 1