2018-07-18 20:59:40 +00:00
|
|
|
package fakes
|
|
|
|
|
2018-10-11 20:25:14 +00:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
2018-11-12 20:59:16 +00:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2018-10-11 20:25:14 +00:00
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
|
|
"github.com/vulcanize/vulcanizedb/pkg/core"
|
|
|
|
)
|
2018-07-18 20:59:40 +00:00
|
|
|
|
2018-11-12 20:59:16 +00:00
|
|
|
var (
|
|
|
|
FakeError = errors.New("failed")
|
|
|
|
FakeHash = common.BytesToHash([]byte{1, 2, 3, 4, 5})
|
|
|
|
)
|
2018-10-11 20:25:14 +00:00
|
|
|
|
|
|
|
var rawFakeHeader, _ = json.Marshal(types.Header{})
|
|
|
|
var FakeHeader = core.Header{
|
2018-11-12 20:59:16 +00:00
|
|
|
Hash: FakeHash.String(),
|
2018-10-11 20:25:14 +00:00
|
|
|
Raw: rawFakeHeader,
|
|
|
|
Timestamp: "111111111",
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetFakeHeader(blockNumber int64) core.Header {
|
|
|
|
return core.Header{
|
2018-11-12 20:59:16 +00:00
|
|
|
Hash: FakeHash.String(),
|
2018-10-11 20:25:14 +00:00
|
|
|
BlockNumber: blockNumber,
|
|
|
|
Raw: rawFakeHeader,
|
|
|
|
Timestamp: "111111111",
|
|
|
|
}
|
|
|
|
}
|