From 7546eddb9d209eb98b5b52d36b3f8657a3a4ca1a Mon Sep 17 00:00:00 2001 From: Mandragora Date: Wed, 21 Aug 2024 05:38:18 +0200 Subject: [PATCH 1/2] Add Mandragora init-validator tx --- transactions/McDaan-validator.toml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 transactions/McDaan-validator.toml diff --git a/transactions/McDaan-validator.toml b/transactions/McDaan-validator.toml new file mode 100644 index 00000000..c41472f1 --- /dev/null +++ b/transactions/McDaan-validator.toml @@ -0,0 +1,41 @@ +[[established_account]] +vp = "vp_user" +threshold = 1 +public_keys = ["tpknam1qqhjp8cjk442f4wfam6zf5pyjlzq5u6pp5cpf0xhvjlwj9ddkmnq6turgdy"] + +[[validator_account]] +address = "tnam1q8sjkutd5kqwcc555wr77p9fjn66nuuqfuzzc3yc" +vp = "vp_user" +commission_rate = "0.05" +max_commission_rate_change = "0.01" +net_address = "142.132.135.125:24656" + +[validator_account.consensus_key] +pk = "tpknam1qrkuhku5xze2g867097ne8vxh7qjc7tuag8s53p2zy7hssuk7lvfyhfhq7e" +authorization = "signam1qztlfq6df0u2ehvn73vaxpj97czw0udgrpj8algmjupjy4x44gn64vsh897qvhc3er3w86gv4nwh0jfxskfucqyr2eqdpmng5jgta3gqw835p5" + +[validator_account.protocol_key] +pk = "tpknam1qz43lxlwxhmamr20wf3825etgfgalpnyuev7lprygk52x2yxm7hx6stlxfx" +authorization = "signam1qrsdgdtqal70pf29mx4c7ahzh7gygda00ckup2qnfrw6hphyjpk9dqthcccpjmkr0sfaqt8dtlx8cf6c7mldy8ype76nswxtn7zrcrgq68dxwd" + +[validator_account.tendermint_node_key] +pk = "tpknam1qre7xfrvzvxrg7453q0u78ecup26sxjphw9qydrhvem5208w8addxtlevtc" +authorization = "signam1qzjatnzwuyennzpxygufprdx9prln2c8m2jgxmjtsnj8z8wjf6pvg4z39l92pmtyp0ghdslvtjj7m6va2a3qv8e2kxgjs08xxdc0z7ct623l6p" + +[validator_account.eth_hot_key] +pk = "tpknam1qyp4p9wsg40hzgdygfurfg8jkjq5ya78eryr9enue694q9lvuzetkpggwg65t" +authorization = "signam1q9ctg6k7x4x376m4j5mg9gsesecyzhhjlqulc8n39r9t9dyqwhexg3s66ejxh4ccjftj7mfqah0cg6ddyj3swv38r23v7lzjs2acsyn3qq6g4wym" + +[validator_account.eth_cold_key] +pk = "tpknam1qypfyy6s79cru85v35cwzt9r577astx3tsu339fy7jzhl2kv8y32dvgck2028" +authorization = "signam1q90rm09knnc5cgvpmu0egf5egqm9qzmd404y4g3a7629wuldj44u6sfrrgr4q29v43dzayk7t9ly62mzd2adwgch9qxpcxkv4lt8yhp3qyl20cfw" + +[validator_account.metadata] +email = "support@mandragora.io" +description = "Stake and Chill Out!" +discord_handle = "danielmandragora" +avatar = "https://i.ibb.co/mzWB7tq/photo-2022-10-14-05-18-24.jpg" +name = "Mandragora" + +[validator_account.signatures] +tpknam1qqhjp8cjk442f4wfam6zf5pyjlzq5u6pp5cpf0xhvjlwj9ddkmnq6turgdy = "signam1qzf3xruvc6djejzytqcsf7vfzzz4ln845fkra67yjh6kpl9lxhkufqs48u2vgvm7ah8tpmqzefnfm5at6dnswl5ty73nrmfdcj3w8vq8asade7" From 0d10287ef9e67f1fb4aecaf27fe725bf4ac78f17 Mon Sep 17 00:00:00 2001 From: Gianmarco Fraccaroli Date: Wed, 21 Aug 2024 11:47:43 +0200 Subject: [PATCH 2/2] update ci --- scripts/validate-pr.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/validate-pr.py b/scripts/validate-pr.py index 51d39bbd..770f3799 100644 --- a/scripts/validate-pr.py +++ b/scripts/validate-pr.py @@ -10,9 +10,9 @@ def read_env(): - can_apply_for_validators = os.environ.get('CAN_ADD_VALIDATORS', True).lower() in ('true', '1', 't') - can_apply_for_bonds = os.environ.get('CAN_ADD_BONDS', True).lower() in ('true', '1', 't') - can_apply_for_accounts = os.environ.get('CAN_ADD_ACCOUNTS', True).lower() in ('true', '1', 't') + can_apply_for_validators = os.environ.get('CAN_ADD_VALIDATORS', 'true').lower() in ('true', '1', 't') + can_apply_for_bonds = os.environ.get('CAN_ADD_BONDS', 'true').lower() in ('true', '1', 't') + can_apply_for_accounts = os.environ.get('CAN_ADD_ACCOUNTS', 'true').lower() in ('true', '1', 't') print("Can add validators: {}".format(can_apply_for_validators)) print("Can add bonds: {}".format(can_apply_for_bonds)) @@ -188,7 +188,7 @@ def check_if_bond_is_valid(bonds_toml: List[Dict], balances: Dict[str, Dict]): return True -def validate_toml(file, can_apply_for_validators, can_apply_for_bonds, can_apply_for_accounts): +def validate_toml(file, can_apply_for_validators, can_apply_for_bonds, can_apply_for_accounts) -> bool: balances = toml.load(open("genesis/balances.toml", "r")) nam_balances = balances['token']['NAM'] @@ -196,27 +196,33 @@ def validate_toml(file, can_apply_for_validators, can_apply_for_bonds, can_apply accounts_toml = read_unsafe_toml(file) if accounts_toml is None: print("{} is NOT valid.".format(file)) + return False is_valid = check_if_account_is_valid(accounts_toml) if not is_valid: print("{} is NOT valid.".format(file)) + return False elif '-validator.toml' in file and can_apply_for_validators: validators_toml = read_unsafe_toml(file) if validators_toml is None: print("{} is NOT valid.".format(file)) + return False is_valid = check_if_validator_is_valid(validators_toml) if not is_valid: print("{} is NOT valid.".format(file)) + return False elif '-bond.toml' in file and can_apply_for_bonds: bonds_toml = read_unsafe_toml(file) if not bonds_toml: print("{} is NOT valid.".format(file)) + return False is_valid = check_if_bond_is_valid(bonds_toml, nam_balances) if not is_valid: print("{} is NOT valid.".format(file)) + return False else: return False - - print("{} is valid.".format(file)) + + return True def main(): alias = get_alias_from_env() @@ -236,11 +242,17 @@ def main(): file_alias = get_alias_from_file(file) if not alias.lower() in file_alias.lower(): + print("alias {} doesn't correspond".format(alias.lower())) exit(1) print("{} is allowed, checking if its valid...".format(file)) - validate_toml(file, can_apply_for_validators, can_apply_for_bonds, can_apply_for_accounts) + res = validate_toml(file, can_apply_for_validators, can_apply_for_bonds, can_apply_for_accounts) + if res: + print("{} is valid.".format(file)) + else: + print("{} is NOT valid".format(file)) + exit(1) if __name__ == "__main__":