Skip to content

Commit c4bbd50

Browse files
authored
events: Add VoterList events (#293)
* events: Add VoterList events * types: Use [4]U8 for module error
1 parent dee2d63 commit c4bbd50

6 files changed

Lines changed: 26 additions & 31 deletions

File tree

types/errors.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import "github.com/centrifuge/go-substrate-rpc-client/v4/scale"
2121
type ModuleError struct {
2222
Index U8
2323

24-
// The 1 byte error is considered legacy however it seems that it's still used.
25-
//
26-
// Error [4]U8
27-
Error U8
24+
Error [4]U8
2825
}
2926

3027
func (m *ModuleError) Decode(decoder scale.Decoder) error {

types/errors_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
IsModule: true,
3939
ModuleError: ModuleError{
4040
Index: 4,
41-
Error: 5,
41+
Error: [4]U8{5, 0, 0, 0},
4242
},
4343
}
4444
testDispatchError5 = DispatchError{
@@ -163,7 +163,7 @@ func TestDispatchError_Encode(t *testing.T) {
163163
{testDispatchError1, MustHexDecodeString("0x00")},
164164
{testDispatchError2, MustHexDecodeString("0x01")},
165165
{testDispatchError3, MustHexDecodeString("0x02")},
166-
{testDispatchError4, MustHexDecodeString("0x030405")},
166+
{testDispatchError4, MustHexDecodeString("0x030405000000")},
167167
{testDispatchError5, MustHexDecodeString("0x04")},
168168
{testDispatchError6, MustHexDecodeString("0x05")},
169169
{testDispatchError7, MustHexDecodeString("0x06")},
@@ -178,7 +178,7 @@ func TestDispatchError_Decode(t *testing.T) {
178178
{MustHexDecodeString("0x00"), testDispatchError1},
179179
{MustHexDecodeString("0x01"), testDispatchError2},
180180
{MustHexDecodeString("0x02"), testDispatchError3},
181-
{MustHexDecodeString("0x030405"), testDispatchError4},
181+
{MustHexDecodeString("0x030405000000"), testDispatchError4},
182182
{MustHexDecodeString("0x04"), testDispatchError5},
183183
{MustHexDecodeString("0x05"), testDispatchError6},
184184
{MustHexDecodeString("0x06"), testDispatchError7},

types/event_record.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ type EventRecords struct {
427427
Vesting_VestingCompleted []EventVestingVestingCompleted `test-gen-blockchain:"centrifuge-parachain"`
428428
Vesting_VestingUpdated []EventVestingVestingUpdated `test-gen-blockchain:"centrifuge-parachain"`
429429

430+
VoterList_Rebagged []EventVoterListRebagged `test-gen-blockchain:"polkadot"`
431+
VoterList_ScoreUpdated []EventVoterListScoreUpdated `test-gen-blockchain:"polkadot"`
432+
430433
Whitelist_CallWhitelisted []EventWhitelistCallWhitelisted `test-gen-skip:"true"`
431434
Whitelist_WhitelistedCallRemoved []EventWhitelistWhitelistedCallRemoved `test-gen-skip:"true"`
432435
Whitelist_WhitelistedCallDispatched []EventWhitelistWhitelistedCallRemoved `test-gen-skip:"true"`

0 commit comments

Comments
 (0)