Skip to content

Commit

Permalink
chore(deps): bump github.com/centrifuge/go-substrate-rpc-client/v4 fr…
Browse files Browse the repository at this point in the history
…om 4.0.9 to 4.0.10 (#3009)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: EclesioMeloJunior <eclesiomelo.1@gmail.com>
  • Loading branch information
dependabot[bot] and EclesioMeloJunior authored Jan 4, 2023
1 parent 3729f32 commit 58ce668
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dot/rpc/modules/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func TestSystemModule_AccountNextIndex(t *testing.T) {
mockStorageAPI := mocks.NewStorageAPI(t)
mockStorageAPI.On("GetStorage", (*common.Hash)(nil), storageKeyHex).
Return(common.MustHexToBytes("0x0300000000000000000000000000000000000000000000000000000000000000000000"+
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000"), nil)
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), nil)

mockStorageAPIErr := mocks.NewStorageAPI(t)
mockStorageAPIErr.On("GetStorage", (*common.Hash)(nil), storageKeyHex).Return(nil, errors.New("getStorage error"))
Expand All @@ -260,15 +260,15 @@ func TestSystemModule_AccountNextIndex(t *testing.T) {
expErr: errors.New("account address must be valid"),
},
{
name: "Found",
name: "found_in_pending_transactions",
sysModule: NewSystemModule(nil, nil, mockCoreAPI, mockStorageAPI, mockTxStateAPI, nil, nil),
args: args{
req: &StringRequest{String: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"},
},
exp: U64Response(4),
},
{
name: "Not found",
name: "not_found_in_pending_transactions",
sysModule: NewSystemModule(nil, nil, mockCoreAPI, mockStorageAPI, mockTxStateAPI, nil, nil),
args: args{
req: &StringRequest{String: "5FrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"},
Expand Down
7 changes: 4 additions & 3 deletions dot/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
// AccountInfo Information of an account.
type AccountInfo struct {
// The number of transactions this account has sent.
Nonce uint32
Consumers uint32
Producers uint32
Nonce uint32
Consumers uint32
Producers uint32
Sufficients uint32
// The additional data that belongs to this account. Used to store the balance(s) in a lot of chains.
Data AccountData
}
Expand Down
10 changes: 6 additions & 4 deletions lib/genesis/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ func TestNewGenesisRawFromJSON(t *testing.T) {
func TestNewGenesisFromJSON(t *testing.T) {
var expectedGenesis = &Genesis{}
const zeroByte = "0x00"
const oneByte = "0x01"

expRaw := make(map[string]map[string]string)
expRaw["top"] = make(map[string]string)
expRaw["top"]["0x3a636f6465"] = "0xfoo"
expRaw["top"]["0x3a6772616e6470615f617574686f726974696573"] = "0x010834602b88f60513f1c805d87ef52896934baf6a662bc37414dbdbf69356b1a6910000000000000000" // raw grandpa authorities
expRaw["top"]["0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d"] = "0x08d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000" // raw babe authorities
expRaw["top"]["0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"] = "0x0000000000000000000000007aeb9049000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" // raw system account
expRaw["top"][common.BytesToHex(common.UpgradedToDualRefKey)] = "0x01"
expRaw["top"]["0x3a6772616e6470615f617574686f726974696573"] = "0x010834602b88f60513f1c805d87ef52896934baf6a662bc37414dbdbf69356b1a6910000000000000000" // raw grandpa authorities
expRaw["top"]["0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d"] = "0x08d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000" // raw babe authorities
expRaw["top"]["0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"] = "0x000000000000000000000000000000007aeb9049000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" // raw system account
expRaw["top"][common.BytesToHex(common.UpgradedToDualRefKey)] = oneByte
expRaw["top"]["0x426e15054d267946093858132eb537f1a47a9ff5cd5bf4d848a80a0b1a947dc3"] = "0x00000000000000000000000000000000" // Society
expRaw["top"]["0x426e15054d267946093858132eb537f1ba7fb8745735dc3be2a2c61a72c39e78"] = "0x0101d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48" // Society
expRaw["top"]["0x426e15054d267946093858132eb537f1d0b4a3f7631f0c0e761898fe198211de"] = "0xe7030000" // Society // Staking
Expand All @@ -86,6 +87,7 @@ func TestNewGenesisFromJSON(t *testing.T) {
expRaw["top"]["0x5f3e4907f716ac89b6347d15ececedca28dccb559b95c40168a1b2696581b5a7"] = "0x00000000000000000000000000000000" // Staking.CanceledSlashPayout
expRaw["top"]["0x8985776095addd4789fccbce8ca77b23ba7fb8745735dc3be2a2c61a72c39e78"] = "0x08d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48" // Instance2Collective
expRaw["top"]["0x492a52699edf49c972c21db794cfcf57ba7fb8745735dc3be2a2c61a72c39e78"] = zeroByte // Instance1Membership
expRaw["top"]["0x26aa394eea5630e07c48ae0c9558cef7c21aab032aaa6e946ca50ad39ab66603"] = oneByte
// Contract
expRaw["top"]["0x4342193e496fab7ec59d615ed0dc5530d2d505c0e6f76fd7ce0796ebe187401c"] = "0x010000000001040000000002000000010000800000001000000000100000000100002000000000000800150600004c6b02004c8103009e1800000b1d0000160d0000651800006d2b00008a000000f5700100fdf602008e070000440600006e070000030600004f180000b528000091070000b60da70827080000590800006a0a0000ef070000560800004a0800008e080000f509000061090000dd090000a10a00009c090000e409000091090000650900001e0a0000120a0000ae09000099090000060a00006b2000000b1d000051200000221d000094090000ad090000b6090000160a0000660a0000fd090000260a0000440a0000d41a2a0000000000a0c729000000000092122900000000001ab5580000000000ba1c290000000000e000290000000000b0ef280000000000ee325c0000000000dec1280000000000ca07290000000000c07d4e00000000009c77140000000000303a7200000000000b01000000000000f0ab450000000000ff0200000000000060a21c270000000030078d31000000002635af09000000000ae164000000000038b18e0000000000b6b1cc0700000000890900000000000040036c00000000008ad6e21100000000de020000000000006e67cc080000000078f6110200000000e605000000000000acb1b50a00000000b24419090000000092579f08000000004702000000000000240300000000000016eaeb220000000055020000000000003503000000000000db0a000000000000f4802600000000006a100000000000006a9a280000000000220d0000000000004e9c2400000000001c0600000000000026832400000000001b06000000000000"
expectedGenesis.Genesis = Fields{
Expand Down
7 changes: 6 additions & 1 deletion lib/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func KeystoreFiles(basepath string) ([]string, error) {
return nil, fmt.Errorf("failed to read keystore directory: %s", err)
}

keys := []string{}
var keys []string

for _, f := range files {
ext := filepath.Ext(f.Name())
Expand Down Expand Up @@ -239,6 +239,11 @@ func GetGssmrV3SubstrateGenesisPath() (path string, err error) {
return filepath.Join(rootPath, "./chain/gssmr-v3substrate/genesis-spec.json"), nil
}

// GetWestendDevGenesisPath gets the westend-dev genesis path
func GetWestendDevGenesisPath(t *testing.T) string {
return filepath.Join(GetProjectRootPathTest(t), "./chain/westend-dev/westend-dev-spec-raw.json")
}

// GetKusamaGenesisPath gets the Kusama genesis path
func GetKusamaGenesisPath(t *testing.T) string {
return filepath.Join(GetProjectRootPathTest(t), "./chain/kusama/genesis.json")
Expand Down
3 changes: 2 additions & 1 deletion tests/rpc/rpc_02-author_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
// TODO: add test against latest dev runtime
// See https://github.com/ChainSafe/gossamer/issues/2705
func TestAuthorSubmitExtrinsic(t *testing.T) {
genesisPath := libutils.GetDevV3SubstrateGenesisPath(t)
genesisPath := libutils.GetWestendDevGenesisPath(t)
tomlConfig := config.Default()
tomlConfig.Account.Key = "alice"
tomlConfig.Init.Genesis = genesisPath
tomlConfig.Core.BABELead = true

Expand Down

0 comments on commit 58ce668

Please sign in to comment.