account

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

* @author PalletOne core developer <dev@pallet.one> * @date 2018

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestAccountModel

func TestAccountModel(t *testing.T)

Types

type TokenCard

type TokenCard interface {
	GetName() string
	GetSymbol() string
}

TokenCard : TokenCard class interface

func GenerateTokenCard

func GenerateTokenCard(symbol string) TokenCard

GenerateTokenCard : generate token-card from symbol

type TokenCardClass

type TokenCardClass struct {
	// contains filtered or unexported fields
}

TokenCardClass : TokenCard class implement

func (*TokenCardClass) GetName

func (u *TokenCardClass) GetName() string

GetName :

func (*TokenCardClass) GetSymbol

func (u *TokenCardClass) GetSymbol() string

GetSymbol :

type User

type User interface {
	AddNewTokenCard(symbol string) bool
	SetCurrentTokenCard(symbol string) bool
	Call(m string, params ...interface{}) (string, bool)
}

User : user calss interface

func GenerateUser

func GenerateUser(address common.Address) User

GenerateUser : generate a user model for contract call.

type UserClass

type UserClass struct {
	Address     common.Address
	Wallet      []TokenCard
	CurrentCard uint
}

UserClass : user class implement

func (*UserClass) AddNewTokenCard

func (u *UserClass) AddNewTokenCard(symbol string) bool

AddNewTokenCard : generate a token-card if not exist in wallet for given symbol then put into user's wallet

func (*UserClass) Call

func (u *UserClass) Call(m string, params ...interface{}) (string, bool)

Call :

func (*UserClass) SetCurrentTokenCard

func (u *UserClass) SetCurrentTokenCard(symbol string) bool

SetCurrentTokenCard :

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL