From 08051bb6de774788a6ba36efff5018609f6adfad Mon Sep 17 00:00:00 2001 From: stepit Date: Thu, 19 Dec 2024 16:21:09 +0100 Subject: [PATCH] add contract doc to scaling --- x/evm/types/scaling.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x/evm/types/scaling.go b/x/evm/types/scaling.go index b9bc3bd..7750457 100644 --- a/x/evm/types/scaling.go +++ b/x/evm/types/scaling.go @@ -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))