Skip to content

Commit

Permalink
fix: bug in address parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
byte-bandit committed Aug 15, 2024
1 parent cb86621 commit 014b564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion x/consensus/keeper/estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ func (k Keeper) checkAndProcessEstimatedSubmitLogicCall(
return nil
}

fees, err := k.calculateFeesForEstimate(ctx, sdk.ValAddress(m.GetAssignee()), m.GetChainReferenceID(), estimate)
valAddr, err := sdk.ValAddressFromBech32(m.GetAssignee())
if err != nil {
return fmt.Errorf("failed to parse validator address: %w", err)
}
fees, err := k.calculateFeesForEstimate(ctx, valAddr, m.GetChainReferenceID(), estimate)
if err != nil {
return fmt.Errorf("failed to calculate fees for estimate: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions x/treasury/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (k Keeper) RelayerFee(ctx context.Context, req *types.QueryRelayerFeeReques
return nil, fmt.Errorf("failed to parse validator address: %w", err)
}

fmt.Println("RelayerFee value: %v", addr)
fmt.Println("RelayerFee value string: %s", addr.String())
fmt.Printf("RelayerFee value: %v", addr)
fmt.Printf("RelayerFee value string: %s", addr.String())

k.relayerFees.Iterate(sdk.UnwrapSDKContext(ctx), func(b []byte, rfs *types.RelayerFeeSetting) bool {

Check failure on line 26 in x/treasury/keeper/grpc_query.go

View workflow job for this annotation

GitHub Actions / Running linters

Error return value of `k.relayerFees.Iterate` is not checked (errcheck)
fmt.Printf("rfs: %#+v\n", rfs)
Expand Down

0 comments on commit 014b564

Please sign in to comment.