Skip to content

Commit

Permalink
chore: use cosmos types for params
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed May 18, 2024
1 parent d5909d9 commit 418eb8d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/tendermint/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
codecTypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/std"
paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
slashingTypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/gogo/protobuf/proto"
Expand Down Expand Up @@ -382,8 +383,8 @@ func (rpc *RPC) GetConsumerSoftOutOutThreshold(
)
defer span.End()

var response *types.ParamsResponse
info, err := rpc.Get(
var response paramsTypes.QueryParamsResponse
info, err := rpc.Get2(
rpc.Chain.LCDEndpoint+"/cosmos/params/v1beta1/params?subspace=ccvconsumer&key=SoftOptOutThreshold",
&response,
childQuerierCtx,
Expand All @@ -392,11 +393,6 @@ func (rpc *RPC) GetConsumerSoftOutOutThreshold(
return 0, &info, err
}

if response.Code != 0 {
info.Success = false
return 0, &info, fmt.Errorf("expected code 0, but got %d", response.Code)
}

valueStripped := strings.ReplaceAll(response.Param.Value, "\"", "")
value, err := strconv.ParseFloat(valueStripped, 64)
if err != nil {
Expand Down

0 comments on commit 418eb8d

Please sign in to comment.