-
Notifications
You must be signed in to change notification settings - Fork 47
/
interface.go
34 lines (30 loc) · 1.4 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2023 The AmazeChain Authors
// This file is part of the AmazeChain library.
//
// The AmazeChain library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The AmazeChain library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the AmazeChain library. If not, see <http://www.gnu.org/licenses/>.
package internal
import (
"github.com/amazechain/amc/common/block"
"github.com/amazechain/amc/modules/state"
)
// Validator is an interface which defines the standard for block validation. It
// is only responsible for validating block contents, as the header validation is
// done by the specific consensus engines.
type Validator interface {
// ValidateBody validates the given block's content.
ValidateBody(block block.IBlock) error
// ValidateState validates the given statedb and optionally the receipts and
// gas used.
ValidateState(block block.IBlock, state *state.IntraBlockState, receipts block.Receipts, usedGas uint64) error
}