Skip to content

Commit

Permalink
DEBUG: add debug 'print' calls for breakpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickeskov committed Aug 24, 2024
1 parent e7a52ec commit 5c97850
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/ride/diff_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Check failure on line 108 in pkg/ride/diff_state.go

View workflow job for this annotation

GitHub Actions / ubuntu

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 108 in pkg/ride/diff_state.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 108 in pkg/ride/diff_state.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 108 in pkg/ride/diff_state.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 108 in pkg/ride/diff_state.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
}
eff, err := db.effectiveBalance()
if err != nil {
return nil, err
Expand Down
11 changes: 10 additions & 1 deletion pkg/ride/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Check failure on line 158 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / ubuntu

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 158 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 158 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 158 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 158 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
} else if hit = addrStr == "3Msjb7fHtosdG8QJZ2b8YYCp6dpcK6Ck9Qr"; hit { // challenged
print()

Check failure on line 160 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / ubuntu

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 160 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 160 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 160 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

Check failure on line 160 in pkg/ride/environment.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
}
b, err := ws.diff.loadWavesBalance(addr.ID())
if err != nil {
return nil, err
Expand All @@ -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
}
Expand Down

0 comments on commit 5c97850

Please sign in to comment.