From 8c8da51656e4e8279b6ba73806259d99b212a581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Tue, 29 Jul 2025 14:04:42 +0200 Subject: [PATCH] Expose the hash on all varsig --- README.md | 7 ++----- registry_test.go | 4 ++++ varsig.go | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b47decc..a3284e3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/registry_test.go b/registry_test.go index 61400b4..5942fd0 100644 --- a/registry_test.go +++ b/registry_test.go @@ -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 } diff --git a/varsig.go b/varsig.go index 8cbbd91..429cb99 100644 --- a/varsig.go +++ b/varsig.go @@ -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