Skip to content

Commit

Permalink
Merge pull request #20 from tcharding/02-01-release-beta
Browse files Browse the repository at this point in the history
Release tracking PR: `v0.1.0-beta.0`
  • Loading branch information
tcharding authored Feb 2, 2024
2 parents 470babb + 8ab46ea commit 5bbcff6
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 38 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 0.1.0-beta.0 - 2024-02-02

The initial beta release. The aim of this release is to make the new PSBT v2 API available for beta
testing. Currently we expose the v0 API pretty much as it is in `rust-bitcoin` and `rust-miniscript`.

Enjoy!
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "psbt"
version = "0.1.0"
name = "psbt-v2"
version = "0.1.0-beta.0"
authors = ["Tobin C. Harding <[email protected]>"]
license = "CC0-1.0"
repository = "https://github.com/tcharding/rust-psbt/"
description = "Partially Signed Bitcoin Transaction, v0 and v2"
categories = ["cryptography::cryptocurrencies"]
keywords = [ "crypto", "bitcoin" ]
keywords = [ "bitcoin", "psbt", "bip-174", "bip-370" ]
readme = "README.md"
edition = "2021"
rust-version = "1.56.1"
Expand Down
12 changes: 6 additions & 6 deletions examples/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

use std::collections::BTreeMap;

