| 513 | } |
| 514 | |
| 515 | Hash cn::get_transaction_hash(const Transaction &tx) { |
| 516 | if (tx.version >= parameters::TRANSACTION_VERSION_AMETHYST) { |
| 517 | std::pair<Hash, Hash> ha; |
| 518 | ha.first = get_transaction_prefix_hash(tx); |
| 519 | BinaryArray binary_sigs = seria::to_binary(tx.signatures, static_cast<const TransactionPrefix &>(tx)); |
| 520 | ha.second = crypto::cn_fast_hash(binary_sigs.data(), binary_sigs.size()); |
| 521 | BinaryArray ba = seria::to_binary(ha); |
| 522 | // BinaryArray tx_body = seria::to_binary(static_cast<const TransactionPrefix&>(tx)); |
| 523 | // common::append(tx_body, binary_sigs); |
| 524 | // invariant(tx_body == seria::to_binary(tx), ""); |
| 525 | return crypto::cn_fast_hash(ba.data(), ba.size()); |
| 526 | } |
| 527 | BinaryArray ba = seria::to_binary(tx); |
| 528 | return crypto::cn_fast_hash(ba.data(), ba.size()); |
| 529 | } |
| 530 | |
| 531 | Hash cn::get_block_hash(const BlockHeader &bh, const BlockBodyProxy &body_proxy) { |
| 532 | // get_object_hash prepends array size before hashing. |
nothing calls this directly
no test coverage detected