native: pass DAO to CheckPolicy(), it doesn't need interop context

Simplify things a bit.
This commit is contained in:
Roman Khimov 2020-08-06 21:39:00 +03:00
parent 791c983304
commit 90180c6fb6
2 changed files with 3 additions and 3 deletions

View file

@ -1369,7 +1369,7 @@ func (bc *Blockchain) PoolTx(t *transaction.Transaction) error {
return err
}
// Policying.
if err := bc.contracts.Policy.CheckPolicy(bc.newInteropContext(trigger.Application, bc.dao, nil, t), t); err != nil {
if err := bc.contracts.Policy.CheckPolicy(bc.dao, t); err != nil {
// Only one %w can be used.
return fmt.Errorf("%w: %v", ErrPolicy, err)
}

View file

@ -511,8 +511,8 @@ func (p *Policy) checkValidators(ic *interop.Context) (bool, error) {
// CheckPolicy checks whether transaction's script hashes for verifying are
// included into blocked accounts list.
func (p *Policy) CheckPolicy(ic *interop.Context, tx *transaction.Transaction) error {
ba, err := p.GetBlockedAccountsInternal(ic.DAO)
func (p *Policy) CheckPolicy(d dao.DAO, tx *transaction.Transaction) error {
ba, err := p.GetBlockedAccountsInternal(d)
if err != nil {
return fmt.Errorf("unable to get blocked accounts list: %w", err)
}