-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add symbol name to the x/uibc QueryInflowsResponse (#2377)
* feat: add symbol name to the x/uibc QueryInflowsResponse * add missing file * changelog
- Loading branch information
1 parent
007207a
commit cbf1d36
Showing
6 changed files
with
91 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package quota | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/umee-network/umee/v6/x/uibc" | ||
) | ||
|
||
// returns mapping of token denom (according to x/bank) to token symbol name. | ||
func (k Keeper) coinsWithTokenSymbols(ctx sdk.Context, coins sdk.DecCoins) []uibc.DecCoinSymbol { | ||
tokenSymbols := map[string]string{} | ||
for _, t := range k.leverage.GetAllRegisteredTokens(ctx) { | ||
tokenSymbols[t.BaseDenom] = t.SymbolDenom | ||
} | ||
cs := make([]uibc.DecCoinSymbol, len(coins)) | ||
for i := range coins { | ||
cs[i].Denom = coins[i].Denom | ||
cs[i].Amount = coins[i].Amount | ||
cs[i].Symbol = tokenSymbols[coins[i].Denom] | ||
} | ||
return cs | ||
} |