Skip to content

Commit

Permalink
Remove redundant user and role creation
Browse files Browse the repository at this point in the history
  • Loading branch information
hmcalister committed Dec 8, 2021
1 parent 6283974 commit 26d4fdc
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions usr_scripts/UpdatingFileHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# Create the users
user_a = new_user("user_a", DEFAULT_DOMAIN_NAME)
user_b = new_user("user_b", DEFAULT_DOMAIN_NAME)
user_c = new_user("user_c", DEFAULT_DOMAIN_NAME)

logging.info(f"Create new roles \'document_creator\', \'null_role\'\n\tand new domain \'{DEFAULT_DOMAIN_NAME}\'")
commands = [
Expand All @@ -28,10 +27,6 @@
primitive_pb2.can_create_asset,
primitive_pb2.can_read_assets,
]),
# Create a new role that can do NOTHING
iroha_admin.command("CreateRole", role_name="null_role", permissions=[

]),
# Create a new domain that has document_creator as role
iroha_admin.command("CreateDomain", domain_id=DEFAULT_DOMAIN_NAME, default_role="document_creator")
]
Expand All @@ -49,9 +44,7 @@
iroha_admin.command('CreateAccount', account_name=user_a["name"], domain_id=DEFAULT_DOMAIN_NAME,
public_key=user_a["public_key"]),
iroha_admin.command('CreateAccount', account_name=user_b["name"], domain_id=DEFAULT_DOMAIN_NAME,
public_key=user_b["public_key"]),
iroha_admin.command('CreateAccount', account_name=user_c["name"], domain_id=DEFAULT_DOMAIN_NAME,
public_key=user_c["public_key"])
public_key=user_b["public_key"])
]
tx = IrohaCrypto.sign_transaction(
iroha_admin.transaction(commands), ADMIN_PRIVATE_KEY)
Expand Down Expand Up @@ -80,9 +73,9 @@

logging.info("User B, having received the message from A, wants to verify it")
message_hash = custodian.get_hash(message)
assets = custodian.get_domain_assets(user_b, domain_name="message")
assets = custodian.get_domain_hashes(user_b, domain_name="message")
logging.info("User B, having got the assets from the domain, checks the most recent against their message")
assert message_hash==assets[-1]["hash"]
logging.info("User B verifies that their message is the most recent on chain")

# log_all_blocks(net_1, f"node1.log")
log_all_blocks(net_1, f"node1.log")

0 comments on commit 26d4fdc

Please sign in to comment.