code: def _data_to_sign(self) -> bytes:
          
          packed = self.packed()
  
          field = type(packed).fields_spec[-1]
          assert field.name == 'signature', 'signature is not the last field'
  
          # this slice must be from the end of the buffer
          return packed.data[:-field.size_bytes]
docs: Return the binary data to be/which was signed