From 5c97850a3c27cfdae3b593d5b80da1c6f0a5aaf7 Mon Sep 17 00:00:00 2001 From: Nikolay Eskov Date: Sat, 24 Aug 2024 23:21:21 +0300 Subject: [PATCH] DEBUG: add debug 'print' calls for breakpoints. --- pkg/ride/diff_state.go | 5 ++++- pkg/ride/environment.go | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pkg/ride/diff_state.go b/pkg/ride/diff_state.go index f84a05d77e..b92bba4e78 100644 --- a/pkg/ride/diff_state.go +++ b/pkg/ride/diff_state.go @@ -103,7 +103,10 @@ func (db *diffBalance) effectiveBalance() (int64, error) { return v2, nil } -func (db *diffBalance) toFullWavesBalance() (*proto.FullWavesBalance, error) { +func (db *diffBalance) toFullWavesBalance(hit bool) (*proto.FullWavesBalance, error) { + if hit { + print() + } eff, err := db.effectiveBalance() if err != nil { return nil, err diff --git a/pkg/ride/environment.go b/pkg/ride/environment.go index 6dbd7c072e..d015aefbf8 100644 --- a/pkg/ride/environment.go +++ b/pkg/ride/environment.go @@ -150,6 +150,15 @@ func (ws *WrappedState) NewestFullWavesBalance(account proto.Recipient) (*proto. if err != nil { return nil, errors.Wrap(err, "failed to get full Waves balance from wrapped state") } + var ( + hit bool + addrStr = addr.String() + ) + if hit = addrStr == "3MzRUPSNHwHXoE9LJeSDtaeGzrHVV43MXjn"; hit { // challenger + print() + } else if hit = addrStr == "3Msjb7fHtosdG8QJZ2b8YYCp6dpcK6Ck9Qr"; hit { // challenged + print() + } b, err := ws.diff.loadWavesBalance(addr.ID()) if err != nil { return nil, err @@ -161,7 +170,7 @@ func (ws *WrappedState) NewestFullWavesBalance(account proto.Recipient) (*proto. Balance: b.balance, LeaseIn: b.leaseIn, LeaseOut: b.leaseOut, StateGenerating: b.stateGenerating, Challenged: b.challenged, }) - fullWavesBalance, err := b.toFullWavesBalance() + fullWavesBalance, err := b.toFullWavesBalance(hit) if err != nil { return nil, err }