2020-11-27 10:55:48 +00:00
|
|
|
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 {
|
2022-01-14 01:09:54 +00:00
|
|
|
bc Ledger
|
2020-11-27 10:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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()
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewNotaryFeer returns new NotaryFeer instance.
|
2022-01-14 01:09:54 +00:00
|
|
|
func NewNotaryFeer(bc Ledger) NotaryFeer {
|
2020-11-27 10:55:48 +00:00
|
|
|
return NotaryFeer{
|
|
|
|
bc: bc,
|
|
|
|
}
|
|
|
|
}
|