mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
* Milestone Implementation * Merge branch 'POS-347' into reciept-e2e-test * Changes for testing, will be removed after testing * Debugged the error * Just for testing purpose * refactor debug api methods, rename whitelist -> checkpoint * remove first iteration based vars * fix linters * Rewind Changes * Error changes * RewindBack function in bor_checkpoint_verifier * Testcases * Added the fetch test for milestone and checkpoint * Debugged the lint changes * Debugged the lint changes * Debugged the lint changes * Debugged the lint changes * Improved the error in Miner test file * Improved the error of pointing to the wrong function * Locking the sprint after the vote has been made on it. * Adding more logs for testing * Adding more logs for testing * Adding more logs for testing * Implemented the NoAckMilestone fetching mechanism * Testcases for milestone implementation * Testing code for fetchNoAckMilestone and fetchLastNoAckMilestone * Testing changes * refactor else-if * Corrected the number of params in bor_ext.go * Dummy API for testing * Defined the GetVoteOnRootHash in interface * Defined the GetVoteOnRootHash in interface * Made changes in the web3ext file * Added the GetVoteOnRootHash in PublicBlockChain API * Added the GetVoteOnRootHash in filterBackend * Added the log of Root and RooHash * Removed the 0x from rootHash * Just for testing purpose * "GetVoteOnRootHash" mock implementation * bor_test.go * Added the test for milestone implementation * Added service for fetching milestone by ID * Improved the comments * Removed the duplicate code * use setter for borVerifier * use setter for borVerifier * refactor handleNoAckMilestone * remove code repetition with retry function * Converged the repetitive code * after CR * persistence * persistence implementation * feature flag * Persistence Changes * cr * initial * fix * fix * Whitelist Flag * 1 Add:Included the milestone flag 2.Add:Hardlimit the rewind to maximum of 255 blocks * Chg:Updated go.mod file * Remove:Dubai Hardfork code * Add:checked errors for call functions to the Db, Rmv: Remote Header variable from the IsValidPeer() function * Fix:Linting issues' * Add:MilestoneGRPC functions * Fix:Lint issues * Fix:Lint issues * Fix: TestFetchMilestoneFromMockHeimdall * Fix:Integrations tests * Add:Test for sprint length and milestone changes * Add:Functionality to fetch the finalized block * Chg:Changed default val of TriesInmemory to 1024 * fix:Some functions of heimdallGRPC client * Restored the GRPC functionality, was commented out for developing purpose * Fix:Bor_checkpoint_Verfier function * Test:Added the chain Rewinding test * Test:Added the Sprint Length + Milestone merge test * Add:Implemented the future milestone * Add:Future milestone changes * Add:Future milestone changes * Chg: Voting on endBlockHash rather than rootHash * Chg: Changed the logic of future milestone from rootHash checking to endBlockHash checking * Fix:Using endBockHash while verifying the incoming milestone * Chg:Variable names for better readiblity * Fix:Testing changes * Add:metrics for milestone implementation * Add:Metrics for milestone implementatian * Fix:Order of statements in a function for better optimization * Chg:Removed unrequired file * Fix:new variable intialization * Add:Comment to increase readiblity * Fix:Logs * Chg:Name of GetVoteOnRootHash to GetVoteOnHash * Fix:Linting issues * Fixed linting issues * Rmv: Unnecessary logs and Add:Skip test for long tests * Fix:Checking current chain with whitelisted milestone or checkpoint in Finalized block function * Fix:Test * Fix:Whitelisting of Milestone and Checkpoint process * Fix: Milestone JSON structure * Chg:Testcases changes * Fix:Change from VoteOnRootHash to VoteOnHash * Fix:Variable name fix * Fix:Finalized API * internal/jsre/deps: update web3.js bundle * Fix:milestone verifier * Chg:Handling the long future chain import issue * Fix:Lint issues * Fix:TestLowDiffLongChain and TestPrunedImportSide tests, used hardcoded value 128 instead of DefaultTriesInMemory value * Chg:Testcode for producing metrics * Chg:Milestong polling value to 32 secs * Add:Testcases * Add:Implemented the check to fetch the milestoneId from heimdall before locking the fork * Added GRPC method for FetchMilestoneID * Fix:lint issue * Fix:lint issue * Skiped out the tests which were mainly used to produce the supporting data * remove vcs build when running snyk * Add:Improved the logs and comments * fix linters * Skipped some test as they are panic due to timeout issue in github * Chg:Variable name LockerSprintNumber to LockedMilestoneNumber for better readablity and clarity * Chg:Conflicting variable names in milestone test file * Chg:Conflicting function names in milestone test file * fix : minor fix in TestInsertingSpanSizeBlocks * Fix:Mocking issue in TestInsertingSpanSizeBlocks * Fix:GRPC Polyproto Version * eth/downloader: skip peer drop due to whitelisting err * eth, tests/bor: bug fixes and minor refactor * Add:Implemented the milestone related functions in the HeimdallApp * Fix:Lint Errors & Remove:Redundant Code * Fix:Testing Errors * Fix:Bor integeration tests * Fix:Test errors * update heimdall client mock files * remove unused arguments * remove redundant code * Chg:Changed the milestone polling intervals * Add: added block finality from whitelisted checkpoint * skip future chain validation * Add:confirmation check of 16 blocks over the end block while voting for the milestone in GetVoteHash() function * Chg:Included endBlockNum in UnlockMutex function * Add:Property based test for milestone * Fix:Opening the lock while processing future milestone * Add:Property based test for futureMilestone * Defined the value of TempTriesInMemory * Fixed the finalized api * Fixed lint issues * eth: add logs while fetching and rewinding * fix linters: use default returns instead of recursive calls * Fix:Milestone intergration test * Add:GetVoteHash fn in mock backend * tests/bor: fix mock span * tests/bor: remove t.Parallel() * use bor namespace in ethclient, fix mock function --------- Co-authored-by: Vaibhav Jindal <vaibhavjindal29@gmail.com> Co-authored-by: VaibhavJindal <74560896+VAIBHAVJINDAL3012@users.noreply.github.com> Co-authored-by: Manav Darji <manavdarji.india@gmail.com> Co-authored-by: Evgeny Danienko <6655321@bk.ru> Co-authored-by: Shivam Sharma <shivam691999@gmail.com> Co-authored-by: Anshal Shukla <shukla.anshal85@gmail.com>
414 lines
14 KiB
Go
414 lines
14 KiB
Go
// Copyright 2022 The go-ethereum Authors
|
|
// This file is part of the go-ethereum library.
|
|
//
|
|
// The go-ethereum 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 go-ethereum 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 go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package ethapi
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"math/big"
|
|
"reflect"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/ethereum/go-ethereum"
|
|
"github.com/ethereum/go-ethereum/accounts"
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
"github.com/ethereum/go-ethereum/consensus"
|
|
"github.com/ethereum/go-ethereum/core"
|
|
"github.com/ethereum/go-ethereum/core/bloombits"
|
|
"github.com/ethereum/go-ethereum/core/state"
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
"github.com/ethereum/go-ethereum/core/vm"
|
|
"github.com/ethereum/go-ethereum/ethdb"
|
|
"github.com/ethereum/go-ethereum/event"
|
|
"github.com/ethereum/go-ethereum/params"
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
)
|
|
|
|
// TestSetFeeDefaults tests the logic for filling in default fee values works as expected.
|
|
func TestSetFeeDefaults(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
type test struct {
|
|
name string
|
|
isLondon bool
|
|
in *TransactionArgs
|
|
want *TransactionArgs
|
|
err error
|
|
}
|
|
|
|
var (
|
|
b = newBackendMock()
|
|
fortytwo = (*hexutil.Big)(big.NewInt(42))
|
|
maxFee = (*hexutil.Big)(new(big.Int).Add(new(big.Int).Mul(b.current.BaseFee, big.NewInt(2)), fortytwo.ToInt()))
|
|
al = &types.AccessList{types.AccessTuple{Address: common.Address{0xaa}, StorageKeys: []common.Hash{{0x01}}}}
|
|
)
|
|
|
|
tests := []test{
|
|
// Legacy txs
|
|
{
|
|
"legacy tx pre-London",
|
|
false,
|
|
&TransactionArgs{},
|
|
&TransactionArgs{GasPrice: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"legacy tx post-London, explicit gas price",
|
|
true,
|
|
&TransactionArgs{GasPrice: fortytwo},
|
|
&TransactionArgs{GasPrice: fortytwo},
|
|
nil,
|
|
},
|
|
|
|
// Access list txs
|
|
{
|
|
"access list tx pre-London",
|
|
false,
|
|
&TransactionArgs{AccessList: al},
|
|
&TransactionArgs{AccessList: al, GasPrice: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"access list tx post-London, explicit gas price",
|
|
false,
|
|
&TransactionArgs{AccessList: al, GasPrice: fortytwo},
|
|
&TransactionArgs{AccessList: al, GasPrice: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"access list tx post-London",
|
|
true,
|
|
&TransactionArgs{AccessList: al},
|
|
&TransactionArgs{AccessList: al, MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"access list tx post-London, only max fee",
|
|
true,
|
|
&TransactionArgs{AccessList: al, MaxFeePerGas: maxFee},
|
|
&TransactionArgs{AccessList: al, MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"access list tx post-London, only priority fee",
|
|
true,
|
|
&TransactionArgs{AccessList: al, MaxFeePerGas: maxFee},
|
|
&TransactionArgs{AccessList: al, MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
},
|
|
|
|
// Dynamic fee txs
|
|
{
|
|
"dynamic tx post-London",
|
|
true,
|
|
&TransactionArgs{},
|
|
&TransactionArgs{MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"dynamic tx post-London, only max fee",
|
|
true,
|
|
&TransactionArgs{MaxFeePerGas: maxFee},
|
|
&TransactionArgs{MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"dynamic tx post-London, only priority fee",
|
|
true,
|
|
&TransactionArgs{MaxFeePerGas: maxFee},
|
|
&TransactionArgs{MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
},
|
|
{
|
|
"dynamic fee tx pre-London, maxFee set",
|
|
false,
|
|
&TransactionArgs{MaxFeePerGas: maxFee},
|
|
nil,
|
|
fmt.Errorf("maxFeePerGas and maxPriorityFeePerGas are not valid before London is active"),
|
|
},
|
|
{
|
|
"dynamic fee tx pre-London, priorityFee set",
|
|
false,
|
|
&TransactionArgs{MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
fmt.Errorf("maxFeePerGas and maxPriorityFeePerGas are not valid before London is active"),
|
|
},
|
|
{
|
|
"dynamic fee tx, maxFee < priorityFee",
|
|
true,
|
|
&TransactionArgs{MaxFeePerGas: maxFee, MaxPriorityFeePerGas: (*hexutil.Big)(big.NewInt(1000))},
|
|
nil,
|
|
fmt.Errorf("maxFeePerGas (0x3e) < maxPriorityFeePerGas (0x3e8)"),
|
|
},
|
|
{
|
|
"dynamic fee tx, maxFee < priorityFee while setting default",
|
|
true,
|
|
&TransactionArgs{MaxFeePerGas: (*hexutil.Big)(big.NewInt(7))},
|
|
nil,
|
|
fmt.Errorf("maxFeePerGas (0x7) < maxPriorityFeePerGas (0x2a)"),
|
|
},
|
|
|
|
// Misc
|
|
{
|
|
"set all fee parameters",
|
|
false,
|
|
&TransactionArgs{GasPrice: fortytwo, MaxFeePerGas: maxFee, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
fmt.Errorf("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified"),
|
|
},
|
|
{
|
|
"set gas price and maxPriorityFee",
|
|
false,
|
|
&TransactionArgs{GasPrice: fortytwo, MaxPriorityFeePerGas: fortytwo},
|
|
nil,
|
|
fmt.Errorf("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified"),
|
|
},
|
|
{
|
|
"set gas price and maxFee",
|
|
true,
|
|
&TransactionArgs{GasPrice: fortytwo, MaxFeePerGas: maxFee},
|
|
nil,
|
|
fmt.Errorf("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified"),
|
|
},
|
|
}
|
|
|
|
ctx := context.Background()
|
|
|
|
for i, test := range tests {
|
|
if test.isLondon {
|
|
b.activateLondon()
|
|
} else {
|
|
b.deactivateLondon()
|
|
}
|
|
|
|
got := test.in
|
|
|
|
err := got.setFeeDefaults(ctx, b)
|
|
if err != nil && err.Error() == test.err.Error() {
|
|
// Test threw expected error.
|
|
continue
|
|
} else if err != nil {
|
|
t.Fatalf("test %d (%s): unexpected error: %s", i, test.name, err)
|
|
}
|
|
|
|
if !reflect.DeepEqual(got, test.want) {
|
|
t.Fatalf("test %d (%s): did not fill defaults as expected: (got: %v, want: %v)", i, test.name, got, test.want)
|
|
}
|
|
}
|
|
}
|
|
|
|
type backendMock struct {
|
|
current *types.Header
|
|
config *params.ChainConfig
|
|
}
|
|
|
|
func newBackendMock() *backendMock {
|
|
config := ¶ms.ChainConfig{
|
|
ChainID: big.NewInt(42),
|
|
HomesteadBlock: big.NewInt(0),
|
|
DAOForkBlock: nil,
|
|
DAOForkSupport: true,
|
|
EIP150Block: big.NewInt(0),
|
|
EIP155Block: big.NewInt(0),
|
|
EIP158Block: big.NewInt(0),
|
|
ByzantiumBlock: big.NewInt(0),
|
|
ConstantinopleBlock: big.NewInt(0),
|
|
PetersburgBlock: big.NewInt(0),
|
|
IstanbulBlock: big.NewInt(0),
|
|
MuirGlacierBlock: big.NewInt(0),
|
|
BerlinBlock: big.NewInt(0),
|
|
LondonBlock: big.NewInt(1000),
|
|
}
|
|
|
|
return &backendMock{
|
|
current: &types.Header{
|
|
Difficulty: big.NewInt(10000000000),
|
|
Number: big.NewInt(1100),
|
|
GasLimit: 8_000_000,
|
|
GasUsed: 8_000_000,
|
|
Time: 555,
|
|
Extra: make([]byte, 32),
|
|
BaseFee: big.NewInt(10),
|
|
},
|
|
config: config,
|
|
}
|
|
}
|
|
|
|
func (b *backendMock) activateLondon() {
|
|
b.current.Number = big.NewInt(1100)
|
|
}
|
|
|
|
func (b *backendMock) deactivateLondon() {
|
|
b.current.Number = big.NewInt(900)
|
|
}
|
|
func (b *backendMock) SuggestGasTipCap(ctx context.Context) (*big.Int, error) {
|
|
return big.NewInt(42), nil
|
|
}
|
|
func (b *backendMock) CurrentHeader() *types.Header { return b.current }
|
|
func (b *backendMock) ChainConfig() *params.ChainConfig { return b.config }
|
|
|
|
// Other methods needed to implement Backend interface.
|
|
func (b *backendMock) SyncProgress() ethereum.SyncProgress { return ethereum.SyncProgress{} }
|
|
func (b *backendMock) FeeHistory(ctx context.Context, blockCount uint64, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*big.Int, [][]*big.Int, []*big.Int, []float64, error) {
|
|
return nil, nil, nil, nil, nil
|
|
}
|
|
func (b *backendMock) ChainDb() ethdb.Database { return nil }
|
|
func (b *backendMock) AccountManager() *accounts.Manager { return nil }
|
|
func (b *backendMock) ExtRPCEnabled() bool { return false }
|
|
func (b *backendMock) RPCGasCap() uint64 { return 0 }
|
|
func (b *backendMock) RPCEVMTimeout() time.Duration { return time.Second }
|
|
func (b *backendMock) RPCTxFeeCap() float64 { return 0 }
|
|
func (b *backendMock) UnprotectedAllowed() bool { return false }
|
|
func (b *backendMock) SetHead(number uint64) {}
|
|
func (b *backendMock) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) CurrentBlock() *types.Header { return nil }
|
|
func (b *backendMock) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
|
|
return nil, nil, nil
|
|
}
|
|
func (b *backendMock) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error) {
|
|
return nil, nil, nil
|
|
}
|
|
func (b *backendMock) PendingBlockAndReceipts() (*types.Block, types.Receipts) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) GetLogs(ctx context.Context, blockHash common.Hash, number uint64) ([][]*types.Log, error) {
|
|
//nolint:nilnil
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) GetTd(ctx context.Context, hash common.Hash) *big.Int { return nil }
|
|
func (b *backendMock) GetEVM(ctx context.Context, msg *core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error) {
|
|
return nil, nil, nil
|
|
}
|
|
func (b *backendMock) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription { return nil }
|
|
func (b *backendMock) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription {
|
|
return nil
|
|
}
|
|
func (b *backendMock) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription {
|
|
return nil
|
|
}
|
|
func (b *backendMock) SendTx(ctx context.Context, signedTx *types.Transaction) error { return nil }
|
|
func (b *backendMock) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
|
|
return nil, [32]byte{}, 0, 0, nil
|
|
}
|
|
func (b *backendMock) GetPoolTransactions() (types.Transactions, error) { return nil, nil }
|
|
func (b *backendMock) GetPoolTransaction(txHash common.Hash) *types.Transaction { return nil }
|
|
func (b *backendMock) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
|
|
return 0, nil
|
|
}
|
|
func (b *backendMock) Stats() (pending int, queued int) { return 0, 0 }
|
|
func (b *backendMock) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) {
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) TxPoolContentFrom(addr common.Address) (types.Transactions, types.Transactions) {
|
|
return nil, nil
|
|
}
|
|
func (b *backendMock) SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription { return nil }
|
|
func (b *backendMock) BloomStatus() (uint64, uint64) { return 0, 0 }
|
|
func (b *backendMock) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) {}
|
|
func (b *backendMock) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription { return nil }
|
|
func (b *backendMock) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription {
|
|
return nil
|
|
}
|
|
func (b *backendMock) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
|
|
return nil
|
|
}
|
|
|
|
func (b *backendMock) Engine() consensus.Engine { return nil }
|
|
|
|
func (b *backendMock) RPCRpcReturnDataLimit() uint64 {
|
|
return 0
|
|
}
|
|
|
|
func (b *backendMock) SubscribeStateSyncEvent(ch chan<- core.StateSyncEvent) event.Subscription {
|
|
return nil
|
|
}
|
|
|
|
func (b *backendMock) GetRootHash(ctx context.Context, starBlockNr uint64, endBlockNr uint64) (string, error) {
|
|
return "", nil
|
|
}
|
|
|
|
func (b *backendMock) GetVoteOnHash(ctx context.Context, starBlockNr uint64, endBlockNr uint64, hash string, milestoneId string) (bool, error) {
|
|
return false, nil
|
|
}
|
|
|
|
func (b *backendMock) GetBorBlockReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error) {
|
|
//nolint: nilnil
|
|
return nil, nil
|
|
}
|
|
|
|
func (b *backendMock) GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error) {
|
|
// nolint: nilnil
|
|
return nil, nil
|
|
}
|
|
|
|
func (b *backendMock) GetBorBlockTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
|
|
return nil, common.Hash{}, 0, 0, nil
|
|
}
|
|
|
|
func (b *backendMock) GetBorBlockTransactionWithBlockHash(ctx context.Context, txHash common.Hash, blockHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
|
|
return nil, common.Hash{}, 0, 0, nil
|
|
}
|
|
|
|
func (b *backendMock) SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription {
|
|
return nil
|
|
}
|
|
|
|
func (b *backendMock) GetWhitelistedCheckpoint() (bool, uint64, common.Hash) {
|
|
return false, 0, common.Hash{}
|
|
}
|
|
|
|
func (b *backendMock) GetWhitelistedMilestone() (bool, uint64, common.Hash) {
|
|
return false, 0, common.Hash{}
|
|
}
|
|
|
|
func (b *backendMock) PurgeWhitelistedCheckpoint() {}
|
|
|
|
func (b *backendMock) PurgeWhitelistedMilestone() {}
|