mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 14:33:52 +00:00
dev: cleanup comments
This commit is contained in:
parent
868dc81c8a
commit
4be5477f64
4 changed files with 2 additions and 11 deletions
|
|
@ -1118,10 +1118,6 @@ func (c *Bor) CommitStates(
|
||||||
chain chainContext,
|
chain chainContext,
|
||||||
) error {
|
) error {
|
||||||
number := header.Number.Uint64()
|
number := header.Number.Uint64()
|
||||||
if number < c.config.Sprint {
|
|
||||||
return errors.New("Requested to commit states too soon")
|
|
||||||
}
|
|
||||||
|
|
||||||
lastSync, err := c.genesisContractsClient.LastStateSyncTime(number - 1)
|
lastSync, err := c.genesisContractsClient.LastStateSyncTime(number - 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ package bortest
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
// "encoding/json"
|
|
||||||
// "fmt"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
|
@ -165,7 +163,7 @@ func getMockedHeimdallClient(t *testing.T) (*mocks.IHeimdallClient, *bor.Heimdal
|
||||||
h := &mocks.IHeimdallClient{}
|
h := &mocks.IHeimdallClient{}
|
||||||
h.On("FetchWithRetry", "bor", "span", "1").Return(res, nil)
|
h.On("FetchWithRetry", "bor", "span", "1").Return(res, nil)
|
||||||
|
|
||||||
res = zeroResultPayload(t)
|
res = stateSyncEventsPayload(t)
|
||||||
// query := fmt.Sprintf("clerk/event-record/list?from-time=%d&to-time=%d&page=1&limit=50", 1, 1589709047)
|
// query := fmt.Sprintf("clerk/event-record/list?from-time=%d&to-time=%d&page=1&limit=50", 1, 1589709047)
|
||||||
h.On("FetchWithRetry", mock.AnythingOfType("string")).Return(res, nil)
|
h.On("FetchWithRetry", mock.AnythingOfType("string")).Return(res, nil)
|
||||||
return h, heimdallSpan
|
return h, heimdallSpan
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ func sign(t *testing.T, header *types.Header, signer []byte) {
|
||||||
copy(header.Extra[len(header.Extra)-extraSeal:], sig)
|
copy(header.Extra[len(header.Extra)-extraSeal:], sig)
|
||||||
}
|
}
|
||||||
|
|
||||||
func zeroResultPayload(t *testing.T) *bor.ResponseWithHeight {
|
func stateSyncEventsPayload(t *testing.T) *bor.ResponseWithHeight {
|
||||||
stateData, err := ioutil.ReadFile("states.json")
|
stateData, err := ioutil.ReadFile("states.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("%s", err)
|
t.Fatalf("%s", err)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
// "math/big"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -65,8 +64,6 @@ func (gc *GenesisContractsClient) CommitState(
|
||||||
method := "commitState"
|
method := "commitState"
|
||||||
t := event.Time.Unix()
|
t := event.Time.Unix()
|
||||||
data, err := gc.stateReceiverABI.Pack(method, recordBytes, big.NewInt(0).SetInt64(t))
|
data, err := gc.stateReceiverABI.Pack(method, recordBytes, big.NewInt(0).SetInt64(t))
|
||||||
// t, err := time.Parse(event.Time, time.RFC3339)
|
|
||||||
// data, err := gc.stateReceiverABI.Pack(method, recordBytes, t.Unix())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Unable to pack tx for commitState", "error", err)
|
log.Error("Unable to pack tx for commitState", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue