From 016b6bc50b213f4a0847398b71bae8918713cd83 Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Tue, 5 Sep 2023 17:25:07 +0800 Subject: [PATCH] Fix example in README (#23) message.Verify usage was outdated --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 294a486..74c3b13 100644 --- a/README.md +++ b/README.md @@ -65,20 +65,21 @@ can be done in a single call with verify: var publicKey *ecdsa.PublicKey var err error -// Optional nonce variable to be matched against the +// Optional domain and nonce variable to be matched against the // built message struct being verified +var optionalDomain *string var optionalNonce *string // Optional timestamp variable to verify at any point // in time, by default it will use `time.Now()` var optionalTimestamp *time.Time -publicKey, err = message.Verify(signature, optionalNonce, optionalTimestamp) +publicKey, err = message.Verify(signature, optionalDomain, optionalNonce, optionalTimestamp) -// If you won't be using nonce matching and want +// If you won't be using domain and nonce matching and want // to verify the message at current time, it's -// safe to pass `nil` in both arguments -publicKey, err = message.Verify(signature, nil, nil) +// safe to pass `nil` in these arguments +publicKey, err = message.Verify(signature, nil, nil, nil) ``` ### Serialization of a SIWE Message