diff --git a/app/app.go b/app/app.go index 22123b0..23880da 100644 --- a/app/app.go +++ b/app/app.go @@ -129,6 +129,8 @@ import ( appparams "github.com/DoraFactory/doravota/app/params" "github.com/DoraFactory/doravota/docs" + + votatypes "github.com/DoraFactory/doravota/types" ) const ( @@ -257,6 +259,8 @@ func init() { } DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) + + sdk.DefaultPowerReduction = votatypes.DefaultPowerReduction } // Override Wasm size limitation from WASMD. diff --git a/types/precision.go b/types/precision.go new file mode 100644 index 0000000..1e6050c --- /dev/null +++ b/types/precision.go @@ -0,0 +1,13 @@ +package types + +import ( + "math/big" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + BaseDenomUnit = 18 +) + +var DefaultPowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(BaseDenomUnit), nil)) // 10^18 \ No newline at end of file