From 1e0612b7bf77a3b6b1b9dadda6ef50ab1235895c Mon Sep 17 00:00:00 2001 From: zakir <80246097+zakir-code@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:48:44 +0800 Subject: [PATCH] fix: correct quote bug and update dockerfile workdir path (#962) Co-authored-by: fx0x55 <80245546+fx0x55@users.noreply.github.com> --- Dockerfile | 2 +- contract/bridge_fee_quote.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cdf0d885..5dbcb2e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN make build FROM alpine:3.19 -WORKDIR root +WORKDIR /root COPY --from=builder /app/build/bin/fxcored /usr/bin/fxcored diff --git a/contract/bridge_fee_quote.go b/contract/bridge_fee_quote.go index 6ab90c42..a3dba34d 100644 --- a/contract/bridge_fee_quote.go +++ b/contract/bridge_fee_quote.go @@ -76,6 +76,9 @@ func (k BridgeFeeQuoteKeeper) GetQuoteById(ctx context.Context, id *big.Int) (IB if err := k.QueryContract(sdk.UnwrapSDKContext(ctx), k.from, k.contract, k.abi, "getQuoteById", &res, id); err != nil { return IBridgeFeeQuoteQuoteInfo{}, err } + if res.Quote.Id.Sign() <= 0 { + return IBridgeFeeQuoteQuoteInfo{}, sdkerrors.ErrInvalidRequest.Wrapf("quote not found") + } return res.Quote, nil }