From 7537453c83a4af71e6a13d7bfb4d9463f04e503d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 24 Oct 2018 09:46:26 -0400 Subject: [PATCH] Move default denomination to account type (for now) --- types/account.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/account.go b/types/account.go index 4d58e431..70193e45 100644 --- a/types/account.go +++ b/types/account.go @@ -5,13 +5,18 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/ethermint/x/bank" ethcmn "github.com/ethereum/go-ethereum/common" ) var _ auth.Account = (*Account)(nil) +const ( + // DenomDefault defines the single coin type/denomination supported in + // Ethermint. + DenomDefault = "Photon" +) + // ---------------------------------------------------------------------------- // Main Ethermint account // ---------------------------------------------------------------------------- @@ -37,12 +42,12 @@ func ProtoBaseAccount() auth.Account { // Balance returns the balance of an account. func (acc Account) Balance() sdk.Int { - return acc.GetCoins().AmountOf(bank.DenomEthereum) + return acc.GetCoins().AmountOf(DenomDefault) } // SetBalance sets an account's balance. func (acc Account) SetBalance(amt sdk.Int) { - acc.SetCoins(sdk.Coins{sdk.NewCoin(bank.DenomEthereum, amt)}) + acc.SetCoins(sdk.Coins{sdk.NewCoin(DenomDefault, amt)}) } // ----------------------------------------------------------------------------