This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
01:08:39 bash@sultana ~/dload/code/rust-bitcoin/miniscript$ cargo test | |
Compiling miniscript v0.7.0 (/home/apoelstra/dload/code/rust-bitcoin/miniscript) | |
error[E0275]: overflow evaluating the requirement `&bitcoin::util::psbt::Input: miniscript::satisfy::Satisfier<bitcoin::PublicKey>` | |
| | |
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate | |
= note: required because of the requirements on the impl of `miniscript::satisfy::Satisfier<bitcoin::PublicKey>` for `&&bitcoin::util::psbt::Input` | |
= note: required because of the requirements on the impl of `miniscript::satisfy::Satisfier<bitcoin::PublicKey>` for `&&&bitcoin::util::psbt::Input` | |
= note: required because of the requirements on the impl of `miniscript::satisfy::Satisfier<bitcoin::PublicKey>` for `&&&&bitcoin::util::psbt::Input` | |
= note: required because of the requirements on the impl of `miniscript::satisfy::Satisfier<bitcoin::PublicKey>` for `&&&&&bitcoin::util::psbt::Input` | |
= note: required because of the requirements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Imports -- | |
import System.IO | |
import System.Process | |
import System.Posix.IO | |
-- XMonad | |
import XMonad | |
import XMonad.Core | |
import qualified XMonad.StackSet as W |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cmp::Ordering; | |
use std::ops::{Add, Sub, Shl, Shr, Div, Not}; | |
#[derive(Copy, Clone, PartialEq, Eq)] | |
struct Uint256([u64; 4]); | |
impl Uint256 { | |
fn bits(&self) -> usize { | |
for i in 1..4 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rust JSON-RPC Library | |
// Written in 2015 by | |
// Andrew Poelstra <apoelstra@wpsoftware.net> | |
// | |
// To the extent possible under law, the author(s) have dedicated all | |
// copyright and related and neighboring rights to this software to | |
// the public domain worldwide. This software is distributed without | |
// any warranty. | |
// | |
// You should have received a copy of the CC0 Public Domain Dedication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The "receiver set" of the select interface. This structure is used to manage | |
/// a set of receivers which are being selected over. The `Select` will act as a | |
/// receiver of type `U`. `'sel` is the lifetime of the stack frame of callbacks | |
/// which are passed to `Select::add`. | |
pub struct Select<'sel, U>; | |
/// A handle which is used to receive directly from a `Receiver` owned by a `Select` | |
pub struct RecvHandle<T>(uint); | |
impl<T:Send> RecvHandle<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A Select is a merge of multiple Receivers; you wait on a Select | |
/// and it blocks until any one of the attached Receivers sees | |
/// something. | |
struct Select<T>; | |
/// Identifier for Receivers attached to a Select | |
type RecvId = uint; | |
impl<T:Default> Select<T> { | |
/// Creates a new `Select` which receives objects of type `T` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl <T:Serializable> Serializable for RefCell<T> { | |
fn serialize(&self) -> Vec<u8> { | |
self.borrow().serialize() | |
} | |
fn serialize_iter<'a>(&'a self) -> SerializeIter<'a> { | |
self.borrow().serialize_iter() | |
} | |
fn deserialize<I: Iterator<u8>>(iter: I) -> IoResult<RefCell<T>> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Add a new UTXO to the set | |
pub fn add_utxo(&mut self, txo: TxOut, txid: Sha256dHash, vout: uint) -> bool { | |
let txid = txid.as_bitv(); | |
// Construct node if needed | |
let node = match self.tree.lookup_mut(&txid) { | |
Some(node) => node, | |
None => { | |
self.tree.insert(&txid, UtxoNode { out: vec![] }); | |
// Note: If this fails, it indicates a bug in our program and/or an OOM | |
// condition. But maybe we should do something better than task failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ptr::RawPtr; | |
type NodeRef<T> = Option<Box<Node<T>>>; | |
type NodeBackRef<T> = *mut Node<T>; | |
struct Node<T> { | |
left: NodeRef<T>, | |
right: NodeRef<T>, | |
parent: NodeBackRef<T>, |
NewerOlder