Skip to content

Commit

Permalink
add contract doc to scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
0xstepit committed Dec 19, 2024
1 parent 069c5e6 commit 08051bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/evm/types/scaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
// MustConvertEvmCoinTo18Decimals converts the coin's Amount from its original
// representation into a 18 decimals. The function panics if coin denom is
// not the evm denom or in case of overflow.
//
// CONTRACT: The function should only be called when the coin denom is the EVM. This means that
// should be called only when the code forces the denom to be the expected one.
func MustConvertEvmCoinTo18Decimals(coin sdk.Coin) sdk.Coin {
if coin.Denom != GetEVMCoinDenom() {
panic(fmt.Sprintf("expected evm denom %s, received %s", GetEVMCoinDenom(), coin.Denom))
Expand Down

0 comments on commit 08051bb

Please sign in to comment.