def save(self, *args, **kwargs): if len(self.bytes_signature) == 0 or len(self.hex_signature) == 0: self.bytes_signature = event_signature_to_log_topic( self.text_signature) self.hex_signature = force_text( remove_0x_prefix(encode_hex(self.bytes_signature))) return super(EventSignature, self).save()
def save(self, *args, **kwargs): if self.bytes_signature_id is None: bytes4_signature = make_4byte_signature(self.text_signature) hex_signature = force_text(remove_0x_prefix(encode_hex(bytes4_signature))) self.bytes_signature, _ = BytesSignature.objects.get_or_create( bytes4_signature=bytes4_signature, defaults={'hex_signature': hex_signature}, ) return super(Signature, self).save()
def save(self, *args, **kwargs): if not self.hex_signature: self.hex_signature = force_text(remove_0x_prefix(encode_hex(self.bytes4_signature))) super(BytesSignature, self).save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.hex_signature: self.hex_signature = force_text( remove_0x_prefix(encode_hex(self.bytes4_signature))) super(BytesSignature, self).save(*args, **kwargs)