Skip to content

Commit

Permalink
Merge pull request #258 from 0xcregis/257-fix-bitcoin-decode-fails-on…
Browse files Browse the repository at this point in the history
…-sighash-deserialization

fix: bitcoin decode fails on sighash deserialization
  • Loading branch information
loki-cmu authored Jul 26, 2024
2 parents 7621dd6 + 99169fa commit ee173fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion anychain-bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "anychain-bitcoin"
description = "A Rust library for Bitcoin-focused cryptocurrency wallets, enabling seamless transactions on the Bitcoin blockchain"
version = "0.1.6"
version = "0.1.7"
keywords = ["bitcoin", "blockchain", "cryptocurrencies", "wallet", "transactions"]

# Workspace inherited keys
Expand Down
3 changes: 1 addition & 2 deletions anychain-bitcoin/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ impl fmt::Display for SignatureHash {
impl SignatureHash {
pub fn from_byte(byte: &u8) -> Self {
match byte {
0x01 => SignatureHash::SIGHASH_ALL,
0x02 => SignatureHash::SIGHASH_NONE,
0x03 => SignatureHash::SIGHASH_SINGLE,
0x41 => SignatureHash::SIGHASH_ALL_SIGHASH_FORKID,
Expand All @@ -290,7 +289,7 @@ impl SignatureHash {
0xc1 => SignatureHash::SIGHASH_ALL_SIGHASH_FORKID_SIGHASH_ANYONECANPAY,
0xc2 => SignatureHash::SIGHASH_NONE_SIGHASH_FORKID_SIGHASH_ANYONECANPAY,
0xc3 => SignatureHash::SIGHASH_SINGLE_SIGHASH_FORKID_SIGHASH_ANYONECANPAY,
_ => panic!("Unrecognized signature hash"),
_ => SignatureHash::SIGHASH_ALL,
}
}
}
Expand Down

0 comments on commit ee173fd

Please sign in to comment.