From d07b95d653dd546fbbb7611fd66820a3c5eb8f6e Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Thu, 15 Dec 2022 13:53:33 -0800 Subject: [PATCH] Fix implementation_test.go --- go.mod | 2 +- go.sum | 4 ++-- indexedDb/channels/implementation.go | 2 +- indexedDb/channels/implementation_test.go | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 34c28069..fdec09b7 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/jwalterweatherman v1.1.0 gitlab.com/elixxir/client/v4 v4.3.9-0.20221215212713-60855bdff085 - gitlab.com/elixxir/crypto v0.0.7-0.20221214233734-3c27a1e92343 + gitlab.com/elixxir/crypto v0.0.7-0.20221214192244-6783272c04a0 gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a gitlab.com/xx_network/crypto v0.0.5-0.20221121220724-8eefdbb0eb46 gitlab.com/xx_network/primitives v0.0.4-0.20221209210320-376735467d58 diff --git a/go.sum b/go.sum index 043ea713..fe843f34 100644 --- a/go.sum +++ b/go.sum @@ -373,8 +373,8 @@ gitlab.com/elixxir/client/v4 v4.3.9-0.20221215212713-60855bdff085 h1:r0ViDvdl6kC gitlab.com/elixxir/client/v4 v4.3.9-0.20221215212713-60855bdff085/go.mod h1:5WIUMXJnpLi5uThXJPL7DpAgnINm+sR2o7t/Bh4QrJg= gitlab.com/elixxir/comms v0.0.4-0.20221215202150-4ff70a83d4a4 h1:aCKKTGRJHoB67SivOHtmUBBP/Xqw8iWLbCMtzVCTAU4= gitlab.com/elixxir/comms v0.0.4-0.20221215202150-4ff70a83d4a4/go.mod h1:P7j/b/HLQHAybShZiGWUxEQ8kmGpsfWP0V9QZov7zis= -gitlab.com/elixxir/crypto v0.0.7-0.20221214233734-3c27a1e92343 h1:9g499Lf25k8uCF+c0l8ThOlEQESi/0qYteV6fxo54f8= -gitlab.com/elixxir/crypto v0.0.7-0.20221214233734-3c27a1e92343/go.mod h1:oRh3AwveOEvpk9E3kRcMGK8fImcEnN0PY4jr9HDgQE8= +gitlab.com/elixxir/crypto v0.0.7-0.20221214192244-6783272c04a0 h1:dwCf7wKv2DCuYZZ394bSQWdUOXiABLsEyDvXZUOo83o= +gitlab.com/elixxir/crypto v0.0.7-0.20221214192244-6783272c04a0/go.mod h1:oRh3AwveOEvpk9E3kRcMGK8fImcEnN0PY4jr9HDgQE8= gitlab.com/elixxir/ekv v0.2.1 h1:dtwbt6KmAXG2Tik5d60iDz2fLhoFBgWwST03p7T+9Is= gitlab.com/elixxir/ekv v0.2.1/go.mod h1:USLD7xeDnuZEavygdrgzNEwZXeLQJK/w1a+htpN+JEU= gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a h1:F17FfEjS+/uDI/TTYQD21S5JvNZ9+p9bieau2nyLCzo= diff --git a/indexedDb/channels/implementation.go b/indexedDb/channels/implementation.go index c51af2cd..f757bd9b 100644 --- a/indexedDb/channels/implementation.go +++ b/indexedDb/channels/implementation.go @@ -352,7 +352,7 @@ func (w *wasmModel) updateMessage(currentMsgJson string, newMessage := &Message{} err := json.Unmarshal([]byte(currentMsgJson), newMessage) if err != nil { - return 0, nil + return 0, err } if status != nil { diff --git a/indexedDb/channels/implementation_test.go b/indexedDb/channels/implementation_test.go index f51b226f..8f9c24f2 100644 --- a/indexedDb/channels/implementation_test.go +++ b/indexedDb/channels/implementation_test.go @@ -47,23 +47,24 @@ func TestWasmModel_msgIDLookup(t *testing.T) { testMsg := buildMessage([]byte(testString), testMsgId.Bytes(), nil, testString, []byte(testString), []byte{8, 6, 7, 5}, 0, netTime.Now(), - time.Second, 0, 0, channels.Sent) + time.Second, 0, 0, false, false, channels.Sent) _, err = eventModel.receiveHelper(testMsg, false) if err != nil { t.Fatalf("%+v", err) } - uuid, err := eventModel.msgIDLookup(testMsgId) + msg, err := eventModel.msgIDLookup(testMsgId) if err != nil { t.Fatalf("%+v", err) } - if uuid == 0 { + if msg.ID == 0 { t.Fatalf("Expected to get a UUID!") } } // Test wasmModel.UpdateSentStatus happy path and ensure fields don't change. func Test_wasmModel_UpdateSentStatus(t *testing.T) { + storage.GetLocalStorage().Clear() testString := "test" testMsgId := channel.MakeMessageID([]byte(testString), &id.ID{1}) eventModel, err := newWASMModel(testString, nil, dummyCallback) -- GitLab