mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-28 18:14:19 -05:00
* Enable PEP604 Ruff rules * Fix harcoded signature in test * Hack CLVMStreamable test with note to fast follow
34 lines
830 B
Python
34 lines
830 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Callable
|
|
from typing import Any, TypeVar
|
|
|
|
import click
|
|
|
|
from chia.cmds.param_types import TransactionFeeParamType
|
|
|
|
FC = TypeVar("FC", bound=Callable[..., Any] | click.Command)
|
|
|
|
|
|
def create_fingerprint(required: bool = False) -> Callable[[FC], FC]:
|
|
return click.option(
|
|
"-f",
|
|
"--fingerprint",
|
|
help="Fingerprint of the wallet to use",
|
|
required=required,
|
|
# TODO: should be uint32
|
|
type=int,
|
|
)
|
|
|
|
|
|
def create_fee(message: str = "Set the fees for the transaction, in XCH", required: bool = True) -> Callable[[FC], FC]:
|
|
return click.option(
|
|
"-m",
|
|
"--fee",
|
|
help=message,
|
|
type=TransactionFeeParamType(),
|
|
default="0",
|
|
show_default=True,
|
|
required=required,
|
|
)
|