From 115575a3fa6f655986f8f9057eec089010172b79 Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Thu, 9 May 2024 15:04:35 +0200 Subject: [PATCH] Store malfeasance proof debug info --- model/malfeasance_proof.go | 14 ++++++++------ storage/malfaesance_proof.go | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/model/malfeasance_proof.go b/model/malfeasance_proof.go index 34c3b58..4f76ec1 100644 --- a/model/malfeasance_proof.go +++ b/model/malfeasance_proof.go @@ -6,15 +6,17 @@ import ( ) type MalfeasanceProof struct { - Smesher string `json:"smesher" bson:"smesher"` - Layer uint32 `json:"layer" bson:"layer"` - Kind string `json:"kind" bson:"kind"` + Smesher string `json:"smesher" bson:"smesher"` + Layer uint32 `json:"layer" bson:"layer"` + Kind string `json:"kind" bson:"kind"` + DebugInfo string `json:"debugInfo" bson:"debugInfo"` } func NewMalfeasanceProof(in *pb.MalfeasanceProof) *MalfeasanceProof { return &MalfeasanceProof{ - Smesher: utils.BytesToHex(in.GetSmesherId().GetId()), - Layer: in.Layer.GetNumber(), - Kind: in.Kind.String(), + Smesher: utils.BytesToHex(in.GetSmesherId().GetId()), + Layer: in.Layer.GetNumber(), + Kind: in.Kind.String(), + DebugInfo: in.DebugInfo, } } diff --git a/storage/malfaesance_proof.go b/storage/malfaesance_proof.go index e73c2e3..a6411e4 100644 --- a/storage/malfaesance_proof.go +++ b/storage/malfaesance_proof.go @@ -21,6 +21,7 @@ func (s *Storage) SaveMalfeasanceProof(parent context.Context, in *model.Malfeas {Key: "smesher", Value: in.Smesher}, {Key: "layer", Value: in.Layer}, {Key: "kind", Value: in.Kind}, + {Key: "debugInfo", Value: in.DebugInfo}, }}, }, options.Update().SetUpsert(true)) if err != nil {