Skip to content

Commit

Permalink
Fix failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
arijitAD committed Jul 8, 2021
1 parent 5b4a117 commit c11dd7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions dot/core/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,19 @@ func TestService_GetMetadata(t *testing.T) {

func TestService_HandleRuntimeChanges(t *testing.T) {
const (
currSpecVersion = uint32(260)
updatedSpecVersion = uint32(262)
updateNodeRuntimeWasmPath = "../../tests/polkadotjs_test/test/node_runtime.compact.wasm"
)
s := NewTestService(t, nil)

hash := s.blockState.BestBlockHash() // geneisHash
rt, err := s.blockState.GetRuntime(nil)
require.NoError(t, err)

v, err := rt.Version()
require.NoError(t, err)

currSpecVersion := v.SpecVersion() // genesis runtime version.
hash := s.blockState.BestBlockHash() // genesisHash

newBlock1 := &types.Block{
Header: &types.Header{
Expand All @@ -510,7 +516,7 @@ func TestService_HandleRuntimeChanges(t *testing.T) {
parentRt, err := s.blockState.GetRuntime(&hash)
require.NoError(t, err)

v, err := parentRt.Version()
v, err = parentRt.Version()
require.NoError(t, err)
require.Equal(t, v.SpecVersion(), currSpecVersion)

Expand All @@ -529,7 +535,7 @@ func TestService_HandleRuntimeChanges(t *testing.T) {
require.NoError(t, err)

// bhash1 runtime should not be updated
rt, err := s.blockState.GetRuntime(&bhash1)
rt, err = s.blockState.GetRuntime(&bhash1)
require.NoError(t, err)

v, err = rt.Version()
Expand Down
2 changes: 1 addition & 1 deletion lib/grandpa/message_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestMessageHandler_NeighbourMessage(t *testing.T) {
// check if request for justification was sent out
expected := &testJustificationRequest{
to: "",
num: 1,
num: 2,
}
require.Equal(t, expected, gs.network.(*testNetwork).justificationRequest)
}
Expand Down

0 comments on commit c11dd7c

Please sign in to comment.