neoneo-go/pkg/network/notary_feer.go
Roman Khimov 746644a4eb network: decouple it from blockchainer.Blockchainer
We don't need all of it.
2022-01-14 19:57:16 +03:00

39 lines
896 B
Go

package network
import (
"math/big"
"github.com/nspcc-dev/neo-go/pkg/util"
)
// NotaryFeer implements mempool.Feer interface for Notary balance handling.
type NotaryFeer struct {
bc Ledger
}
// FeePerByte implements mempool.Feer interface.
func (f NotaryFeer) FeePerByte() int64 {
return f.bc.FeePerByte()
}
// GetUtilityTokenBalance implements mempool.Feer interface.
func (f NotaryFeer) GetUtilityTokenBalance(acc util.Uint160) *big.Int {
return f.bc.GetNotaryBalance(acc)
}
// BlockHeight implements mempool.Feer interface.
func (f NotaryFeer) BlockHeight() uint32 {
return f.bc.BlockHeight()
}
// P2PSigExtensionsEnabled implements mempool.Feer interface.
func (f NotaryFeer) P2PSigExtensionsEnabled() bool {
return f.bc.P2PSigExtensionsEnabled()
}
// NewNotaryFeer returns new NotaryFeer instance.
func NewNotaryFeer(bc Ledger) NotaryFeer {
return NotaryFeer{
bc: bc,
}
}