From 095ed3f64e2de185188a5d59bc2fb955cc238fa5 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 16 Nov 2021 22:51:04 +0300 Subject: [PATCH] dao: drop unused AppendNEP17Transfer() --- pkg/core/dao/dao.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkg/core/dao/dao.go b/pkg/core/dao/dao.go index 5eac7e505..4e5d609dd 100644 --- a/pkg/core/dao/dao.go +++ b/pkg/core/dao/dao.go @@ -31,7 +31,6 @@ var ( // DAO is a data access object. type DAO interface { AppendAppExecResult(aer *state.AppExecResult, buf *io.BufBinWriter) error - AppendNEP17Transfer(acc util.Uint160, index uint32, isNew bool, tr *state.NEP17Transfer) (bool, error) DeleteBlock(h util.Uint256, buf *io.BufBinWriter) error DeleteContractID(id int32) error DeleteStorageItem(id int32, key []byte) error @@ -204,25 +203,6 @@ func (dao *Simple) PutTokenTransferLog(acc util.Uint160, index uint32, lg *state return dao.Store.Put(key, lg.Raw) } -// AppendNEP17Transfer appends a single NEP17 transfer to a log. -// First return value signalizes that log size has exceeded batch size. -func (dao *Simple) AppendNEP17Transfer(acc util.Uint160, index uint32, isNew bool, tr *state.NEP17Transfer) (bool, error) { - var lg *state.TokenTransferLog - if isNew { - lg = new(state.TokenTransferLog) - } else { - var err error - lg, err = dao.GetTokenTransferLog(acc, index) - if err != nil { - return false, err - } - } - if err := lg.Append(tr); err != nil { - return false, err - } - return lg.Size() >= state.TokenTransferBatchSize, dao.PutTokenTransferLog(acc, index, lg) -} - // -- end transfer log. // -- start notification event.