Skip to content

Commit

Permalink
Store malfeasance proof debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
kacpersaw committed May 9, 2024
1 parent 098edb0 commit 115575a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions model/malfeasance_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
1 change: 1 addition & 0 deletions storage/malfaesance_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 115575a

Please sign in to comment.