Skip to content

Commit

Permalink
flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
talhadaar committed Nov 7, 2023
1 parent 6fecb71 commit d6d9560
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/bridge_rbac_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
# Number of tokens with decimals
TOKEN_NUM = 10000 * pow(10, 15)


# generates list of `length` random utf-8 encoded hex strings of length 15
def generate_random_hex_list(strlen, listlen):
return [ generate_random_hex(strlen).encode("utf-8") for i in range(listlen) ]
return [generate_random_hex(strlen).encode("utf-8") for i in range(listlen)]


# returns list of utf-8 encoded hex strings from a list of strings
def str_to_utf8_encoded_list(list):
return list(map(lambda name: name.encode("utf-8")), list)


##############################################################################
# Constants for global test-setup defaults
##############################################################################
Expand Down Expand Up @@ -84,25 +87,23 @@ def _eth_add_role(self, role_id, name):
)
return _sign_and_submit_transaction(tx, self.w3, self.eth_kp_src)


def _eth_update_role(self, role_id, name):
tx = self.contract.functions.update_role(role_id, name).build_transaction(
_calcualte_evm_basic_req(self.substrate, self.w3, self.eth_kp_src.ss58_address)
)
return _sign_and_submit_transaction(tx, self.w3, self.eth_kp_src)


def _eth_disable_role(self, role_id):
tx = self.contract.functions.disable_role(role_id).build_transaction(
_calcualte_evm_basic_req(self.substrate, self.w3, self.eth_kp_src.ss58_address)
)
return _sign_and_submit_transaction(tx, self.w3, self.eth_kp_src)

def _assign_role_to_user(self, role_id, user_id):
tx = self.contract.functions.assign_role_to_user(role_id, user_id).build_transaction(
_calcualte_evm_basic_req(self.substrate,self. w3, self.eth_kp_src.ss58_address)
tx = self.contract.functions.assign_role_to_user(role_id, user_id).build_transaction(
_calcualte_evm_basic_req(self.substrate, self.w3, self.eth_kp_src.ss58_address)
)
return _sign_and_submit_transaction(self.tx, self.w3, self.eth_kp_src)
return _sign_and_submit_transaction(tx, self.w3, self.eth_kp_src)

def check_item_from_event(self, event, account, role_id, name):
events = event.get_all_entries()
Expand Down

0 comments on commit d6d9560

Please sign in to comment.