Skip to content

Commit

Permalink
self.log prints to stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Apr 24, 2022
1 parent 6515347 commit 57b948c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
./main.py to-cold $TXID
"""
import sys
import struct
import hashlib
import sys
Expand Down Expand Up @@ -79,6 +80,10 @@
BLANK_INPUT = CMutableTxIn


def no_output(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)


@dataclass(frozen=True)
class Coin:
outpoint: COutPoint
Expand All @@ -104,6 +109,8 @@ class Wallet:
coins: t.List[Coin]
network: str

log: t.Callable = no_output

@classmethod
def generate(cls, seed: bytes, network: str = "regtest") -> "Wallet":
return cls(
Expand Down Expand Up @@ -455,10 +462,6 @@ def t_(b: t.Union[bytes, t.Any]) -> str:
bold = make_color(esc(1), esc(22))


def no_output(*args, **kwargs):
pass


@dataclass
class VaultExecutor:
plan: VaultPlan
Expand Down

0 comments on commit 57b948c

Please sign in to comment.