dao: drop DAO interface
It's a remnant from the days when we had Simple and Cached DAO implementations, now it makes zero sense.
This commit is contained in:
parent
9d2ef775cf
commit
aefb26255a
15 changed files with 79 additions and 122 deletions
|
@ -182,7 +182,7 @@ func (p *Policy) getFeePerByte(ic *interop.Context, _ []stackitem.Item) stackite
|
|||
}
|
||||
|
||||
// GetFeePerByteInternal returns required transaction's fee per byte.
|
||||
func (p *Policy) GetFeePerByteInternal(dao dao.DAO) int64 {
|
||||
func (p *Policy) GetFeePerByteInternal(dao *dao.Simple) int64 {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
if p.isValid {
|
||||
|
@ -192,7 +192,7 @@ func (p *Policy) GetFeePerByteInternal(dao dao.DAO) int64 {
|
|||
}
|
||||
|
||||
// GetMaxVerificationGas returns maximum gas allowed to be burned during verificaion.
|
||||
func (p *Policy) GetMaxVerificationGas(_ dao.DAO) int64 {
|
||||
func (p *Policy) GetMaxVerificationGas(_ *dao.Simple) int64 {
|
||||
if p.isValid {
|
||||
return p.maxVerificationGas
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ func (p *Policy) getExecFeeFactor(ic *interop.Context, _ []stackitem.Item) stack
|
|||
}
|
||||
|
||||
// GetExecFeeFactorInternal returns current execution fee factor.
|
||||
func (p *Policy) GetExecFeeFactorInternal(d dao.DAO) int64 {
|
||||
func (p *Policy) GetExecFeeFactorInternal(d *dao.Simple) int64 {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
if p.isValid {
|
||||
|
@ -235,7 +235,7 @@ func (p *Policy) isBlocked(ic *interop.Context, args []stackitem.Item) stackitem
|
|||
}
|
||||
|
||||
// IsBlockedInternal checks whether provided account is blocked.
|
||||
func (p *Policy) IsBlockedInternal(dao dao.DAO, hash util.Uint160) bool {
|
||||
func (p *Policy) IsBlockedInternal(dao *dao.Simple, hash util.Uint160) bool {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
if p.isValid {
|
||||
|
@ -257,7 +257,7 @@ func (p *Policy) getStoragePrice(ic *interop.Context, _ []stackitem.Item) stacki
|
|||
}
|
||||
|
||||
// GetStoragePriceInternal returns current execution fee factor.
|
||||
func (p *Policy) GetStoragePriceInternal(d dao.DAO) int64 {
|
||||
func (p *Policy) GetStoragePriceInternal(d *dao.Simple) int64 {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
if p.isValid {
|
||||
|
@ -341,7 +341,7 @@ func (p *Policy) unblockAccount(ic *interop.Context, args []stackitem.Item) stac
|
|||
// CheckPolicy checks whether transaction conforms to current policy restrictions
|
||||
// like not being signed by blocked account or not exceeding block-level system
|
||||
// fee limit.
|
||||
func (p *Policy) CheckPolicy(d dao.DAO, tx *transaction.Transaction) error {
|
||||
func (p *Policy) CheckPolicy(d *dao.Simple, tx *transaction.Transaction) error {
|
||||
for _, signer := range tx.Signers {
|
||||
if p.IsBlockedInternal(d, signer.Account) {
|
||||
return fmt.Errorf("account %s is blocked", signer.Account.StringLE())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue