Skip to content

Commit

Permalink
events: Add VoterList events (#293)
Browse files Browse the repository at this point in the history
* events: Add VoterList events

* types: Use [4]U8 for module error
  • Loading branch information
cdamian authored Sep 12, 2022
1 parent dee2d63 commit c4bbd50
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 31 deletions.
5 changes: 1 addition & 4 deletions types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import "github.com/centrifuge/go-substrate-rpc-client/v4/scale"
type ModuleError struct {
Index U8

// The 1 byte error is considered legacy however it seems that it's still used.
//
// Error [4]U8
Error U8
Error [4]U8
}

func (m *ModuleError) Decode(decoder scale.Decoder) error {
Expand Down
6 changes: 3 additions & 3 deletions types/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
IsModule: true,
ModuleError: ModuleError{
Index: 4,
Error: 5,
Error: [4]U8{5, 0, 0, 0},
},
}
testDispatchError5 = DispatchError{
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestDispatchError_Encode(t *testing.T) {
{testDispatchError1, MustHexDecodeString("0x00")},
{testDispatchError2, MustHexDecodeString("0x01")},
{testDispatchError3, MustHexDecodeString("0x02")},
{testDispatchError4, MustHexDecodeString("0x030405")},
{testDispatchError4, MustHexDecodeString("0x030405000000")},
{testDispatchError5, MustHexDecodeString("0x04")},
{testDispatchError6, MustHexDecodeString("0x05")},
{testDispatchError7, MustHexDecodeString("0x06")},
Expand All @@ -178,7 +178,7 @@ func TestDispatchError_Decode(t *testing.T) {
{MustHexDecodeString("0x00"), testDispatchError1},
{MustHexDecodeString("0x01"), testDispatchError2},
{MustHexDecodeString("0x02"), testDispatchError3},
{MustHexDecodeString("0x030405"), testDispatchError4},
{MustHexDecodeString("0x030405000000"), testDispatchError4},
{MustHexDecodeString("0x04"), testDispatchError5},
{MustHexDecodeString("0x05"), testDispatchError6},
{MustHexDecodeString("0x06"), testDispatchError7},
Expand Down
3 changes: 3 additions & 0 deletions types/event_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ type EventRecords struct {
Vesting_VestingCompleted []EventVestingVestingCompleted `test-gen-blockchain:"centrifuge-parachain"`
Vesting_VestingUpdated []EventVestingVestingUpdated `test-gen-blockchain:"centrifuge-parachain"`

VoterList_Rebagged []EventVoterListRebagged `test-gen-blockchain:"polkadot"`
VoterList_ScoreUpdated []EventVoterListScoreUpdated `test-gen-blockchain:"polkadot"`

Whitelist_CallWhitelisted []EventWhitelistCallWhitelisted `test-gen-skip:"true"`
Whitelist_WhitelistedCallRemoved []EventWhitelistWhitelistedCallRemoved `test-gen-skip:"true"`
Whitelist_WhitelistedCallDispatched []EventWhitelistWhitelistedCallRemoved `test-gen-skip:"true"`
Expand Down
Loading

0 comments on commit c4bbd50

Please sign in to comment.