text: #
  # Copyright Soramitsu Co., Ltd. All Rights Reserved.
  # SPDX-License-Identifier: Apache-2.0
  #
  
  import iroha
  import commons
  
  admin = commons.new_user('admin@test')
  alice = commons.new_user('alice@test')
  
  
  @commons.hex
  def genesis_tx():
      test_permissions = iroha.RolePermissionSet([iroha.Role_kSetDetail])
      tx = iroha.ModelTransactionBuilder() \
          .createdTime(commons.now()) \
          .creatorAccountId(admin['id']) \
          .addPeer('0.0.0.0:50541', admin['key'].publicKey()) \
          .createRole('admin_role', commons.all_permissions()) \
          .createRole('test_role', test_permissions) \
          .createDomain('test', 'test_role') \
          .createAccount('admin', 'test', admin['key'].publicKey()) \
          .createAccount('alice', 'test', alice['key'].publicKey()) \
          .appendRole(admin['id'], 'admin_role') \
          .build()
      return iroha.ModelProtoTransaction(tx) \
          .signAndAddSignature(admin['key']).finish()
  
  
  @commons.hex
  def set_account_detail_tx():
      tx = iroha.ModelTransactionBuilder() \
          .createdTime(commons.now()) \
          .creatorAccountId(alice['id']) \
          .setAccountDetail(admin['id'], 'fav_color', 'red') \
          .build()
      return iroha.ModelProtoTransaction(tx) \
          .signAndAddSignature(alice['key']).finish()
  