def deserialize_slot(self, key, value): value = super().deserialize_slot(key, value) if key == 'compute_task_def': value = ComputeTaskDef(value) if key in ('price', 'size'): validators.validate_integer( field_name=key, value=value, ) return value
def deserialize_slot(self, key: str, value: Any) -> Any: value = super().deserialize_slot(key, value) if key == 'nonce': validate_integer( field_name=key, value=value, ) validate_maximum_int_length( field_name=key, value=value, maximum_allowed_length=78, ) return value
def deserialize_slot(self, key: str, value: Any) -> Any: value = super().deserialize_slot(key, value) if key == 'to': validate_bytes( field_name=key, value=value, maximum_allowed_length=20, ) if key == 'data': validate_bytes( field_name=key, value=value, ) if key in TransactionAbstractMessage.SLOTS_TO_CONVERT: # Reverse conversion from string to integer value = int(value) validate_integer(field_name=key, value=value) validate_maximum_int_length( field_name=key, value=value, maximum_allowed_length=78, ) return value
def deserialize_slot(self, key: str, value: Any) -> Any: value = super().deserialize_slot(key, value) if key in SignedTransaction.SLOTS_TO_CONVERT: # Reverse conversion from string to integer value = int(value) validate_integer( field_name=key, value=value, ) if key == 'v': validate_maximum_int_length( field_name=key, value=value, maximum_allowed_length=3, ) if key in ('r', 's'): validate_maximum_int_length( field_name=key, value=value, maximum_allowed_length=78, ) return value
def deserialize_slot(self, key: str, value: Any) -> Any: value = super().deserialize_slot(key, value) if key == 'to': validate_bytes( field_name=key, value=value, maximum_allowed_length=20, ) if key == 'data': validate_bytes( field_name=key, value=value, ) if key in ('gasprice', 'startgas', 'value'): validate_integer( field_name=key, value=value ) validate_maximum_int_length( field_name=key, value=value, maximum_allowed_length=78, ) return value
def validate(self, value): return validators.validate_integer( field_name=self.field_name, value=value, )