Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/limit-finalized-headers-gap' int…
Browse files Browse the repository at this point in the history
…o limit-finalized-headers-gap
  • Loading branch information
claravanstaden authored and claravanstaden committed Mar 21, 2024
2 parents c428bff + 9397587 commit 9669aab
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
3 changes: 1 addition & 2 deletions relayer/chain/ethereum/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ func TestMessage_Proof(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, msg)

assert.Equal(t, block.Hash().Hex(), msg.Proof.BlockHash.Hex())
key, err := rlp.EncodeToBytes(uint(msg.Proof.TxIndex))
key, err := rlp.EncodeToBytes(uint(5))
if err != nil {
panic(err)
}
Expand Down
1 change: 0 additions & 1 deletion relayer/chain/parachain/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type ChainWriter interface {
GetLastBasicChannelBlockNumber() (uint64, error)
GetLastBasicChannelNonceByAddress(address common.Address) (uint64, error)
GetFinalizedHeaderStateByBlockRoot(blockRoot types.H256) (state.FinalizedHeader, error)
GetCompactExecutionHeaderStateByBlockHash(blockHash types.H256) (state.CompactExecutionHeaderState, error)
GetLastFinalizedStateIndex() (types.U32, error)
GetFinalizedBeaconRootByIndex(index uint32) (types.H256, error)
}
Expand Down
9 changes: 8 additions & 1 deletion relayer/cmd/generate_beacon_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"strconv"
"time"

"github.com/snowfork/snowbridge/relayer/relays/beacon/store"

"github.com/snowfork/snowbridge/relayer/chain/ethereum"
"github.com/snowfork/snowbridge/relayer/chain/parachain"
"github.com/snowfork/snowbridge/relayer/cmd/run/execution"
Expand Down Expand Up @@ -667,8 +669,13 @@ func generateInboundFixture(cmd *cobra.Command, _ []string) error {
return err
}

store := store.New(conf.Source.Beacon.DataStore.Location, conf.Source.Beacon.DataStore.MaxEntries)
store.Connect()
defer store.Close()

log.WithFields(log.Fields{"endpoint": endpoint}).Info("connecting to beacon API")
s := syncer.New(endpoint, conf.Source.Beacon.Spec)
client := api.NewBeaconClient(endpoint, conf.Source.Beacon.Spec.SlotsInEpoch)
s := syncer.New(client, conf.Source.Beacon.Spec, &store)

viper.SetConfigFile("/tmp/snowbridge/execution-relay-asset-hub.json")

Expand Down
2 changes: 1 addition & 1 deletion relayer/relays/beacon/state/beacon_deneb_encoding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion relayer/relays/beacon/state/beacon_encoding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions relayer/relays/testutil/mock_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package testutil
import (
"context"
"fmt"

"github.com/snowfork/go-substrate-rpc-client/v4/types"
"github.com/snowfork/snowbridge/relayer/relays/beacon/header/syncer/scale"
"github.com/snowfork/snowbridge/relayer/relays/beacon/state"
Expand All @@ -14,10 +15,6 @@ type MockWriter struct {
LastFinalizedState state.FinalizedHeader
}

func (m *MockWriter) GetCompactExecutionHeaderStateByBlockHash(blockHash types.H256) (state.CompactExecutionHeaderState, error) {
return state.CompactExecutionHeaderState{}, nil
}

func (m *MockWriter) GetLastFinalizedStateIndex() (types.U32, error) {
return 0, nil
}
Expand Down

0 comments on commit 9669aab

Please sign in to comment.