def apply_confirm(header, payload, state): confirm_payload = role_transaction_pb2.ConfirmAddRoleAdmin() confirm_payload.ParseFromString(payload.content) role_owner_address = addresser.make_role_owners_address( role_id=confirm_payload.role_id, user_id=confirm_payload.user_id ) txn_signer_admin_address = addresser.make_role_admins_address( role_id=confirm_payload.role_id, user_id=header.signer_public_key ) state_entries = state_accessor.get_state_entries( header=header, confirm=confirm_payload, txn_signer_rel_address=txn_signer_admin_address, state=state, ) state_change.confirm_role_action( state_entries=state_entries, header=header, confirm=confirm_payload, role_rel_address=role_owner_address, state=state, )
def apply_reject(header, payload, state): reject_payload = role_transaction_pb2.RejectAddRoleOwner() reject_payload.ParseFromString(payload.content) txn_signer_admins_address = addresser.make_role_admins_address( role_id=reject_payload.role_id, user_id=header.signer_public_key ) state_entries = state_accessor.get_state_entries( header=header, confirm=reject_payload, txn_signer_rel_address=txn_signer_admins_address, state=state, ) state_change.reject_role_action( state_entries, header, reject=reject_payload, state=state )