diff --git a/dot/core/helpers_test.go b/dot/core/helpers_test.go index 6005d3a57d..e3f5a90aed 100644 --- a/dot/core/helpers_test.go +++ b/dot/core/helpers_test.go @@ -22,6 +22,7 @@ import ( "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" + "github.com/centrifuge/go-substrate-rpc-client/v4/signature" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) @@ -116,7 +117,7 @@ func createTestService(t *testing.T, genesisFilePath string, // Hash of encrypted centrifuge extrinsic testCallArguments := []byte{0xab, 0xcd} extHex := runtime.NewTestExtrinsic(t, cfgRuntime, genesisHeader.Hash(), cfgBlockState.BestBlockHash(), - 0, "System.remark", testCallArguments) + 0, signature.TestKeyringPairAlice, "System.remark", testCallArguments) encodedExtrinsic = common.MustHexToBytes(extHex) cfgCodeSubstitutes := make(map[common.Hash]string) diff --git a/dot/core/service.go b/dot/core/service.go index 4e198995ff..660ee482b0 100644 --- a/dot/core/service.go +++ b/dot/core/service.go @@ -472,14 +472,14 @@ func (s *Service) HasKey(pubKeyStr, keystoreType string) (bool, error) { } // DecodeSessionKeys executes the runtime DecodeSessionKeys and return the scale encoded keys -func (s *Service) DecodeSessionKeys(enc []byte) ([]byte, error) { +func (s *Service) DecodeSessionKeys(encodedSessionKeys []byte) ([]byte, error) { bestBlockHash := s.blockState.BestBlockHash() rt, err := s.blockState.GetRuntime(bestBlockHash) if err != nil { return nil, err } - return rt.DecodeSessionKeys(enc) + return rt.DecodeSessionKeys(encodedSessionKeys) } // GetRuntimeVersion gets the current RuntimeVersion diff --git a/dot/rpc/modules/author.go b/dot/rpc/modules/author.go index 5655e9ae45..63adbafc75 100644 --- a/dot/rpc/modules/author.go +++ b/dot/rpc/modules/author.go @@ -108,12 +108,12 @@ func (am *AuthorModule) HasSessionKeys(r *http.Request, req *HasSessionKeyReques return err } - pkeys, err := scale.Marshal(pubKeysBytes) + encodedKeys, err := scale.Marshal(pubKeysBytes) if err != nil { return err } - data, err := am.coreAPI.DecodeSessionKeys(pkeys) + data, err := am.coreAPI.DecodeSessionKeys(encodedKeys) if err != nil { *res = false return err @@ -133,7 +133,6 @@ func (am *AuthorModule) HasSessionKeys(r *http.Request, req *HasSessionKeyReques for _, key := range *decodedKeys { encType := keystore.Name(key.Type[:]) ok, err := am.coreAPI.HasKey(common.BytesToHex(key.Data), string(encType)) - if err != nil || !ok { *res = false return err diff --git a/dot/rpc/modules/author_integration_test.go b/dot/rpc/modules/author_integration_test.go index 1ff287eaf8..a5e9ab5163 100644 --- a/dot/rpc/modules/author_integration_test.go +++ b/dot/rpc/modules/author_integration_test.go @@ -174,7 +174,8 @@ func TestAuthorModule_SubmitExtrinsic_Integration(t *testing.T) { // creating an extrisinc to the System.remark call using a sample argument extHex := runtime.NewTestExtrinsic(t, - integrationTestController.runtime, genesisHash, genesisHash, 0, "System.remark", []byte{0xab, 0xcd}) + integrationTestController.runtime, genesisHash, genesisHash, 0, + signature.TestKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) extBytes := common.MustHexToBytes(extHex) @@ -193,12 +194,12 @@ func TestAuthorModule_SubmitExtrinsic_Integration(t *testing.T) { expected := &transaction.ValidTransaction{ Extrinsic: expectedExtrinsic, Validity: &transaction.Validity{ - Priority: 39325240425794630, + Priority: 36074, Requires: nil, Provides: [][]byte{ common.MustHexToBytes("0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d00000000"), }, - Longevity: 18446744073709551614, + Longevity: 18446744073709551613, Propagate: true, }, } @@ -212,15 +213,25 @@ func TestAuthorModule_SubmitExtrinsic_Integration(t *testing.T) { require.Equal(t, expectedHash, *res) } -func TestAuthorModule_SubmitExtrinsic_invalid(t *testing.T) { +func TestAuthorModule_SubmitExtrinsic_bad_proof(t *testing.T) { t.Parallel() + testInvalidKeyringPairAlice := signature.KeyringPair{ + URI: "//Alice", + PublicKey: []byte{0xd5, 0x36, 0x13, 0xc7, 0x15, 0xfd, 0xd3, + 0x1c, 0x61, 0x14, 0x1a, 0xb4, 0x4, 0xa9, 0x9f, 0xd6, 0x82, + 0x2c, 0x85, 0x58, 0x85, 0x2c, 0xcd, 0xe3, 0x9a, 0x56, 0x84, + 0xe7, 0xa5, 0x6d, 0x12, 0x7d}, + Address: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + } + integrationTestController := setupStateAndRuntime(t, t.TempDir(), useInstanceFromGenesis) genesisHash := integrationTestController.genesisHeader.Hash() // creating an extrisinc to the System.remark call using a sample argument extHex := runtime.NewTestExtrinsic(t, - integrationTestController.runtime, genesisHash, genesisHash, 0, "System.remark", []byte{}) + integrationTestController.runtime, genesisHash, genesisHash, 0, + testInvalidKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) ctrl := gomock.NewController(t) net2test := NewMockNetwork(ctrl) @@ -233,7 +244,7 @@ func TestAuthorModule_SubmitExtrinsic_invalid(t *testing.T) { res := new(ExtrinsicHashResponse) err := auth.SubmitExtrinsic(nil, &Extrinsic{extHex}, res) - require.EqualError(t, err, "ancient birth block") + require.EqualError(t, err, "bad proof") txOnPool := integrationTestController.stateSrv.Transaction.PendingInPool() require.Len(t, txOnPool, 0) @@ -269,7 +280,8 @@ func TestAuthorModule_SubmitExtrinsic_AlreadyInPool(t *testing.T) { // creating an extrisinc to the System.remark call using a sample argument extHex := runtime.NewTestExtrinsic(t, - integrationTestController.runtime, genesisHash, genesisHash, 0, "System.remark", []byte{}) + integrationTestController.runtime, genesisHash, genesisHash, 0, + signature.TestKeyringPairAlice, "System.remark", []byte{}) extBytes := common.MustHexToBytes(extHex) integrationTestController.network = NewMockNetwork(nil) @@ -456,8 +468,8 @@ func TestAuthorModule_HasKey_Integration(t *testing.T) { func TestAuthorModule_HasSessionKeys_Integration(t *testing.T) { t.Parallel() - const granSeed = "0xf25586ceb64a043d887631fa08c2ed790ef7ae3c7f28de5172005f8b9469e529" - const granPubK = "0x6b802349d948444d41397da09ec597fbd8ae8fdd3dfa153b2bb2bddcf020457c" + const granSeed = "0xabf8e5bdbe30c65656c0a3cbd181ff8a56294a69dfedd27982aace4a76909115" + const granPubK = "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee" const sr25519Seed = "0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a" const sr25519Pubk = "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" @@ -472,7 +484,7 @@ func TestAuthorModule_HasSessionKeys_Integration(t *testing.T) { pubk: granPubK, }, { - ktype: []string{"babe", "imon", "audi"}, + ktype: []string{"babe", "imon", "para", "asgn", "audi"}, seed: sr25519Seed, pubk: sr25519Pubk, }, @@ -484,9 +496,11 @@ func TestAuthorModule_HasSessionKeys_Integration(t *testing.T) { waitErr error }{ "public keys are in the right order, should return true": { - pubSessionKeys: "0x6b802349d948444d41397da09ec597fbd8ae8fdd3dfa153b2bb2bddcf020457c" + // gran + pubSessionKeys: "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee" + // gran "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // babe "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // imon + "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // para + "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // asgn "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", // audi expect: true, }, @@ -494,14 +508,18 @@ func TestAuthorModule_HasSessionKeys_Integration(t *testing.T) { pubSessionKeys: "0x740550da19ef14023ea3e903545a6700160a55be2e4b733b577c91b053e38b8d" + // gran "de6fa0da51c52cc117d77aeb329595b15070db444e7ed4c4adec714b291c1845" + // babe "de6fa0da51c52cc117d77aeb329595b15070db444e7ed4c4adec714b291c1845" + // imon + "de6fa0da51c52cc117d77aeb329595b15070db444e7ed4c4adec714b291c1845" + // para + "de6fa0da51c52cc117d77aeb329595b15070db444e7ed4c4adec714b291c1845" + // asgn "de6fa0da51c52cc117d77aeb329595b15070db444e7ed4c4adec714b291c1845", // audi expect: false, }, "public keys are not in the right order, should return false": { - pubSessionKeys: "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // gran - "6b802349d948444d41397da09ec597fbd8ae8fdd3dfa153b2bb2bddcf020457c" + // babe + pubSessionKeys: "0x6b802349d948444d41397da09ec597fbd8ae8fdd3dfa153b2bb2bddcf020457c" + // babe + "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // gran "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // imon - "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", // audi + "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // audi + "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" + // para + "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", // asgn expect: false, }, "incomplete keys": { @@ -630,7 +648,7 @@ type integrationTestController struct { func setupStateAndRuntime(t *testing.T, basepath string, useInstance useRuntimeInstance) *integrationTestController { t.Helper() - gen, genesisTrie, genesisHeader := newTestGenesisWithTrieAndHeader(t) + gen, genesisTrie, genesisHeader := newWestendLocalGenesisWithTrieAndHeader(t) ctrl := gomock.NewController(t) telemetryMock := NewMockTelemetry(ctrl) @@ -690,7 +708,7 @@ func setupStateAndPopulateTrieState(t *testing.T, basepath string, useInstance useRuntimeInstance) *integrationTestController { t.Helper() - gen, genesisTrie, genesisHeader := newTestGenesisWithTrieAndHeader(t) + gen, genesisTrie, genesisHeader := newWestendLocalGenesisWithTrieAndHeader(t) ctrl := gomock.NewController(t) telemetryMock := NewMockTelemetry(ctrl) diff --git a/dot/rpc/modules/chain_integration_test.go b/dot/rpc/modules/chain_integration_test.go index e3ba6f2031..cf162fa120 100644 --- a/dot/rpc/modules/chain_integration_test.go +++ b/dot/rpc/modules/chain_integration_test.go @@ -288,7 +288,7 @@ func TestChainGetBlockHash_Array(t *testing.T) { func TestChainGetFinalizedHead(t *testing.T) { state := newTestStateService(t) svc := NewChainModule(state.Block) - _, _, genesisHeader := newTestGenesisWithTrieAndHeader(t) + _, _, genesisHeader := newWestendLocalGenesisWithTrieAndHeader(t) var res ChainHashResponse err := svc.GetFinalizedHead(nil, &EmptyRequest{}, &res) require.NoError(t, err) @@ -306,7 +306,7 @@ func TestChainGetFinalizedHeadByRound(t *testing.T) { err := svc.GetFinalizedHeadByRound(nil, &req, &res) require.NoError(t, err) - _, _, genesisHeader := newTestGenesisWithTrieAndHeader(t) + _, _, genesisHeader := newWestendLocalGenesisWithTrieAndHeader(t) expected := genesisHeader.Hash() require.Equal(t, common.BytesToHex(expected[:]), res) @@ -351,7 +351,7 @@ func newTestStateService(t *testing.T) *state.Service { stateSrvc := state.NewService(config) stateSrvc.UseMemDB() - gen, genesisTrie, genesisHeader := newTestGenesisWithTrieAndHeader(t) + gen, genesisTrie, genesisHeader := newWestendLocalGenesisWithTrieAndHeader(t) err := stateSrvc.Initialise(&gen, &genesisHeader, &genesisTrie) require.NoError(t, err) diff --git a/dot/rpc/modules/childstate_test.go b/dot/rpc/modules/childstate_test.go index 8bcb7aba45..f3aecad492 100644 --- a/dot/rpc/modules/childstate_test.go +++ b/dot/rpc/modules/childstate_test.go @@ -21,7 +21,7 @@ import ( func createTestTrieState(t *testing.T) (*trie.Trie, common.Hash) { t.Helper() - _, genesisTrie, _ := newTestGenesisWithTrieAndHeader(t) + _, genesisTrie, _ := newWestendLocalGenesisWithTrieAndHeader(t) tr := rtstorage.NewTrieState(&genesisTrie) tr.Put([]byte(":first_key"), []byte(":value1")) diff --git a/dot/rpc/modules/dev_integration_test.go b/dot/rpc/modules/dev_integration_test.go index eeebd1ef63..42083e1a07 100644 --- a/dot/rpc/modules/dev_integration_test.go +++ b/dot/rpc/modules/dev_integration_test.go @@ -39,7 +39,7 @@ func newState(t *testing.T) (*state.BlockState, *state.EpochState) { db := state.NewInMemoryDB(t) - _, genesisTrie, genesisHeader := newTestGenesisWithTrieAndHeader(t) + _, genesisTrie, genesisHeader := newWestendLocalGenesisWithTrieAndHeader(t) tries := state.NewTries() tries.SetTrie(&genesisTrie) bs, err := state.NewBlockStateFromGenesis(db, tries, &genesisHeader, telemetryMock) diff --git a/dot/rpc/modules/helpers_test.go b/dot/rpc/modules/helpers_test.go index 61bc9260a6..41e9708253 100644 --- a/dot/rpc/modules/helpers_test.go +++ b/dot/rpc/modules/helpers_test.go @@ -22,11 +22,11 @@ func makeChange(keyHex, valueHex string) [2]*string { return [2]*string{&keyHex, &valueHex} } -func newTestGenesisWithTrieAndHeader(t *testing.T) ( +func newWestendLocalGenesisWithTrieAndHeader(t *testing.T) ( gen genesis.Genesis, genesisTrie trie.Trie, genesisHeader types.Header) { t.Helper() - genesisPath := utils.GetGssmrV3SubstrateGenesisRawPathTest(t) + genesisPath := utils.GetWestendLocalRawGenesisPath(t) genesisPtr, err := genesis.NewGenesisFromJSONRaw(genesisPath) require.NoError(t, err) gen = *genesisPtr diff --git a/lib/babe/babe_integration_test.go b/lib/babe/babe_integration_test.go index 8ebd8e381e..ca7d80977f 100644 --- a/lib/babe/babe_integration_test.go +++ b/lib/babe/babe_integration_test.go @@ -21,6 +21,7 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime/wasmer" "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" + "github.com/centrifuge/go-substrate-rpc-client/v4/signature" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -313,7 +314,8 @@ func TestService_HandleSlotWithLaggingSlot(t *testing.T) { epochData, err := babeService.initiateEpoch(testEpochIndex) require.NoError(t, err) - ext := runtime.NewTestExtrinsic(t, rt, parentHash, parentHash, 0, "System.remark", []byte{0xab, 0xcd}) + ext := runtime.NewTestExtrinsic(t, rt, parentHash, parentHash, 0, + signature.TestKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) block := createTestBlock(t, babeService, emptyHeader, [][]byte{common.MustHexToBytes(ext)}, 1, testEpochIndex, epochData) diff --git a/lib/babe/build_integration_test.go b/lib/babe/build_integration_test.go index 77a56c76ae..0af4aebcf3 100644 --- a/lib/babe/build_integration_test.go +++ b/lib/babe/build_integration_test.go @@ -19,7 +19,7 @@ import ( "github.com/ChainSafe/gossamer/pkg/scale" cscale "github.com/centrifuge/go-substrate-rpc-client/v4/scale" - signaturev4 "github.com/centrifuge/go-substrate-rpc-client/v4/signature" + "github.com/centrifuge/go-substrate-rpc-client/v4/signature" ctypes "github.com/centrifuge/go-substrate-rpc-client/v4/types" "github.com/centrifuge/go-substrate-rpc-client/v4/types/codec" "github.com/ethereum/go-ethereum/metrics" @@ -98,7 +98,8 @@ func TestBuildBlock_ok(t *testing.T) { epochData, err := babeService.initiateEpoch(testEpochIndex) require.NoError(t, err) - ext := runtime.NewTestExtrinsic(t, rt, parentHash, parentHash, 0, "System.remark", []byte{0xab, 0xcd}) + ext := runtime.NewTestExtrinsic(t, rt, parentHash, parentHash, 0, + signature.TestKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) block := createTestBlock(t, babeService, emptyHeader, [][]byte{common.MustHexToBytes(ext)}, 1, testEpochIndex, epochData) @@ -183,7 +184,8 @@ func TestApplyExtrinsic(t *testing.T) { header1, err := rt.FinalizeBlock() require.NoError(t, err) - extHex := runtime.NewTestExtrinsic(t, rt, parentHash, parentHash, 0, "System.remark", []byte{0xab, 0xcd}) + extHex := runtime.NewTestExtrinsic(t, rt, parentHash, parentHash, 0, + signature.TestKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) extBytes := common.MustHexToBytes(extHex) _, err = rt.ValidateTransaction(append([]byte{byte(types.TxnExternal)}, extBytes...)) require.NoError(t, err) @@ -258,7 +260,7 @@ func TestBuildAndApplyExtrinsic(t *testing.T) { } // Sign the transaction using Alice's default account - err = ext.Sign(signaturev4.TestKeyringPairAlice, o) + err = ext.Sign(signature.TestKeyringPairAlice, o) require.NoError(t, err) extEnc := bytes.Buffer{} diff --git a/lib/keystore/helpers.go b/lib/keystore/helpers.go index a2f1dc7909..ad6e76b5d9 100644 --- a/lib/keystore/helpers.go +++ b/lib/keystore/helpers.go @@ -299,19 +299,10 @@ func UnlockKeys(ks Inserter, dir, unlock, password string) error { // and returns the crypto.KeyType func DetermineKeyType(t string) crypto.KeyType { switch t { - case "babe": - return crypto.Sr25519Type case "gran": return crypto.Ed25519Type - case "acco": - return crypto.Sr25519Type - case "aura": - return crypto.Sr25519Type - case "imon": - return crypto.Sr25519Type - case "audi": - return crypto.Sr25519Type - case "dumy": + case "acco", "babe", "para", "asgn", + "aura", "imon", "audi", "dumy": return crypto.Sr25519Type } return crypto.UnknownType diff --git a/lib/keystore/keystore.go b/lib/keystore/keystore.go index d9c70a904b..f436dbfd43 100644 --- a/lib/keystore/keystore.go +++ b/lib/keystore/keystore.go @@ -24,6 +24,8 @@ var ( AccoName Name = "acco" AuraName Name = "aura" ImonName Name = "imon" + ParaName Name = "para" + AsgnName Name = "asgn" AudiName Name = "audi" DumyName Name = "dumy" ) @@ -62,6 +64,8 @@ type GlobalKeystore struct { Gran Keystore Acco Keystore Aura Keystore + Para Keystore + Asgn Keystore Imon Keystore Audi Keystore Dumy Keystore @@ -74,6 +78,8 @@ func NewGlobalKeystore() *GlobalKeystore { Gran: NewBasicKeystore(GranName, crypto.Ed25519Type), Acco: NewGenericKeystore(AccoName), // TODO: which type is used? can an account be either type? (#1872) Aura: NewBasicKeystore(AuraName, crypto.Sr25519Type), + Para: NewBasicKeystore(ParaName, crypto.Sr25519Type), + Asgn: NewBasicKeystore(AsgnName, crypto.Sr25519Type), Imon: NewBasicKeystore(ImonName, crypto.Sr25519Type), Audi: NewBasicKeystore(AudiName, crypto.Sr25519Type), Dumy: NewGenericKeystore(DumyName), @@ -94,6 +100,10 @@ func (k *GlobalKeystore) GetKeystore(name []byte) (Keystore, error) { return k.Aura, nil case ImonName: return k.Imon, nil + case ParaName: + return k.Para, nil + case AsgnName: + return k.Asgn, nil case AudiName: return k.Audi, nil case DumyName: diff --git a/lib/runtime/test_helpers.go b/lib/runtime/test_helpers.go index b3e8e06627..c3b81d9b8d 100644 --- a/lib/runtime/test_helpers.go +++ b/lib/runtime/test_helpers.go @@ -222,7 +222,7 @@ type MetadataVersioner interface { // NewTestExtrinsic builds a new extrinsic using centrifuge pkg func NewTestExtrinsic(t *testing.T, rt MetadataVersioner, genHash, blockHash common.Hash, - nonce uint64, call string, args ...interface{}) string { + nonce uint64, keyRingPair signature.KeyringPair, call string, args ...interface{}) string { t.Helper() rawMeta, err := rt.Metadata() @@ -254,7 +254,7 @@ func NewTestExtrinsic(t *testing.T, rt MetadataVersioner, genHash, blockHash com } // Sign the transaction using Alice's key - err = ext.Sign(signature.TestKeyringPairAlice, o) + err = ext.Sign(keyRingPair, o) require.NoError(t, err) extEnc, err := codec.EncodeToHex(ext) diff --git a/lib/runtime/wasmer/exports_test.go b/lib/runtime/wasmer/exports_test.go index c7ead2732c..bf98f42b11 100644 --- a/lib/runtime/wasmer/exports_test.go +++ b/lib/runtime/wasmer/exports_test.go @@ -22,6 +22,7 @@ import ( "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" + "github.com/centrifuge/go-substrate-rpc-client/v4/signature" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -343,7 +344,7 @@ func TestNodeRuntime_ValidateTransaction(t *testing.T) { } extHex := runtime.NewTestExtrinsic(t, rt, genesisHeader.Hash(), genesisHeader.Hash(), - 0, "System.remark", []byte{0xab, 0xcd}) + 0, signature.TestKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) genesisHashBytes := genesisHeader.Hash().ToBytes() @@ -561,7 +562,7 @@ func TestInstance_ApplyExtrinsic_WestendRuntime(t *testing.T) { require.NoError(t, err) extHex := runtime.NewTestExtrinsic(t, instance, genesisHeader.Hash(), genesisHeader.Hash(), - 0, "System.remark", []byte{0xab, 0xcd}) + 0, signature.TestKeyringPairAlice, "System.remark", []byte{0xab, 0xcd}) res, err := instance.ApplyExtrinsic(common.MustHexToBytes(extHex)) require.NoError(t, err)