Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions dot/core/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import (
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/runtime"
"github.com/ChainSafe/gossamer/lib/runtime/extrinsic"
runtimemocks "github.com/ChainSafe/gossamer/lib/runtime/mocks"
"github.com/ChainSafe/gossamer/lib/runtime/storage"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
"github.com/ChainSafe/gossamer/lib/transaction"
"github.com/ChainSafe/gossamer/lib/trie"
"github.com/ChainSafe/gossamer/pkg/scale"
log "github.com/ChainSafe/log15"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -287,9 +287,10 @@ func TestHandleChainReorg_WithReorg_Transactions(t *testing.T) {
addTestBlocksToState(t, height, s.blockState.(*state.BlockState))

// create extrinsic
ext := extrinsic.NewIncludeDataExt([]byte("nootwashere"))
tx, err := ext.Encode()
enc, err := scale.Marshal([]byte("nootwashere"))
require.NoError(t, err)
// we prefix with []byte{2} here since that's the enum index for the old IncludeDataExt extrinsic
tx := append([]byte{2}, enc...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I right in saying that the 2 is appended because its a IncludeDataType extrinsic? If so, since we are deleting that file, will we be able to know what the leading byte represents/what values it can have in the future? I was initially confused at what this 2 was and I'm not sure how I would figure that out with the extrinsic file gone. Maybe this isn't a huge concern but I wanted to ask

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah would be good to document this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add documentation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other possible prefixes that should be documented besides the 2 case? Or can those be found elsewhere if need be?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they were in the old code that I had removed.


bhash := s.blockState.BestBlockHash()
rt, err := s.blockState.GetRuntime(&bhash)
Expand Down
4 changes: 2 additions & 2 deletions dot/rpc/modules/api_mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func NewMockCoreAPI() *modulesmocks.MockCoreAPI {
}

// NewMockVersion creates and returns an runtime Version interface mock
func NewMockVersion() *runtimemocks.MockVersion {
m := new(runtimemocks.MockVersion)
func NewMockVersion() *runtimemocks.Version {
m := new(runtimemocks.Version)
m.On("SpecName").Return([]byte(`mock-spec`))
m.On("ImplName").Return(nil)
m.On("AuthoringVersion").Return(uint32(0))
Expand Down
2 changes: 1 addition & 1 deletion dot/rpc/modules/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func (*StateModule) SubscribeStorage(_ *http.Request, _ *StateStorageQueryRangeR
}

// ConvertAPIs runtime.APIItems to []interface
func ConvertAPIs(in []*runtime.APIItem) []interface{} {
func ConvertAPIs(in []runtime.APIItem) []interface{} {
ret := make([]interface{}, 0)
for _, item := range in {
encStr := hex.EncodeToString(item.Name[:])
Expand Down
4 changes: 2 additions & 2 deletions dot/state/block_notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ func TestService_RegisterUnRegisterConcurrentCalls(t *testing.T) {
}

// NewMockVersion creates and returns an runtime Version interface mock
func NewMockVersion(specVer uint32) *runtimemocks.MockVersion {
m := new(runtimemocks.MockVersion)
func NewMockVersion(specVer uint32) *runtimemocks.Version {
m := new(runtimemocks.Version)
m.On("SpecName").Return([]byte(`mock-spec`))
m.On("ImplName").Return(nil)
m.On("AuthoringVersion").Return(uint32(0))
Expand Down
Loading