Skip to content

Commit

Permalink
fix: address issue based on feedback (#803)
Browse files Browse the repository at this point in the history
Co-authored-by: fx0x55 <80245546+fx0x55@users.noreply.github.com>
  • Loading branch information
zakir-code and fx0x55 authored Nov 4, 2024
1 parent fc560de commit 5ffff9f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
16 changes: 8 additions & 8 deletions contract/ifx_bridge_logic.sol.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contract/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import (
)

func (i IBridgeFeeQuoteQuoteInfo) IsTimeout(blockTime time.Time) bool {
return new(big.Int).Sub(i.Expiry, big.NewInt(int64(blockTime.Second()))).Sign() <= 0
return new(big.Int).Sub(i.Expiry, big.NewInt(blockTime.Unix())).Sign() <= 0
}
2 changes: 1 addition & 1 deletion solidity/contracts/bridge/IFxBridgeLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ interface IFxBridgeLogic is IBridgeCall {
address indexed _refund,
address indexed _to,
address _txOrigin,
uint256 _value,
uint256 _eventNonce,
string _dstChain,
address[] _tokens,
uint256[] _amounts,
bytes _data,
uint256 _quoteId,
bytes _memo
);

Expand Down
2 changes: 1 addition & 1 deletion x/crosschain/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (m *MsgBridgeCallClaim) validate() (err error) {
return sdkerrors.ErrInvalidAddress.Wrapf("invalid refund address: %s", err)
}
if m.QuoteId.IsNil() || m.QuoteId.IsNegative() {
return sdkerrors.ErrInvalidRequest.Wrap("invalid value")
return sdkerrors.ErrInvalidRequest.Wrap("invalid quote ID")
}
if len(m.Data) > 0 {
if _, err = hex.DecodeString(m.Data); err != nil {
Expand Down
5 changes: 4 additions & 1 deletion x/erc20/keeper/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ func (k Keeper) GetCache(ctx context.Context, key string) (sdkmath.Int, error) {
func (k Keeper) ReSetCache(ctx context.Context, oldKey, newKey string) error {
amount, err := k.Cache.Get(ctx, oldKey)
if err == nil {
return k.Cache.Set(ctx, newKey, amount)
if err = k.Cache.Set(ctx, newKey, amount); err != nil {
return err
}
return k.Cache.Remove(ctx, oldKey)
}

if !errors.IsOf(err, collections.ErrNotFound) {
Expand Down

0 comments on commit 5ffff9f

Please sign in to comment.