Exemple #1
0
    def from_dict(cls, data: Dict[str, Any]) -> "ActionInitChain":
        pseudo_random_generator = pseudo_random_generator_from_json(data)

        return cls(
            pseudo_random_generator=pseudo_random_generator,
            block_number=BlockNumber(int(data["block_number"])),
            block_hash=deserialize_blockhash(data["block_hash"]),
            our_address=to_canonical_address(data["our_address"]),
            chain_id=data["chain_id"],
        )
Exemple #2
0
 def from_dict(cls, data: Dict[str,
                               Any]) -> "ContractReceiveChannelBatchUnlock":
     return cls(
         transaction_hash=deserialize_transactionhash(
             data["transaction_hash"]),
         canonical_identifier=CanonicalIdentifier.from_dict(
             data["canonical_identifier"]),
         participant=to_canonical_address(data["participant"]),
         partner=to_canonical_address(data["partner"]),
         locksroot=deserialize_locksroot(data["locksroot"]),
         unlocked_amount=TokenAmount(int(data["unlocked_amount"])),
         returned_tokens=TokenAmount(int(data["returned_tokens"])),
         block_number=BlockNumber(int(data["block_number"])),
         block_hash=deserialize_blockhash(data["block_hash"]),
     )
Exemple #3
0
 def from_dict(cls, data: Dict[str, Any]) -> 'ContractReceiveChannelBatchUnlock':
     return cls(
         transaction_hash=deserialize_transactionhash(data['transaction_hash']),
         canonical_identifier=CanonicalIdentifier(
             chain_identifier=CHAIN_ID_UNSPECIFIED,
             token_network_address=to_canonical_address(data['token_network_identifier']),
             channel_identifier=CHANNEL_ID_UNSPECIFIED,
         ),
         participant=to_canonical_address(data['participant']),
         partner=to_canonical_address(data['partner']),
         locksroot=deserialize_locksroot(data['locksroot']),
         unlocked_amount=TokenAmount(int(data['unlocked_amount'])),
         returned_tokens=TokenAmount(int(data['returned_tokens'])),
         block_number=BlockNumber(int(data['block_number'])),
         block_hash=deserialize_blockhash(data['block_hash']),
     )
Exemple #4
0
 def from_dict(cls, data: Dict[str, Any]) -> "Block":
     return cls(
         block_number=BlockNumber(int(data["block_number"])),
         gas_limit=data["gas_limit"],
         block_hash=deserialize_blockhash(data["block_hash"]),
     )
Exemple #5
0
 def from_dict(cls, data: Dict[str, Any]) -> 'Block':
     return cls(
         block_number=BlockNumber(int(data['block_number'])),
         gas_limit=data['gas_limit'],
         block_hash=deserialize_blockhash(data['block_hash']),
     )