neoneo-go/pkg/crypto/verifiable.go
Roman Khimov 53c014a0bb crypto/consensus: sign hashes and cache them for consensus payloads
Avoid serializing payload again and again for various purposes. To sign it, we
only need a hash.

Some 2.4% gain in TPS could be achieved with this.
2020-09-09 20:46:31 +03:00

16 lines
392 B
Go

package crypto
import "github.com/nspcc-dev/neo-go/pkg/util"
// Verifiable represents an object which can be verified.
type Verifiable interface {
GetSignedPart() []byte
GetSignedHash() util.Uint256
}
// VerifiableDecodable represents an object which can be both verified and
// decoded from given data.
type VerifiableDecodable interface {
Verifiable
DecodeSignedPart([]byte) error
}