func (ma ModuleAccount) HasPermission(permission string) bool {
	for _, perm := range ma.Permissions {
		if perm == permission {
			return true
		}
	}
	return false
}
HasPermission returns whether or not the module account has permission.
package types
import (
	"fmt"
	yaml "gopkg.in/yaml.v2"
	"github.com/tendermint/tendermint/crypto"
	authtypes "github.com/Dipper-Labs/Dipper-Protocol/app/v0/auth/types"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/supply/exported"
	sdk "github.com/Dipper-Labs/Dipper-Protocol/types"
)
var _ exported.ModuleAccountI = (*ModuleAccount)(nil)
type ModuleAccount struct {
	*authtypes.BaseAccount
	Name        string   `json:"name" yaml:"name"`                
	Permissions []string `json:"permissions" yaml:"permissions"`  
}
func NewModuleAddress(name string) sdk.AccAddress {
	return sdk.AccAddress(crypto.AddressHash([]byte(name)))
}
func NewEmptyModuleAccount(name string, permissions ...string) *ModuleAccount {
	moduleAddress := NewModuleAddress(name)
	baseAcc := authtypes.NewBaseAccountWithAddress(moduleAddress)
	if err := validatePermissions(permissions...); err != nil {
		panic(err)
	}
	return &ModuleAccount{
		BaseAccount: &baseAcc,
		Name:        name,
		Permissions: permissions,
	}
}
func NewModuleAccount(ba *authtypes.BaseAccount,
	name string, permissions ...string) *ModuleAccount {
	if err := validatePermissions(permissions...); err != nil {
		panic(err)
	}
	return &ModuleAccount{
		BaseAccount: ba,
		Name:        name,
		Permissions: permissions,
	}
}