def __bytes__(self): # type: () -> bytes vb = int_to_byte(self.v) rb = pad32(int_to_big_endian(self.r)) sb = pad32(int_to_big_endian(self.s)) # FIXME: Enable type checking once we have type annotations in eth_utils return b''.join((rb, sb, vb)) # type: ignore
def to_bytes_v_hacked(self) -> bytes: v = self.v if v == 0 or v == 1: v += 27 vb = int_to_byte(v) rb = pad32(int_to_big_endian(self.r)) sb = pad32(int_to_big_endian(self.s)) # FIXME: Enable type checking once we have type annotations in eth_utils return b"".join((rb, sb, vb)) # type: ignore
def to_bytes(self) -> bytes: vb = int_to_byte(self.v) rb = pad32(int_to_big_endian(self.r)) sb = pad32(int_to_big_endian(self.s)) return b''.join((rb, sb, vb))
def to_bytes(vrs: Tuple[int, int, int]) -> bytes: vb = int_to_byte(vrs[0]) rb = pad32(int_to_big_endian(vrs[1])) sb = pad32(int_to_big_endian(vrs[2])) return b''.join((rb, sb, vb))