Skip to content

Commit a341bbb

Browse files
committed
Expose the hash on all varsig
1 parent af0845c commit a341bbb

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# go-varsig
22

3-
`go-varsig` implements the upcoming v1.0.0 release of the [`varsig` specification](https://github.com/ChainAgnostic/varsig/pull/18)
4-
with limited (and soon to be deprecated) support for the `varsig` < v1.0
5-
specification. This is predominantly included to support the UCAN v1.0
6-
use-case.
3+
`go-varsig` is a go implementation of the [`varsig` specification](https://github.com/ChainAgnostic/varsig).
74

85
Built with ❤️ by [Consensys](https://consensys.io/).
96

@@ -51,7 +48,7 @@ simulate the `docker` daemon:
5148
export DOCKER_HOST=unix:///var/run/podman/podman.sock
5249
```
5350

54-
Since there's only one workflow, the simplest command to test it is:
51+
The simplest command to test it is:
5552

5653
```bash
5754
act

registry_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func (v testVarsig) Discriminator() varsig.Discriminator {
6161
return v.disc
6262
}
6363

64+
func (v testVarsig) Hash() varsig.Hash {
65+
return varsig.HashUnspecified
66+
}
67+
6468
func (v testVarsig) PayloadEncoding() varsig.PayloadEncoding {
6569
return v.payEnc
6670
}

varsig.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ type Varsig interface {
3232
// Discriminator returns the algorithm used to produce the corresponding signature.
3333
Discriminator() Discriminator
3434

35+
// Hash returns the hash used on the data before signature.
36+
Hash() Hash
37+
3538
// PayloadEncoding returns the codec that was used to encode the signed data.
3639
PayloadEncoding() PayloadEncoding
3740

0 commit comments

Comments
 (0)