From 0c8556928bcf48881a7b7892cb12b840f45380e7 Mon Sep 17 00:00:00 2001 From: David Vennik Date: Mon, 19 Dec 2022 11:16:58 +0000 Subject: [PATCH] Fix incorrect type switches --- pkg/wire/onions.go | 24 +++++++++++++++++++++++- pkg/wire/onionskins.go | 2 ++ version.go | 8 ++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/pkg/wire/onions.go b/pkg/wire/onions.go index 62b2bfbc..5df17acb 100644 --- a/pkg/wire/onions.go +++ b/pkg/wire/onions.go @@ -61,7 +61,29 @@ func (o OnionSkins) Token(tok sha256.Hash) OnionSkins { func (o OnionSkins) Assemble() (on Onion) { for i := range o { - _ = i + oc := o[len(o)-i-1] + switch oc.(type) { + case *Message: + + case *Forward: + + case *Exit: + + case *Return: + + case *Cipher: + + case *Purchase: + + case *Session: + + case *Acknowledgement: + + case *Response: + + case *Token: + + } } return } diff --git a/pkg/wire/onionskins.go b/pkg/wire/onionskins.go index d82b98f0..086acf69 100644 --- a/pkg/wire/onionskins.go +++ b/pkg/wire/onionskins.go @@ -51,6 +51,8 @@ type Message struct { Onion } +var _ Onion = &Message{} + const OnionHeaderLen = 4 + nonce.IVLen + address.Len + pub.KeyLen func (on *Message) Len() int { return MagicLen + OnionHeaderLen + on.Onion.Len() } diff --git a/version.go b/version.go index 550bc72c..aa47c760 100644 --- a/version.go +++ b/version.go @@ -13,11 +13,11 @@ var ( // GitRef is the gitref, as in refs/heads/branchname. GitRef = "refs/heads/main" // ParentGitCommit is the commit hash of the parent HEAD. - ParentGitCommit = "5deee6f599b306ad79d2fa7503919938d72b255e" + ParentGitCommit = "f11a3d7d23febb46ed83359c800a1a605b023b58" // BuildTime stores the time when the current binary was built. - BuildTime = "2022-12-19T10:45:08Z" + BuildTime = "2022-12-19T11:16:58Z" // SemVer lists the (latest) git tag on the build. - SemVer = "v0.0.187" + SemVer = "v0.0.188" // PathBase is the path base returned from runtime caller. PathBase = "/home/loki/src/github.com/Indra-Labs/indra/" // Major is the major number from the tag. @@ -25,7 +25,7 @@ var ( // Minor is the minor number from the tag. Minor = 0 // Patch is the patch version number from the tag. - Patch = 187 + Patch = 188 ) // Version returns a pretty printed version information string.