From 8956f015fcab4417d10c49e5ea7bad5141e61e9e Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 22 Oct 2021 17:42:28 +0300 Subject: [PATCH] [#941] morph/notary: Delete useless "low till" check Signed-off-by: Pavel Karpy --- pkg/morph/client/notary.go | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index d9d6b1f52..e30cd3c15 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -197,15 +197,7 @@ func (c *Client) DepositNotary(amount fixedn.Fixed8, delta uint32) (res util.Uin nil, ) if err != nil { - if !tillShouldNotBeLessError(err) { - return util.Uint256{}, fmt.Errorf("can't make notary deposit: %w", err) - } - - c.logger.Debug("notary deposit invoke failed due to low `till` value", - zap.Int64("amount", int64(amount)), - zap.Uint32("till", bc+delta)) - - return util.Uint256{}, nil + return util.Uint256{}, fmt.Errorf("can't make notary deposit: %w", err) } c.logger.Debug("notary deposit invoke", @@ -753,19 +745,6 @@ func alreadyOnChainError(err error) bool { return strings.Contains(err.Error(), alreadyOnChainErrorMessage) } -// Neo RPC node can return "`till` shouldn't be less then the -// previous value <>" message. This error is expected and ignored. -// This happens because previous `till` value could be bigger -// than the current one due to significant epoch duration decrease. -// Theoretically, balance should not run out so fast and such -// errors are ignored(at least for now; there is #910 issue -// for it). -func tillShouldNotBeLessError(err error) bool { - const tillTooLowErrorMessage = "less then the previous value" - - return strings.Contains(err.Error(), tillTooLowErrorMessage) -} - // CalculateNotaryDepositAmount calculates notary deposit amount // using the rule: // IF notaryBalance < gasBalance * gasMul {