Skip to content

Commit

Permalink
Add packet resp OpenSessionPacketResponse 2
Browse files Browse the repository at this point in the history
  • Loading branch information
marino39 committed Feb 5, 2024
1 parent d079002 commit b7064d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion intents/packets/open_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b7064d1

Please sign in to comment.