Page MenuHomePhabricator

[Chronik] Refactor: Add `HashOrHeight` enum
ClosedPublic

Authored by tobias_ruck on May 3 2023, 22:38.

Details

Reviewers
Fabien
PiRK
Group Reviewers
Restricted Project
Commits
rABCf187d27d4ec5: [Chronik] Refactor: Add `HashOrHeight` enum
Summary

Factors out the parsing of a string that's either a hash or height, so we can use it elsewhere.

Test Plan

ninja check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-refactor-hashorheight
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23633
Build 46880: Build Diffbuild-chronik
Build 46879: arc lint + arc unit

Event Timeline

Tail of the build log:

   Doc-tests bitcoinsuite-core

running 51 tests
test src/hash.rs - hash::Hashed::SIZE (line 47) ... ok
test src/hash.rs - hash::Hashed::Array (line 60) ... ok
test src/block/block_hash.rs - block::block_hash::BlockHash::to_vec (line 46) ... ok
test src/block/block_hash.rs - block::block_hash::BlockHash::to_bytes (line 31) ... ok
test src/hash.rs - hash::Hashed::from_be_bytes (line 93) ... ok
test src/hash.rs - hash::Hashed::from_le_bytes (line 73) ... ok
test src/hash.rs - hash::Hashed::from_be_hex (line 288) ... ok
test src/hash.rs - hash::Hashed::as_le_bytes (line 83) ... ok
test src/hash.rs - hash::Hashed::from_be_slice (line 234) ... ok
test src/hash.rs - hash::Hashed::from_le_hex (line 259) ... ok
test src/bytes.rs - bytes::read_bytes (line 19) ... ok
test src/bytes.rs - bytes::read_array (line 55) ... ok
test src/hash.rs - hash::Hashed::hex_be (line 160) ... ok
test src/hash.rs - hash::Hashed::from_le_slice (line 212) ... ok
test src/hash.rs - hash::Hashed::hex_le (line 138) ... ok
test src/hash.rs - hash::Hashed::to_be_bytes (line 120) ... ok
test src/hash.rs - hash::Hashed::to_be_vec (line 195) ... ok
test src/script/opcode.rs - script::opcode::Opcode (line 12) ... ok
test src/script/opcode.rs - script::opcode::Opcode::number (line 75) ... ok
test src/hash.rs - hash::Hashed::to_le_vec (line 178) ... ok
test src/script/pubkey.rs - script::pubkey::PubKey::array (line 47) ... ok
test src/script/opcode.rs - script::opcode::opcode_number_to_name (line 86) ... ok
test src/script/pubkey.rs - script::pubkey::PubKey (line 13) ... ok
test src/hash.rs - hash::Hashed::to_le_bytes (line 108) ... ok
test src/script/pubkey.rs - script::pubkey::PubKey::as_slice (line 37) ... ok
test src/script/pubkey.rs - script::pubkey::PubKey::hex (line 57) ... ok
test src/script/script.rs - script::script::Script::bytecode (line 118) ... ok
test src/script/script.rs - script::script::Script::p2pk (line 68) ... ok
test src/script/script.rs - script::script::Script::is_opreturn (line 151) ... ok
test src/script/pubkey_variant.rs - script::pubkey_variant::PubKeyVariant (line 14) ... ok
test src/script/script.rs - script::script::Script::hex (line 140) ... ok
test src/script/script.rs - script::script::Script::iter_ops (line 166) ... ok
test src/script/script.rs - script::script::Script::p2pk_uncompressed (line 90) ... ok
test src/script/script.rs - script::script::Script::p2sh (line 48) ... ok
test src/script/script.rs - script::script::Script::p2pkh (line 28) ... ok
test src/script/script.rs - script::script::Script::to_vec (line 129) ... ok
test src/tx/tx.rs - tx::tx::Tx (line 33) - compile fail ... ok
test src/script/script_mut.rs - script::script_mut::ScriptMut::put_bytecode (line 41) ... ok
test src/script/script_mut.rs - script::script_mut::ScriptMut::freeze (line 52) ... ok
test src/script/variant.rs - script::variant::ScriptVariant::from_type_and_payload (line 94) ... ok
test src/script/script_mut.rs - script::script_mut::ScriptMut::put_opcodes (line 25) ... ok
test src/script/script_mut.rs - script::script_mut::ScriptMut::with_capacity (line 14) ... ok
test src/script/uncompressed_pubkey.rs - script::uncompressed_pubkey::UncompressedPubKey (line 13) ... ok
test src/script/uncompressed_pubkey.rs - script::uncompressed_pubkey::UncompressedPubKey::array (line 50) ... ok
test src/script/uncompressed_pubkey.rs - script::uncompressed_pubkey::UncompressedPubKey::hex (line 60) ... ok
test src/script/uncompressed_pubkey.rs - script::uncompressed_pubkey::UncompressedPubKey::as_slice (line 40) ... ok
test src/tx/tx.rs - tx::tx::Tx (line 13) ... ok
test src/tx/txid.rs - tx::txid::TxId::as_bytes (line 47) ... ok
test src/script/variant.rs - script::variant::ScriptVariant::to_script (line 108) ... ok
test src/tx/txid.rs - tx::txid::TxId::to_vec (line 62) ... ok
test src/tx/txid.rs - tx::txid::TxId::to_bytes (line 32) ... ok

test result: ok. 51 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.52s

ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1
This revision is now accepted and ready to land.May 4 2023, 08:31

fix build by removing unused import