Added dumps to payload parsing

This commit is contained in:
Samuel Hawksby-Robinson 2022-10-17 10:25:57 +01:00
parent 4cbe874dea
commit 8fb069286c
3 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"encoding/json"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/log"
"github.com/status-im/status-go/images"
@ -79,6 +80,7 @@ func (a *Account) FromProtobuf(ma *protobuf.MultiAccount) {
a.KeycardPairing = ma.KeycardPairing
a.KeyUID = ma.KeyUid
a.Images = identityImages
spew.Dump("Account.FromProtobuf end", ma, a)
}
type MultiAccountMarshaller interface {

View File

@ -14,6 +14,7 @@ import (
"net/url"
"github.com/btcsuite/btcutil/base58"
"github.com/davecgh/go-spew/spew"
"github.com/status-im/status-go/multiaccounts"
"github.com/status-im/status-go/signal"
@ -156,6 +157,7 @@ func (c *PairingClient) receiveAccountData() error {
err = c.PayloadManager.Receive(payload)
if err != nil {
spew.Dump("c.PayloadManager.Receive(payload)", err.Error())
signal.SendLocalPairingEvent(Event{Type: EventProcessError, Error: err})
return err
}

View File

@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"github.com/davecgh/go-spew/spew"
"github.com/golang/protobuf/proto"
"github.com/status-im/status-go/account/generator"
@ -79,6 +80,8 @@ func (ppm *PairingPayloadManager) Mount() error {
return err
}
spew.Dump("PairingPayloadManager.Mount()", ppm.ppm.keys, ppm.ppm.multiaccount, ppm.ppm.password, pb)
return ppm.Encrypt(pb)
}
@ -137,6 +140,7 @@ func (pem *PayloadEncryptionManager) Encrypt(data []byte) error {
func (pem *PayloadEncryptionManager) Decrypt(data []byte) error {
pd, err := common.Decrypt(data, pem.aesKey)
spew.Dump("common.Decrypt(data, pem.aesKey)", data, pem.aesKey, pd, err)
if err != nil {
return err
}
@ -198,6 +202,7 @@ func (ppm *PairingPayloadMarshaller) accountKeysToProtobuf() []*protobuf.LocalPa
func (ppm *PairingPayloadMarshaller) UnmarshalProtobuf(data []byte) error {
pb := new(protobuf.LocalPairingPayload)
err := proto.Unmarshal(data, pb)
spew.Dump("protobuf.LocalPairingPayload", pb, pb.Multiaccount, pb.Keys)
if err != nil {
return err
}
@ -216,6 +221,7 @@ func (ppm *PairingPayloadMarshaller) accountKeysFromProtobuf(pbKeys []*protobuf.
for _, key := range pbKeys {
ppm.keys[key.Name] = key.Data
}
spew.Dump("PairingPayloadMarshaller.accountKeysFromProtobuf", pbKeys, ppm.keys)
}
func (ppm *PairingPayloadMarshaller) multiaccountFromProtobuf(pbMultiAccount *protobuf.MultiAccount) {