Expose the hash on all varsig

This commit is contained in:
Michael Muré
2025-07-29 14:04:42 +02:00
committed by Michael Muré
parent af0845c832
commit 8c8da51656
3 changed files with 9 additions and 5 deletions

View File

@@ -1,9 +1,6 @@
# go-varsig
`go-varsig` implements the upcoming v1.0.0 release of the [`varsig` specification](https://github.com/ChainAgnostic/varsig/pull/18)
with limited (and soon to be deprecated) support for the `varsig` < v1.0
specification. This is predominantly included to support the UCAN v1.0
use-case.
`go-varsig` is a go implementation of the [`varsig` specification](https://github.com/ChainAgnostic/varsig).
Built with ❤️ by [Consensys](https://consensys.io/).
@@ -51,7 +48,7 @@ simulate the `docker` daemon:
export DOCKER_HOST=unix:///var/run/podman/podman.sock
```
Since there's only one workflow, the simplest command to test it is:
The simplest command to test it is:
```bash
act

View File

@@ -61,6 +61,10 @@ func (v testVarsig) Discriminator() varsig.Discriminator {
return v.disc
}
func (v testVarsig) Hash() varsig.Hash {
return varsig.HashUnspecified
}
func (v testVarsig) PayloadEncoding() varsig.PayloadEncoding {
return v.payEnc
}

View File

@@ -32,6 +32,9 @@ type Varsig interface {
// Discriminator returns the algorithm used to produce the corresponding signature.
Discriminator() Discriminator
// Hash returns the hash used on the data before signature.
Hash() Hash
// PayloadEncoding returns the codec that was used to encode the signed data.
PayloadEncoding() PayloadEncoding