crate::ix!();
pub const DEFAULT_ACCEPT_DATACARRIER: bool = true;
pub struct ScriptID {
base: BaseHash<u160>,
}
impl Default for ScriptID {
fn default() -> Self {
todo!();
}
}
impl From<&u160> for ScriptID {
fn from(in_: &u160) -> Self {
todo!();
}
}
impl From<&Script> for ScriptID {
fn from(in_: &Script) -> Self {
todo!();
}
}
impl From<&ScriptHash> for ScriptID {
fn from(in_: &ScriptHash) -> Self {
todo!();
}
}
pub const MAX_OP_RETURN_RELAY: u32 = 83;
lazy_static!{
}
lazy_static!{
}
#[derive(PartialEq,Eq,PartialOrd,Ord,Clone,Debug)]
pub enum TxoutType {
NONSTANDARD,
PUBKEY,
PUBKEYHASH,
SCRIPTHASH,
MULTISIG,
NULL_DATA,
WITNESS_V0_SCRIPTHASH,
WITNESS_V0_KEYHASH,
WITNESS_V1_TAPROOT,
WITNESS_UNKNOWN,
}
pub struct NoDestination { }
impl PartialEq<NoDestination> for NoDestination {
#[inline] fn eq(&self, other: &NoDestination) -> bool {
todo!();
}
}
impl Eq for NoDestination {}
impl Ord for NoDestination {
#[inline] fn cmp(&self, other: &NoDestination) -> Ordering {
todo!();
}
}
impl PartialOrd<NoDestination> for NoDestination {
#[inline] fn partial_cmp(&self, other: &NoDestination) -> Option<Ordering> {
Some(self.cmp(other))
}
}
pub struct PKHash {
base: BaseHash<u160>,
}
impl Default for PKHash {
fn default() -> Self {
todo!();
}
}
impl From<&u160> for PKHash {
fn from(hash: &u160) -> Self {
todo!();
}
}
pub struct ScriptHash {
base: BaseHash<u160>,
}
impl Default for ScriptHash {
fn default() -> Self {
todo!();
}
}
impl From<&u160> for ScriptHash {
fn from(hash: &u160) -> Self {
todo!();
}
}
pub struct WitnessV0ScriptHash {
base: BaseHash<u256>,
}
impl Default for WitnessV0ScriptHash {
fn default() -> Self {
todo!();
}
}
impl From<&u256> for WitnessV0ScriptHash {
fn from(hash: &u256) -> Self {
todo!();
}
}
pub struct WitnessV0KeyHash {
base: BaseHash<u160>,
}
impl Default for WitnessV0KeyHash {
fn default() -> Self {
todo!();
}
}
impl From<&u160> for WitnessV0KeyHash {
fn from(hash: &u160) -> Self {
todo!();
}
}
pub struct WitnessV1Taproot {
base: XOnlyPubKey,
}
impl Default for WitnessV1Taproot {
fn default() -> Self {
todo!();
}
}
impl From<&XOnlyPubKey> for WitnessV1Taproot {
fn from(xpk: &XOnlyPubKey) -> Self {
todo!();
}
}
pub struct WitnessUnknown {
version: u32,
length: u32,
program: [u8; 40],
}
impl PartialEq<WitnessUnknown> for WitnessUnknown {
#[inline] fn eq(&self, other: &WitnessUnknown) -> bool {
todo!();
}
}
impl Eq for WitnessUnknown {}
impl Ord for WitnessUnknown {
#[inline] fn cmp(&self, other: &WitnessUnknown) -> Ordering {
todo!();
}
}
impl PartialOrd<WitnessUnknown> for WitnessUnknown {
#[inline] fn partial_cmp(&self, other: &WitnessUnknown) -> Option<Ordering> {
Some(self.cmp(other))
}
}
pub enum TxDestination {
NoDestination(NoDestination),
PKHash(PKHash),
ScriptHash(ScriptHash),
WitnessV0ScriptHash(WitnessV0ScriptHash),
WitnessV0KeyHash(WitnessV0KeyHash),
WitnessV1Taproot(WitnessV1Taproot),
WitnessUnknown(WitnessUnknown)
}
pub struct ShortestVectorFirstComparator { }
impl ShortestVectorFirstComparator {
pub fn invoke(&self,
a: &Vec<u8>,
b: &Vec<u8>) -> bool {
todo!();
}
}
#[derive(Default)]
pub struct TaprootSpendData {
internal_key: XOnlyPubKey,
merkle_root: u256,
scripts: HashMap<(Script,i32),HashSet<Vec<u8>,ShortestVectorFirstComparator>>,
}
impl TaprootSpendData {
pub fn merge(&mut self, other: TaprootSpendData) {
todo!();
}
}
pub struct TaprootBuilder {
valid: bool,
branch: Vec<Option<taproot_builder::NodeInfo>>,
internal_key: XOnlyPubKey,
output_key: XOnlyPubKey,
parity: bool,
}
pub mod taproot_builder {
use super::*;
pub struct LeafInfo
{
script: Script,
leaf_version: i32,
merkle_branch: Vec<u256>,
}
pub struct NodeInfo {
hash: u256,
leaves: Vec<LeafInfo>,
}
}
impl TaprootBuilder {
pub fn is_valid(&self) -> bool {
todo!();
}
pub fn is_complete(&self) -> bool {
todo!();
}
}
pub type ValType = Vec<u8>;
lazy_static!{
}
impl From<&Script> for ScriptHash {
fn from(in_: &Script) -> Self {
todo!();
}
}
impl From<&ScriptID> for ScriptHash {
fn from(in_: &ScriptID) -> Self {
todo!();
}
}
impl From<&PubKey> for PKHash {
fn from(pubkey: &PubKey) -> Self {
todo!();
}
}
impl From<&KeyID> for PKHash {
fn from(pubkey_id: &KeyID) -> Self {
todo!();
}
}
impl From<&PubKey> for WitnessV0KeyHash {
fn from(pubkey: &PubKey) -> Self {
todo!();
}
}
impl From<&PKHash> for WitnessV0KeyHash {
fn from(pubkey_hash: &PKHash) -> Self {
todo!();
}
}
impl Into<KeyID> for PKHash {
fn into(self) -> KeyID {
todo!();
}
}
impl Into<KeyID> for WitnessV0KeyHash {
fn into(self) -> KeyID {
todo!();
}
}
impl From<&Script> for WitnessV0ScriptHash {
fn from(in_: &Script) -> Self {
todo!();
}
}
pub fn get_txn_output_type(t: TxoutType) -> String {
todo!();
}
pub fn match_pay_to_pubkey(
script: &Script,
pubkey: &mut ValType) -> bool {
todo!();
}
pub fn match_pay_to_pubkey_hash(
script: &Script,
pubkeyhash: &mut ValType) -> bool {
todo!();
}
pub fn is_small_integer(opcode: OpcodeType) -> bool {
todo!();
}
pub fn is_pushdata_op(opcode: OpcodeType) -> bool {
todo!();
}
pub fn is_valid_multisig_key_count(n_keys: i32) -> bool {
todo!();
}
pub fn get_multisig_key_count(
opcode: OpcodeType,
data: ValType,
count: &mut i32) -> bool {
todo!();
}
pub fn match_multisig(
script: &Script,
required_sigs: &mut i32,
pubkeys: &mut Vec<ValType>) -> bool {
todo!();
}
pub fn solver(
script_pub_key: &Script,
solutions_ret: &mut Vec<Vec<u8>>) -> TxoutType {
todo!();
}
pub fn extract_destination(
script_pub_key: &Script,
address_ret: &mut TxDestination) -> bool {
todo!();
}
pub struct ScriptVisitor {
}
pub trait ScriptVisit<T> {
fn script_visit(&self, item: T) -> Script;
}
impl ScriptVisit<&NoDestination> for ScriptVisitor {
fn script_visit(&self, dest: &NoDestination) -> Script {
todo!();
}
}
impl ScriptVisit<&PKHash> for ScriptVisitor {
fn script_visit(&self, keyid: &PKHash) -> Script {
todo!();
}
}
impl ScriptVisit<&ScriptHash> for ScriptVisitor {
fn script_visit(&self, scriptid: &ScriptHash) -> Script {
todo!();
}
}
impl ScriptVisit<&WitnessV0KeyHash> for ScriptVisitor {
fn script_visit(&self, id: &WitnessV0KeyHash) -> Script {
todo!();
}
}
impl ScriptVisit<&WitnessV0ScriptHash> for ScriptVisitor {
fn script_visit(&self, id: &WitnessV0ScriptHash) -> Script {
todo!();
}
}
impl ScriptVisit<&WitnessV1Taproot> for ScriptVisitor {
fn script_visit(&self, tap: &WitnessV1Taproot) -> Script {
todo!();
}
}
impl ScriptVisit<&WitnessUnknown> for ScriptVisitor {
fn script_visit(&self, id: &WitnessUnknown) -> Script {
todo!();
}
}
pub fn get_script_for_destination(dest: &TxDestination) -> Script {
todo!();
}
pub fn get_script_for_raw_pub_key(pub_key: &PubKey) -> Script {
todo!();
}
pub fn get_script_for_multisig(
n_required: i32,
keys: &Vec<PubKey>) -> Script {
todo!();
}
pub fn is_valid_destination(dest: &TxDestination) -> bool {
todo!();
}
impl TaprootBuilder {
pub fn combine(&mut self,
a: taproot_builder::NodeInfo,
b: taproot_builder::NodeInfo) -> taproot_builder::NodeInfo {
todo!();
}
pub fn insert(&mut self,
node: taproot_builder::NodeInfo,
depth: i32) {
todo!();
}
pub fn valid_depths(&mut self, depths: &Vec<i32>) -> bool {
todo!();
}
pub fn add(&mut self,
depth: i32,
script: &Script,
leaf_version: i32,
track: Option<bool>) -> &mut TaprootBuilder {
let track: bool = track.unwrap_or(true);
todo!();
}
pub fn add_omitted(&mut self,
depth: i32,
hash: &u256) -> &mut TaprootBuilder {
todo!();
}
pub fn finalize(&mut self, internal_key: &XOnlyPubKey) -> &mut TaprootBuilder {
todo!();
}
pub fn get_output(&mut self) -> WitnessV1Taproot {
todo!();
}
pub fn get_spend_data(&self) -> TaprootSpendData {
todo!();
}
}
pub fn infer_taproot_tree(
spenddata: &TaprootSpendData,
output: &XOnlyPubKey) -> Option<Vec<(i32,Script,i32)>> {
todo!();
}