mirror of
https://github.com/status-im/status-go.git
synced 2025-02-16 16:56:53 +00:00
Added dumps to payload parsing
This commit is contained in:
parent
4cbe874dea
commit
8fb069286c
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/status-im/status-go/images"
|
"github.com/status-im/status-go/images"
|
||||||
@ -79,6 +80,7 @@ func (a *Account) FromProtobuf(ma *protobuf.MultiAccount) {
|
|||||||
a.KeycardPairing = ma.KeycardPairing
|
a.KeycardPairing = ma.KeycardPairing
|
||||||
a.KeyUID = ma.KeyUid
|
a.KeyUID = ma.KeyUid
|
||||||
a.Images = identityImages
|
a.Images = identityImages
|
||||||
|
spew.Dump("Account.FromProtobuf end", ma, a)
|
||||||
}
|
}
|
||||||
|
|
||||||
type MultiAccountMarshaller interface {
|
type MultiAccountMarshaller interface {
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/btcsuite/btcutil/base58"
|
"github.com/btcsuite/btcutil/base58"
|
||||||
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
"github.com/status-im/status-go/multiaccounts"
|
"github.com/status-im/status-go/multiaccounts"
|
||||||
"github.com/status-im/status-go/signal"
|
"github.com/status-im/status-go/signal"
|
||||||
@ -156,6 +157,7 @@ func (c *PairingClient) receiveAccountData() error {
|
|||||||
|
|
||||||
err = c.PayloadManager.Receive(payload)
|
err = c.PayloadManager.Receive(payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
spew.Dump("c.PayloadManager.Receive(payload)", err.Error())
|
||||||
signal.SendLocalPairingEvent(Event{Type: EventProcessError, Error: err})
|
signal.SendLocalPairingEvent(Event{Type: EventProcessError, Error: err})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
|
|
||||||
"github.com/status-im/status-go/account/generator"
|
"github.com/status-im/status-go/account/generator"
|
||||||
@ -79,6 +80,8 @@ func (ppm *PairingPayloadManager) Mount() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spew.Dump("PairingPayloadManager.Mount()", ppm.ppm.keys, ppm.ppm.multiaccount, ppm.ppm.password, pb)
|
||||||
|
|
||||||
return ppm.Encrypt(pb)
|
return ppm.Encrypt(pb)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +140,7 @@ func (pem *PayloadEncryptionManager) Encrypt(data []byte) error {
|
|||||||
|
|
||||||
func (pem *PayloadEncryptionManager) Decrypt(data []byte) error {
|
func (pem *PayloadEncryptionManager) Decrypt(data []byte) error {
|
||||||
pd, err := common.Decrypt(data, pem.aesKey)
|
pd, err := common.Decrypt(data, pem.aesKey)
|
||||||
|
spew.Dump("common.Decrypt(data, pem.aesKey)", data, pem.aesKey, pd, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -198,6 +202,7 @@ func (ppm *PairingPayloadMarshaller) accountKeysToProtobuf() []*protobuf.LocalPa
|
|||||||
func (ppm *PairingPayloadMarshaller) UnmarshalProtobuf(data []byte) error {
|
func (ppm *PairingPayloadMarshaller) UnmarshalProtobuf(data []byte) error {
|
||||||
pb := new(protobuf.LocalPairingPayload)
|
pb := new(protobuf.LocalPairingPayload)
|
||||||
err := proto.Unmarshal(data, pb)
|
err := proto.Unmarshal(data, pb)
|
||||||
|
spew.Dump("protobuf.LocalPairingPayload", pb, pb.Multiaccount, pb.Keys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -216,6 +221,7 @@ func (ppm *PairingPayloadMarshaller) accountKeysFromProtobuf(pbKeys []*protobuf.
|
|||||||
for _, key := range pbKeys {
|
for _, key := range pbKeys {
|
||||||
ppm.keys[key.Name] = key.Data
|
ppm.keys[key.Name] = key.Data
|
||||||
}
|
}
|
||||||
|
spew.Dump("PairingPayloadMarshaller.accountKeysFromProtobuf", pbKeys, ppm.keys)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ppm *PairingPayloadMarshaller) multiaccountFromProtobuf(pbMultiAccount *protobuf.MultiAccount) {
|
func (ppm *PairingPayloadMarshaller) multiaccountFromProtobuf(pbMultiAccount *protobuf.MultiAccount) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user