From b7064d13838c55f496ea9abd7564bb0e6e016269 Mon Sep 17 00:00:00 2001 From: Marcin Gorzynski Date: Mon, 5 Feb 2024 15:15:54 +0100 Subject: [PATCH] Add packet resp OpenSessionPacketResponse 2 --- intents/packets/open_session.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/intents/packets/open_session.go b/intents/packets/open_session.go index 1245da1..58db165 100644 --- a/intents/packets/open_session.go +++ b/intents/packets/open_session.go @@ -51,7 +51,12 @@ type OpenSessionPacketResponseData struct { Wallet string `json:"wallet"` } -func (p *OpenSessionPacketResponse) UnmarshalFromMap(m map[string]any) error { +func (p *OpenSessionPacketResponse) UnmarshalFromAny(a any) error { + m, ok := a.(map[string]any) + if !ok { + return fmt.Errorf("packet is not a map") + } + if code, ok := m["code"].(string); ok && code == OpenSessionPacketResponseCode { p.Code = code } else {