use psbt::bitcoin::hashes::Hash as _;
use psbt::bitcoin::locktime::absolute;
use psbt::bitcoin::opcodes::all::OP_CHECKMULTISIG;
use psbt::bitcoin::secp256k1::{self, rand, SECP256K1};
use psbt::bitcoin::{
use psbt_v2::bitcoin::hashes::Hash as _;
use psbt_v2::bitcoin::locktime::absolute;
use psbt_v2::bitcoin::opcodes::all::OP_CHECKMULTISIG;
use psbt_v2::bitcoin::secp256k1::{self, rand, SECP256K1};
use psbt_v2::bitcoin::{
script, transaction, Address, Amount, Network, OutPoint, PublicKey, ScriptBuf, Sequence,
Transaction, TxIn, TxOut, Txid, Witness,
};
use psbt::v0::{self, Psbt};
use psbt_v2::v0::{self, Psbt};

pub const DUMMY_UTXO_AMOUNT: Amount = Amount::from_sat(20_000_000);
pub const SPEND_AMOUNT: Amount = Amount::from_sat(20_000_000);
Expand Down
6 changes: 3 additions & 3 deletions examples/v2-separate-creator-constructor.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! PSBT v2 - Creator a PSBT and hand it around to various different entities to add inputs and outputs.

use psbt::bitcoin::hashes::Hash as _;
use psbt::bitcoin::{Amount, OutPoint, ScriptBuf, TxOut, Txid};
use psbt::v2::{
use psbt_v2::bitcoin::hashes::Hash as _;
use psbt_v2::bitcoin::{Amount, OutPoint, ScriptBuf, TxOut, Txid};
use psbt_v2::v2::{
Constructor, Creator, InputBuilder, InputsOnlyModifiable, OutputBuilder, OutputsOnlyModifiable,
Psbt,
};
Expand Down
14 changes: 7 additions & 7 deletions examples/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

use std::str::FromStr;

use psbt::bitcoin::bip32::{DerivationPath, KeySource, Xpriv, Xpub};
use psbt::bitcoin::hashes::Hash as _;
use psbt::bitcoin::locktime::absolute;
use psbt::bitcoin::opcodes::all::OP_CHECKMULTISIG;
use psbt::bitcoin::secp256k1::{self, SECP256K1};
use psbt::bitcoin::{
use psbt_v2::bitcoin::bip32::{DerivationPath, KeySource, Xpriv, Xpub};
use psbt_v2::bitcoin::hashes::Hash as _;
use psbt_v2::bitcoin::locktime::absolute;
use psbt_v2::bitcoin::opcodes::all::OP_CHECKMULTISIG;
use psbt_v2::bitcoin::secp256k1::{self, SECP256K1};
use psbt_v2::bitcoin::{
script, Address, Amount, Network, OutPoint, PublicKey, ScriptBuf, Sequence, TxOut, Txid,
};
use psbt::v2::{
use psbt_v2::v2::{
self, Constructor, InputBuilder, Modifiable, Output, OutputBuilder, Psbt, Signer, Updater,
};

Expand Down
2 changes: 1 addition & 1 deletion src/v0/miniscript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ trait PsbtFields {
// `tap_tree` only appears in Output, so it's returned as an option of a mutable ref
fn tap_tree(&mut self) -> Option<&mut Option<TapTree>> { None }

// `tap_scripts` and `tap_merkle_root` only appear in psbt::Input
// `tap_scripts` and `tap_merkle_root` only appear in psbt_v2::Input
fn tap_scripts(&mut self) -> Option<&mut BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>> {
None
}
Expand Down
6 changes: 3 additions & 3 deletions src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl Creator {
/// # Examples
///
/// ```
/// use psbt::v2::{Creator, Constructor, Modifiable};
/// use psbt_v2::v2::{Creator, Constructor, Modifiable};
///
/// // Creator role separate from Constructor role.
/// let psbt = Creator::new()
Expand All @@ -170,7 +170,7 @@ impl Creator {
/// # Examples
///
/// ```
/// use psbt::v2::{Creator, Constructor, InputsOnlyModifiable};
/// use psbt_v2::v2::{Creator, Constructor, InputsOnlyModifiable};
///
/// // Creator role separate from Constructor role.
/// let psbt = Creator::new()
Expand All @@ -196,7 +196,7 @@ impl Creator {
/// # Examples
///
/// ```
/// use psbt::v2::{Creator, Constructor, OutputsOnlyModifiable};
/// use psbt_v2::v2::{Creator, Constructor, OutputsOnlyModifiable};
///
/// // Creator role separate from Constructor role.
/// let psbt = Creator::new()
Expand Down
2 changes: 1 addition & 1 deletion tests/bip174-signer-checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod util;

use std::str::FromStr;

use psbt::v0;
use psbt_v2::v0;

#[track_caller]
fn assert_fails_signer_checks_v0(hex: &str, base64: &str) {
Expand Down
20 changes: 10 additions & 10 deletions tests/bip174.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::str::FromStr;

use psbt::bitcoin::bip32::{Fingerprint, IntoDerivationPath, KeySource, Xpriv, Xpub};
use psbt::bitcoin::blockdata::opcodes::OP_0;
use psbt::bitcoin::blockdata::{script, transaction};
use psbt::bitcoin::consensus::encode::{deserialize, serialize_hex};
use psbt::bitcoin::hex::FromHex;
use psbt::bitcoin::script::PushBytes;
use psbt::bitcoin::secp256k1::{self, Secp256k1};
use psbt::bitcoin::{
use psbt_v2::bitcoin::bip32::{Fingerprint, IntoDerivationPath, KeySource, Xpriv, Xpub};
use psbt_v2::bitcoin::blockdata::opcodes::OP_0;
use psbt_v2::bitcoin::blockdata::{script, transaction};
use psbt_v2::bitcoin::consensus::encode::{deserialize, serialize_hex};
use psbt_v2::bitcoin::hex::FromHex;
use psbt_v2::bitcoin::script::PushBytes;
use psbt_v2::bitcoin::secp256k1::{self, Secp256k1};
use psbt_v2::bitcoin::{
absolute, Amount, Denomination, Network, OutPoint, PrivateKey, PublicKey, ScriptBuf, Sequence,
Transaction, TxIn, TxOut, Witness,
};
use psbt::v0::{self, Psbt};
use psbt::PsbtSighashType;
use psbt_v2::v0::{self, Psbt};
use psbt_v2::PsbtSighashType;

const NETWORK: Network = Network::Testnet;

Expand Down
4 changes: 2 additions & 2 deletions tests/bip370-determine-lock-time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ mod util;

use core::str::FromStr;

use psbt::bitcoin::locktime::absolute;
use psbt::v2;
use psbt_v2::bitcoin::locktime::absolute;
use psbt_v2::v2;

#[track_caller]
fn assert_determine_lock_time(hex: &str, base64: &str, want: absolute::LockTime) {
Expand Down
4 changes: 2 additions & 2 deletions tests/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use core::str::FromStr;

use psbt::bitcoin::hex::{self, FromHex};
use psbt::{v0, v2};
use psbt_v2::bitcoin::hex::{self, FromHex};
use psbt_v2::{v0, v2};

#[track_caller]
pub fn hex_psbt_v0(s: &str) -> Result<v0::Psbt, v0::DeserializeError> {
Expand Down

0 comments on commit 5bbcff6

Please sign in to comment.