Skip to content

Commit

Permalink
renamed xch
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardteach42 committed Dec 15, 2022
1 parent 1fa3bc1 commit f351ce3
Show file tree
Hide file tree
Showing 51 changed files with 515 additions and 515 deletions.
46 changes: 23 additions & 23 deletions CHANGELOG.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions chinilla/cmds/coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def coins_cmd(ctx: click.Context) -> None:
@click.option("-u", "--show-unconfirmed", help="Separately display unconfirmed coins.", is_flag=True)
@click.option(
"--min-amount",
help="Ignore coins worth less then this much XCH or CAT units",
help="Ignore coins worth less then this much HCX or CAT units",
type=str,
default="0",
)
@click.option(
"--max-amount",
help="Ignore coins worth more then this much XCH or CAT units",
help="Ignore coins worth more then this much HCX or CAT units",
type=str,
default="0",
)
Expand All @@ -48,7 +48,7 @@ def coins_cmd(ctx: click.Context) -> None:
"--exclude-amount",
"amounts_to_exclude",
multiple=True,
help="Exclude any coins with this XCH or CAT amount from being included.",
help="Exclude any coins with this HCX or CAT amount from being included.",
)
@click.option(
"--paginate/--no-paginate",
Expand Down Expand Up @@ -104,15 +104,15 @@ def list_cmd(
)
@click.option(
"--min-amount",
help="Ignore coins worth less then this much XCH or CAT units",
help="Ignore coins worth less then this much HCX or CAT units",
type=str,
default="0",
)
@click.option(
"--exclude-amount",
"amounts_to_exclude",
multiple=True,
help="Exclude any coins with this XCH or CAT amount from being included.",
help="Exclude any coins with this HCX or CAT amount from being included.",
)
@click.option(
"-n",
Expand All @@ -124,15 +124,15 @@ def list_cmd(
)
@click.option(
"--max-dust-amount",
help="Ignore coins worth more then this much XCH or CAT units",
help="Ignore coins worth more then this much HCX or CAT units",
type=str,
show_default=True,
default="0.000001000000", # 1000000 vojo
)
@click.option(
"-m",
"--fee",
help="Set the fees for the transaction, in XCH",
help="Set the fees for the transaction, in HCX",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -199,7 +199,7 @@ def combine_cmd(
@click.option(
"-m",
"--fee",
help="Set the fees for the transaction, in XCH",
help="Set the fees for the transaction, in HCX",
type=str,
default="0",
show_default=True,
Expand All @@ -208,7 +208,7 @@ def combine_cmd(
@click.option(
"-a",
"--amount-per-coin",
help="The amount of each newly created coin, in XCH",
help="The amount of each newly created coin, in HCX",
type=str,
required=True,
)
Expand Down
2 changes: 1 addition & 1 deletion chinilla/cmds/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def create_fee_option() -> Callable[[FC], FC]:
return click.option(
"-m",
"--fee",
help="Set the fees for the transaction, in XCH",
help="Set the fees for the transaction, in HCX",
type=str,
default=None,
show_default=True,
Expand Down
34 changes: 17 additions & 17 deletions chinilla/cmds/init_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def check_keys(new_root: Path, keychain: Optional[Keychain] = None) -> None:
with lock_and_load_config(new_root, "config.yaml") as config:
pool_child_pubkeys = [master_sk_to_pool_sk(sk).get_g1() for sk, _ in all_sks]
all_targets = []
stop_searching_for_farmer = "xch_target_address" not in config["farmer"]
stop_searching_for_pool = "xch_target_address" not in config["pool"]
stop_searching_for_farmer = "hcx_target_address" not in config["farmer"]
stop_searching_for_pool = "hcx_target_address" not in config["pool"]
number_of_ph_to_search = 50
selected = config["selected_network"]
prefix = config["network_overrides"]["config"][selected]["address_prefix"]
Expand All @@ -101,46 +101,46 @@ def check_keys(new_root: Path, keychain: Optional[Keychain] = None) -> None:
all_targets.append(
encode_puzzle_hash(create_puzzlehash_for_pk(_derive_path(intermediate_n, [i]).get_g1()), prefix)
)
if all_targets[-1] == config["farmer"].get("xch_target_address") or all_targets[-2] == config[
if all_targets[-1] == config["farmer"].get("hcx_target_address") or all_targets[-2] == config[
"farmer"
].get("xch_target_address"):
].get("hcx_target_address"):
stop_searching_for_farmer = True
if all_targets[-1] == config["pool"].get("xch_target_address") or all_targets[-2] == config["pool"].get(
"xch_target_address"
if all_targets[-1] == config["pool"].get("hcx_target_address") or all_targets[-2] == config["pool"].get(
"hcx_target_address"
):
stop_searching_for_pool = True

# Set the destinations, if necessary
updated_target: bool = False
if "xch_target_address" not in config["farmer"]:
if "hcx_target_address" not in config["farmer"]:
print(
f"Setting the xch destination for the farmer reward (1/8 plus fees, solo and pooling)"
f"Setting the hcx destination for the farmer reward (1/8 plus fees, solo and pooling)"
f" to {all_targets[0]}"
)
config["farmer"]["xch_target_address"] = all_targets[0]
config["farmer"]["hcx_target_address"] = all_targets[0]
updated_target = True
elif config["farmer"]["xch_target_address"] not in all_targets:
elif config["farmer"]["hcx_target_address"] not in all_targets:
print(
f"WARNING: using a farmer address which we might not have the private"
f" keys for. We searched the first {number_of_ph_to_search} addresses. Consider overriding "
f"{config['farmer']['xch_target_address']} with {all_targets[0]}"
f"{config['farmer']['hcx_target_address']} with {all_targets[0]}"
)

if "pool" not in config:
config["pool"] = {}
if "xch_target_address" not in config["pool"]:
print(f"Setting the xch destination address for pool reward (7/8 for solo only) to {all_targets[0]}")
config["pool"]["xch_target_address"] = all_targets[0]
if "hcx_target_address" not in config["pool"]:
print(f"Setting the hcx destination address for pool reward (7/8 for solo only) to {all_targets[0]}")
config["pool"]["hcx_target_address"] = all_targets[0]
updated_target = True
elif config["pool"]["xch_target_address"] not in all_targets:
elif config["pool"]["hcx_target_address"] not in all_targets:
print(
f"WARNING: using a pool address which we might not have the private"
f" keys for. We searched the first {number_of_ph_to_search} addresses. Consider overriding "
f"{config['pool']['xch_target_address']} with {all_targets[0]}"
f"{config['pool']['hcx_target_address']} with {all_targets[0]}"
)
if updated_target:
print(
f"To change the XCH destination addresses, edit the `xch_target_address` entries in"
f"To change the HCX destination addresses, edit the `hcx_target_address` entries in"
f" {(new_root / 'config' / 'config.yaml').absolute()}."
)

Expand Down
4 changes: 2 additions & 2 deletions chinilla/cmds/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def derive_cmd(ctx: click.Context, fingerprint: Optional[int], filename: Optiona
"non-observer derivation should be used at that index. Example HD path: m/12381n/8444n/2/",
type=str,
)
@click.option("--prefix", "-x", help="Address prefix (xch for vanillanet, txch for testnet)", default=None, type=str)
@click.option("--prefix", "-x", help="Address prefix (hcx for vanillanet, thcx for testnet)", default=None, type=str)
@click.pass_context
def search_cmd(
ctx: click.Context,
Expand Down Expand Up @@ -333,7 +333,7 @@ def search_cmd(
"--index", "-i", help="Index of the first wallet address to derive. Index 0 is the first wallet address.", default=0
)
@click.option("--count", "-n", help="Number of wallet addresses to derive, starting at index.", default=1)
@click.option("--prefix", "-x", help="Address prefix (xch for vanillanet, txch for testnet)", default=None, type=str)
@click.option("--prefix", "-x", help="Address prefix (hcx for vanillanet, thcx for testnet)", default=None, type=str)
@click.option(
"--non-observer-derivation",
"-d",
Expand Down
10 changes: 5 additions & 5 deletions chinilla/cmds/plotnft.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def validate_fee(ctx, param, value):
try:
fee = Decimal(value)
except ValueError:
raise click.BadParameter("Fee must be decimal dotted value in XCH (e.g. 0.00005)")
raise click.BadParameter("Fee must be decimal dotted value in HCX (e.g. 0.00005)")
if fee < 0 or fee > MAX_CMDLINE_FEE:
raise click.BadParameter(f"Fee must be in the range 0 to {MAX_CMDLINE_FEE}")
return value
Expand Down Expand Up @@ -63,7 +63,7 @@ def get_login_link_cmd(launcher_id: str) -> None:
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH. Fee is used TWICE: once to create the singleton, once for init.",
help="Set the fees per transaction, in HCX. Fee is used TWICE: once to create the singleton, once for init.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -113,7 +113,7 @@ def create_cmd(
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH. Fee is used TWICE: once to leave pool, once to join.",
help="Set the fees per transaction, in HCX. Fee is used TWICE: once to leave pool, once to join.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -143,7 +143,7 @@ def join_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int, fee: int
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH. Fee is charged TWICE.",
help="Set the fees per transaction, in HCX. Fee is charged TWICE.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -191,7 +191,7 @@ def inspect(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None:
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH.",
help="Set the fees per transaction, in HCX.",
type=str,
default="0",
show_default=True,
Expand Down
2 changes: 1 addition & 1 deletion chinilla/cmds/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The rest of the codebase uses vojos everywhere.
# Only use these units for user facing interfaces.
units: Dict[str, int] = {
"chinilla": 10**12, # 1 chinilla (XCH) is 1,000,000,000,000 vojo (1 trillion)
"chinilla": 10**12, # 1 chinilla (HCX) is 1,000,000,000,000 vojo (1 trillion)
"vojo": 1,
"cat": 10**3, # 1 CAT is 1000 CAT vojos
}
24 changes: 12 additions & 12 deletions chinilla/cmds/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,33 +141,33 @@ def get_transactions_cmd(
)
@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int)
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
@click.option("-a", "--amount", help="How much chinilla to send, in XCH", type=str, required=True)
@click.option("-a", "--amount", help="How much chinilla to send, in HCX", type=str, required=True)
@click.option("-e", "--memo", help="Additional memo for the transaction", type=str, default=None)
@click.option(
"-m",
"--fee",
help="Set the fees for the transaction, in XCH",
help="Set the fees for the transaction, in HCX",
type=str,
default="0",
show_default=True,
required=True,
)
@click.option("-t", "--address", help="Address to send the XCH", type=str, required=True)
@click.option("-t", "--address", help="Address to send the HCX", type=str, required=True)
@click.option(
"-o", "--override", help="Submits transaction without checking for unusual values", is_flag=True, default=False
)
@click.option(
"-ma",
"--min-coin-amount",
help="Ignore coins worth less then this much XCH or CAT units",
help="Ignore coins worth less then this much HCX or CAT units",
type=str,
required=False,
default="0",
)
@click.option(
"-l",
"--max-coin-amount",
help="Ignore coins worth more then this much XCH or CAT units",
help="Ignore coins worth more then this much HCX or CAT units",
type=str,
required=False,
default="0",
Expand Down Expand Up @@ -316,7 +316,7 @@ def get_derivation_index_cmd(wallet_rpc_port: Optional[int], fingerprint: int) -
@click.option("-a", "--address", help="The address you want to use for signing", type=str, required=True)
@click.option("-m", "--hex_message", help="The hex message you want sign", type=str, required=True)
def address_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, address: str, hex_message: str) -> None:
extra_params: Dict[str, Any] = {"address": address, "message": hex_message, "type": AddressType.XCH}
extra_params: Dict[str, Any] = {"address": address, "message": hex_message, "type": AddressType.HCX}
import asyncio

from .wallet_funcs import sign_message
Expand Down Expand Up @@ -382,7 +382,7 @@ def add_token_cmd(wallet_rpc_port: Optional[int], asset_id: str, token_name: str
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, add_token))


@wallet_cmd.command("make_offer", short_help="Create an offer of XCH/CATs for XCH/CATs")
@wallet_cmd.command("make_offer", short_help="Create an offer of HCX/CATs for HCX/CATs")
@click.option(
"-wp",
"--wallet-rpc-port",
Expand Down Expand Up @@ -535,7 +535,7 @@ def did_cmd():
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH.",
help="Set the fees per transaction, in HCX.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -682,7 +682,7 @@ def nft_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, nft_id: s
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH.",
help="Set the fees per transaction, in HCX.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -764,7 +764,7 @@ def nft_mint_cmd(
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH.",
help="Set the fees per transaction, in HCX.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -810,7 +810,7 @@ def nft_add_uri_cmd(
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH.",
help="Set the fees per transaction, in HCX.",
type=str,
default="0",
show_default=True,
Expand Down Expand Up @@ -871,7 +871,7 @@ def nft_list_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> N
@click.option(
"-m",
"--fee",
help="Set the fees per transaction, in XCH.",
help="Set the fees per transaction, in HCX.",
type=str,
default="0",
show_default=True,
Expand Down
Loading

0 comments on commit f351ce3

Please sign in to comment.