From d1ef9e67be287123a508c14e2bdd327d8b5f2b5f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 29 Jul 2020 17:23:31 +0300 Subject: [PATCH] examples: fix method names Signed-off-by: Evgenii Stratonikov --- examples/token/nep5/nep5.go | 13 ++++++------- examples/token/token.go | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/token/nep5/nep5.go b/examples/token/nep5/nep5.go index e463ab581..79f7b7692 100644 --- a/examples/token/nep5/nep5.go +++ b/examples/token/nep5/nep5.go @@ -38,14 +38,13 @@ func (t Token) GetSupply(ctx storage.Context) interface{} { return getIntFromDB(ctx, []byte(t.CirculationKey)) } -// TBalanceOf gets the token balance of a specific address -// TODO: https://github.com/nspcc-dev/neo-go/issues/1150 -func (t Token) TBalanceOf(ctx storage.Context, holder []byte) interface{} { +// BalanceOf gets the token balance of a specific address +func (t Token) BalanceOf(ctx storage.Context, holder []byte) interface{} { return getIntFromDB(ctx, holder) } -// TTransfer token from one user to another -func (t Token) TTransfer(ctx storage.Context, from []byte, to []byte, amount int) bool { +// Transfer token from one user to another +func (t Token) Transfer(ctx storage.Context, from []byte, to []byte, amount int) bool { amountFrom := t.CanTransfer(ctx, from, to, amount) if amountFrom == -1 { return false @@ -105,8 +104,8 @@ func IsUsableAddress(addr []byte) bool { return false } -// TMint initial supply of tokens. -func (t Token) TMint(ctx storage.Context, to []byte) bool { +// Mint initial supply of tokens. +func (t Token) Mint(ctx storage.Context, to []byte) bool { if !IsUsableAddress(t.Owner) { return false } diff --git a/examples/token/token.go b/examples/token/token.go index c7b090383..1bacf8e72 100644 --- a/examples/token/token.go +++ b/examples/token/token.go @@ -99,19 +99,19 @@ func TotalSupply() interface{} { func BalanceOf(holder []byte) interface{} { t := createToken() ctx := storage.GetContext() - return t.TBalanceOf(ctx, holder) + return t.BalanceOf(ctx, holder) } // Transfer token from one user to another func Transfer(from []byte, to []byte, amount int) bool { t := createToken() ctx := storage.GetContext() - return t.TTransfer(ctx, from, to, amount) + return t.Transfer(ctx, from, to, amount) } // Mint initial supply of tokens func Mint(to []byte) bool { t := createToken() ctx := storage.GetContext() - return t.TMint(ctx, to) + return t.Mint(ctx, to) }