From eacccade07164e4f91c0edb09eeac5afcfe81a15 Mon Sep 17 00:00:00 2001 From: Spoorthi <9302666+spoo-bar@users.noreply.github.com> Date: Tue, 7 May 2024 16:00:08 +0100 Subject: [PATCH] refactor(x/callback): Remove redundant code in SaveCallback (#567) * Update callback.go * Update CHANGELOG.md --- CHANGELOG.md | 1 + x/callback/keeper/callback.go | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05196e17..d682a1b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Contains all the PRs that improved the code without changing the behaviors. ### Fixed ### Improvements +- [#567](https://github.com/archway-network/archway/pull/567) - Remove redundant params fetching in SaveCallback ## [v7.0.0](https://github.com/archway-network/archway/releases/tag/v7.0.0) diff --git a/x/callback/keeper/callback.go b/x/callback/keeper/callback.go index a73a45cc..b931485f 100644 --- a/x/callback/keeper/callback.go +++ b/x/callback/keeper/callback.go @@ -118,10 +118,6 @@ func (k Keeper) SaveCallback(ctx sdk.Context, callback types.Callback) error { // This is to ensure that if the param value is decreased in the future, before the callback is executed, // it does not fail with "out of gas" error. it wouldnt be fair for the contract to err out of the callback // if it wouldnt have been expected to at the time of registration - params, err = k.GetParams(ctx) - if err != nil { - return err - } callback.MaxGasLimit = params.CallbackGasLimit return k.Callbacks.Set(ctx, collections.Join3(callback.CallbackHeight, contractAddress.Bytes(), callback.JobId), callback)