Skip to content

Refactor - Addresses (usages) #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ef05c3a
Add a macro for defining custom error types
DaMatrix May 24, 2024
1831f38
support errors with per-variant attributes
DaMatrix Jun 6, 2024
1101dd4
macros: make_error_type supports struct-like enums as well as tuple e…
DaMatrix Jun 21, 2024
15bf1b7
add traits for generating placeholder values for use in tests
DaMatrix Jun 26, 2024
8d30367
utils: add dedicated modules for serializing and deserializing arrays
DaMatrix May 17, 2024
7097e54
Add a struct for representing fixed-length byte arrays
DaMatrix May 29, 2024
4be53f5
serialize_utils: implement From<&[u8; N]> for FixedByteArray
DaMatrix May 29, 2024
37b51fa
macros: add traits for generating simple enums
DaMatrix Jul 11, 2024
87f48d6
always use fully-qualified name for bincode (de)serialize functions
DaMatrix Jun 3, 2024
feef369
Upgrade to bincode 2
DaMatrix Jun 6, 2024
36409d5
serialize_utils: add a bunch of helper methods
DaMatrix Jul 11, 2024
4af4e52
Merge branch 'refactor/macros' into refactor/addresses
DaMatrix Jul 11, 2024
0e148be
PlaceholderIndexed -> PlaceholderSeed
DaMatrix Jul 11, 2024
dcfa232
crypto: add a dedicated wrapper struct for SHA3-256 hashes
DaMatrix Jul 11, 2024
1bde7e5
Merge branch 'refactor/serialize-utils' into refactor/crypto
DaMatrix Jul 11, 2024
1a7fd05
Implement all crypto structs using FixedByteArray
DaMatrix May 29, 2024
74aa820
crypto: improve keypair generation
DaMatrix Jul 11, 2024
675e0eb
crypto: add tests for object serialization
DaMatrix Jul 12, 2024
cee07d9
Merge branch 'refactor/bincode-2' into refactor/addresses
DaMatrix Jul 12, 2024
ec9a978
Merge branch 'refactor/crypto' into refactor/addresses
DaMatrix Jul 12, 2024
305f340
Add dedicated structs for addresses
DaMatrix Jul 11, 2024
d73c25b
script: use bytes instead of strings
DaMatrix May 21, 2024
5bc9cc0
remove v0 and temp address types
DaMatrix May 21, 2024
f5411dc
Completely disable all P2SH code
DaMatrix Jul 18, 2024
cfe3373
Merge branch 'refactor/disable-p2sh' into refactor/addresses-usages
DaMatrix Jul 18, 2024
d13bc44
Merge branch 'refactor/no-address-version' into refactor/addresses-us…
DaMatrix Jul 18, 2024
1e12e03
transaction: Make TxOut not implement Default
DaMatrix Jul 18, 2024
744b85b
transaction: Change TxOut.script_public_key to AnyAddress
DaMatrix Jul 18, 2024
5dfa5bc
druid: Make DruidExpectation no longer implement Default
DaMatrix Jul 18, 2024
c062b9f
druid: Change DruidExpectation.to to AnyAddress
DaMatrix Jul 18, 2024
921a004
transaction_utils: Change ReceiverInfo.address to AnyAddress
DaMatrix Jul 18, 2024
b314b07
script_utils: Change tx_has_valid_p2pkh_sig to use &P2PKHAddress
DaMatrix Jul 18, 2024
103cb2c
Prefer P2PKHAddress::from_pubkey over transaction_utils::construct_ad…
DaMatrix Jul 18, 2024
e753cfd
transaction_utils: Make construct_tx_ins_address return TxInsAddress
DaMatrix Jul 18, 2024
dea460a
druid: Change DruidExpectation.from to TxInsAddress
DaMatrix Jul 18, 2024
fe23251
Merge remote-tracking branch 'upstream/develop' into refactor/no-addr…
DaMatrix Aug 2, 2024
97d7b32
Merge branch 'refactor/no-address-version' into refactor/addresses-us…
DaMatrix Aug 2, 2024
06e3bbe
refactor/address-usages: fix build after merge
DaMatrix Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = ["**/tests/**", "**/examples/**", "**/benchmarks/**", "docs/**", ".hoo
[dependencies]
actix-rt = "2.8.0"
base64 = "0.20.0"
bincode = "1.3.3"
bincode = { version = "2.0.0-rc.3", features = ["serde"] }
bytes = "1.4.0"
colored = { version = "2.1.0", optional = true }
hex = "0.4.3"
Expand Down
12 changes: 0 additions & 12 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub const MAX_METADATA_BYTES: usize = 800;
pub const TX_HASH_LENGTH: usize = 32;

/*------- ADDRESS CONSTANTS -------*/
pub const V0_ADDRESS_LENGTH: usize = 16;
pub const STANDARD_ADDRESS_LENGTH: usize = 64;
// Prepending character for a P2SH address
pub const P2SH_PREPEND: u8 = b'H';
Expand All @@ -14,11 +13,6 @@ pub const P2SH_PREPEND: u8 = b'H';
// Current network version: Always bump immediately after a version is deployed.
pub const NETWORK_VERSION: u32 = 6;
pub const NETWORK_VERSION_SERIALIZED: &[u8] = b"6";
// Network version 0
pub const NETWORK_VERSION_V0: u64 = 0;
// Network version to support temporary address structure on wallet
// TODO: Deprecate after addresses retire
pub const NETWORK_VERSION_TEMP: u64 = 99999;

/*------- VALUE HANDLING CONSTANTS --------*/
// Number of decimal places to divide to in display
Expand Down Expand Up @@ -229,8 +223,6 @@ pub const OPWITHIN_DESC: &str = "Substitutes the three numbers on top of the the
// crypto
pub const OPSHA3: &str = "OP_SHA3";
pub const OPHASH256: &str = "OP_HASH256";
pub const OPHASH256V0: &str = "OP_HASH256_V0";
pub const OPHASH256TEMP: &str = "OP_HASH256_TEMP";
pub const OPCHECKSIG: &str = "OP_CHECKSIG";
pub const OPCHECKSIGVERIFY: &str = "OP_CHECKSIGVERIFY";
pub const OPCHECKMULTISIG: &str = "OP_CHECKMULTISIG";
Expand All @@ -239,10 +231,6 @@ pub const OPCHECKMULTISIGVERIFY: &str = "OP_CHECKMULTISIGVERIFY";
pub const OPSHA3_DESC: &str = "Hashes the top item on the stack using SHA3-256";
pub const OPHASH256_DESC: &str =
"Creates standard address from public key and pushes it onto the stack";
pub const OPHASH256V0_DESC: &str =
"Creates v0 address from public key and pushes it onto the stack";
pub const OPHASH256TEMP_DESC: &str =
"Creates temporary address from public key and pushes it onto the stack";
pub const OPCHECKSIG_DESC: &str =
"Pushes ONE onto the stack if the signature is valid, ZERO otherwise";
pub const OPCHECKSIGVERIFY_DESC: &str = "Runs OP_CHECKSIG and OP_VERIFY in sequence";
Expand Down
Loading