github.com/annchain/OG@v0.0.9/consensus/annsensus_test/archive/dummy_test.go (about)

     1  // Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  package archive_test
    15  
    16  //type DummyDag struct {
    17  //}
    18  //
    19  //func (d *DummyDag) GetTx(hash common.Hash) types.Txi {
    20  //	return nil
    21  //}
    22  //
    23  //func (d *DummyDag) GetTxByNonce(addr common.Address, nonce uint64) types.Txi {
    24  //	return nil
    25  //}
    26  //
    27  //func (d *DummyDag) GetLatestNonce(addr common.Address) (uint64, error) {
    28  //	return 0, nil
    29  //}
    30  //
    31  //func (d *DummyDag) GetSequencerByHeight(id uint64) *types.Sequencer {
    32  //	return &types.Sequencer{
    33  //		TxBase: types.TxBase{Height: id},
    34  //	}
    35  //}
    36  //
    37  //func (d *DummyDag) GetTxisByHeight(id uint64) types.Txis {
    38  //	var txis types.Txis
    39  //	txis = append(txis, archive.RandomTx(), archive.RandomTx())
    40  //	return txis
    41  //}
    42  //
    43  //func (d *DummyDag) LatestSequencer() *types.Sequencer {
    44  //	return types.RandomSequencer()
    45  //}
    46  //
    47  //func (d *DummyDag) GetSequencer(hash common.Hash, id uint64) *types.Sequencer {
    48  //	return &types.Sequencer{
    49  //		TxBase: types.TxBase{Height: id,
    50  //			Hash: hash},
    51  //	}
    52  //}
    53  //
    54  //func (d *DummyDag) Genesis() *types.Sequencer {
    55  //	return &types.Sequencer{
    56  //		TxBase: types.TxBase{Height: 0},
    57  //	}
    58  //}
    59  //
    60  //func (d *DummyDag) GetHeight() uint64 {
    61  //	return 0
    62  //}
    63  //
    64  //func (d *DummyDag) GetSequencerByHash(hash common.Hash) *types.Sequencer {
    65  //	return nil
    66  //}
    67  //
    68  //func (d *DummyDag) GetBalance(addr common.Address, tokenId int32) *math.BigInt {
    69  //	return math.NewBigInt(100000)
    70  //}