Skip to content

Commit

Permalink
Fix: empty secret
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jan 19, 2022
1 parent ececf15 commit 8deedde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cmd/market_maker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func (mm *MarketMaker) listenTracker(ctx context.Context) {
continue
}

if current.Secret == "" {
mm.log.Error().Str("hashed_secret", current.HashedSecret.String()).Msg("empty secret before redeem")
continue
}

if err := mm.tracker.Redeem(ctx, *current, current.Acceptor); err != nil {
mm.log.Err(err).Msg("tracker.Redeem")
continue
Expand All @@ -59,6 +64,10 @@ func (mm *MarketMaker) listenTracker(ctx context.Context) {
mm.log.Err(err).Msg("restoreSecretFromTrackerAtomex")
continue
}
if current.Secret == "" {
mm.log.Error().Str("hashed_secret", current.HashedSecret.String()).Msg("empty secret before refund")
continue
}

if err := mm.tracker.Refund(ctx, *current, current.Initiator); err != nil {
mm.log.Err(err).Msg("tracker.Refund")
Expand Down
2 changes: 1 addition & 1 deletion internal/chain/tezos/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func (t *Tezos) restoreFinilizationSwap(ctx context.Context, bm api.BigMap, key
}

func (t *Tezos) parseTezosContractUpdate(ctx context.Context, update atomextez.BigMapUpdate) error {
hashedSecret := chain.NewHexFromBytes(update.BigMap.Key)
hashedSecret := chain.Hex(update.BigMap.Key)

switch update.Action {
case BigMapActionAddKey:
Expand Down

0 comments on commit 8deedde

Please sign in to comment.