Beispiel #1
0
 def create_claimed_account_dict(self, create_claimed_account_dict):
     """Calc RC costs for claimed account create"""
     op = operations.Create_claimed_account(**create_claimed_account_dict)
     state_bytes_count = state_object_size_info["account_object_base_size"]
     state_bytes_count += state_object_size_info[
         "account_authority_object_base_size"]
     state_bytes_count += self.get_authority_byte_count(
         create_claimed_account_dict["owner"])
     state_bytes_count += self.get_authority_byte_count(
         create_claimed_account_dict["active"])
     state_bytes_count += self.get_authority_byte_count(
         create_claimed_account_dict["posting"])
     tx_size = self.get_tx_size(op)
     execution_time_count = resource_execution_time[
         "account_update_operation_exec_time"]
     resource_count = self.get_resource_count(tx_size, execution_time_count,
                                              state_bytes_count)
     return self.blockchain.get_rc_cost(resource_count)
 def test_createclaimedaccount(self):
     self.op = operations.Create_claimed_account(
         **{
             "creator": "netuoso",
             "new_account_name": "netuoso2",
             "owner": {
                 "weight_threshold":
                 1,
                 "account_auths": [],
                 "key_auths": [[
                     "STM7QtTRvd1owAh4uGaC6trxjR9M1cpqfi2WfLQed1GbUGPomt9DP",
                     1
                 ]]
             },
             "active": {
                 "weight_threshold":
                 1,
                 "account_auths": [],
                 "key_auths": [[
                     "STM7QtTRvd1owAh4uGaC6trxjR9M1cpqfi2WfLQed1GbUGPomt9DP",
                     1
                 ]]
             },
             "posting": {
                 "weight_threshold":
                 1,
                 "account_auths": [],
                 "key_auths": [[
                     "STM7QtTRvd1owAh4uGaC6trxjR9M1cpqfi2WfLQed1GbUGPomt9DP",
                     1
                 ]]
             },
             "memo_key":
             "STM7QtTRvd1owAh4uGaC6trxjR9M1cpqfi2WfLQed1GbUGPomt9DP",
             "json_metadata": "{}"
         })
     self.apdu = ([
         b"d4040000dd05800000308000000d800000008000000080000000042000000000000000000000000000000000000000000000000000000000000000000402bd8c04045fe26f450404f179a8570401010481b217076e6574756f736f086e6574756f736f32010000000001034c6a518a9b9e9cb8099176854a322c87db6c7e82c47bd5fe68c273ba63a647160100010000000001034c6a518a9b9e9cb8099176854a322c87db6c7e82c47bd5fe68c273ba63a647160100010000000001034c6a518a9b9e9cb8099176854a322c87db6c7e82c47bd5fe68c273ba63a647160100034c6a",
         b"d404800025518a9b9e9cb8099176854a322c87db6c7e82c47bd5fe68c273ba63a6471600000000040100"
     ])