Skip to content

Commit 440f93e

Browse files
committed
A better way to handle addresses
1 parent bd42963 commit 440f93e

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

aries_cloudagent/config/argparse.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ def add_arguments(self, parser: ArgumentParser):
810810
env_var="ACAPY_ACCOUNT_ADDRESS",
811811
help=(
812812
"Specifies the user address from besu. If the address doesn't "
813-
"starts with 0x, a hex conversion is done."
813+
"starts with 0x, this prefix is added."
814814
),
815815
)
816816
parser.add_argument(
@@ -821,7 +821,7 @@ def add_arguments(self, parser: ArgumentParser):
821821
env_var="ACAPY_PRIVATE_ACCOUNT_KEY",
822822
help=(
823823
"Specifies the user account private key. If the key doesn't "
824-
"starts with 0x, a hex conversion is done."
824+
"starts with 0x, this prefix is added."
825825
),
826826
)
827827
parser.add_argument(
@@ -840,7 +840,7 @@ def add_arguments(self, parser: ArgumentParser):
840840
env_var="ACAPY_INDY_DID_CONTRACT_ADDRESS",
841841
help=(
842842
"Specifies the DID registry contract address. If the address doesn't "
843-
"starts with 0x, a hex conversion is done."
843+
"starts with 0x, this prefix is added."
844844
),
845845
)
846846
parser.add_argument(
@@ -851,7 +851,7 @@ def add_arguments(self, parser: ArgumentParser):
851851
env_var="ACAPY_SCHEMA_CONTRACT_ADDRESS",
852852
help=(
853853
"Specifies the schema contract address. If the address doesn't "
854-
"starts with 0x, a hex conversion is done."
854+
"starts with 0x, this prefix is added."
855855
),
856856
)
857857
parser.add_argument(
@@ -862,7 +862,7 @@ def add_arguments(self, parser: ArgumentParser):
862862
env_var="ACAPY_CREDF_CONTRACT_ADDRESS",
863863
help=(
864864
"Specifies the credf contract address. If the address doesn't "
865-
"starts with 0x, a hex conversion is done."
865+
"starts with 0x, this prefix is added."
866866
),
867867
)
868868
parser.add_argument(
@@ -873,7 +873,7 @@ def add_arguments(self, parser: ArgumentParser):
873873
env_var="ACAPY_REVOCATION_CONTRACT_ADDRESS",
874874
help=(
875875
"Specifies the revocation contract address. If the address doesn't "
876-
"starts with 0x, a hex conversion is done."
876+
"starts with 0x, this prefix is added."
877877
),
878878
)
879879
parser.add_argument(
@@ -988,32 +988,32 @@ def get_settings(self, args: Namespace) -> dict:
988988
settings["ledger.private_account_key"] = (
989989
args.private_account_key
990990
if args.private_account_key.startswith("0x")
991-
else hex(int(args.private_account_key))
991+
else f"0x{args.private_account_key}"
992992
)
993993
settings["ledger.account_address"] = (
994994
args.account_address
995995
if args.account_address.startswith("0x")
996-
else hex(int(args.account_address))
996+
else f"0x{args.account_address}"
997997
)
998998
settings["ledger.schema_contract_address"] = (
999999
args.schema_contract_address
10001000
if args.schema_contract_address.startswith("0x")
1001-
else hex(int(args.schema_contract_address))
1001+
else f"0x{args.schema_contract_address}"
10021002
)
10031003
settings["ledger.credef_contract_address"] = (
10041004
args.credef_contract_address
10051005
if args.credef_contract_address.startswith("0x")
1006-
else hex(int(args.credef_contract_address))
1006+
else f"0x{args.credef_contract_address}"
10071007
)
10081008
settings["ledger.revocation_contract_address"] = (
10091009
args.revocation_contract_address
10101010
if args.revocation_contract_address.startswith("0x")
1011-
else hex(int(args.revocation_contract_address))
1011+
else f"0x{args.revocation_contract_address}"
10121012
)
10131013
settings["ledger.indy_did_contract_address"] = (
10141014
args.indy_did_contract_address
10151015
if args.indy_did_contract_address.startswith("0x")
1016-
else hex(int(args.indy_did_contract_address))
1016+
else f"0x{args.indy_did_contract_address}"
10171017
)
10181018
else:
10191019
single_configured = False

0 commit comments

Comments
 (0)