Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jimjbrettj committed Sep 11, 2023
1 parent 09bb401 commit 2f30b62
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 deletions client/consensus/grandpa/authorities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ func TestChangesIteratedInPreOrder(t *testing.T) {

func TestApplyChange(t *testing.T) {
authorities := AuthoritySet[string, uint]{
currentAuthorities: []Authority{},
setID: 0,
pendingStandardChanges: NewChangeTree[string, uint](),
pendingForcedChanges: []PendingChange[string, uint]{},
authoritySetChanges: AuthoritySetChanges[uint]{},
CurrentAuthorities: []Authority{},
SetID: 0,
PendingStandardChanges: NewChangeTree[string, uint](),
PendingForcedChanges: []PendingChange[string, uint]{},
AuthoritySetChanges: AuthoritySetChanges[uint]{},
}

var setA []Authority
Expand Down
5 changes: 4 additions & 1 deletion client/consensus/grandpa/aux_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ func loadPersistent[H comparable, N constraints.Unsigned](store AuxStore, genesi
}, nil
} else {
logger.Info("👴 Loading GRANDPA authority set from genesis on what appears to be first startup")
genesisSet := NewGenesisAuthoritySet[H, N](genesisAuthorities)
genesisSet, err := NewGenesisAuthoritySet[H, N](genesisAuthorities)
if err != nil {
return nil, err
}

state := finalityGrandpa.NewRoundState(finalityGrandpa.HashNumber[H, N]{Hash: genesisHash, Number: genesisNumber})
base := state.PrevoteGHOST
Expand Down
6 changes: 4 additions & 2 deletions client/consensus/grandpa/aux_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ func TestLoadPersistentGenesis(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, persistentData)

genesisSet := NewGenesisAuthoritySet[string, uint](genesisAuthorities)
genesisSet, err := NewGenesisAuthoritySet[string, uint](genesisAuthorities)
require.NoError(t, err)

state := finalityGrandpa.NewRoundState(finalityGrandpa.HashNumber[string, uint]{Hash: genesisHash, Number: genesisNumber})
base := state.PrevoteGHOST
Expand Down Expand Up @@ -132,7 +133,8 @@ func TestLoadPersistentNotGenesis(t *testing.T) {
}}

// Auth set and Set state both written
genesisSet := NewGenesisAuthoritySet[string, uint](genesisAuthorities)
genesisSet, err := NewGenesisAuthoritySet[string, uint](genesisAuthorities)
require.NoError(t, err)

state := finalityGrandpa.NewRoundState(finalityGrandpa.HashNumber[string, uint]{Hash: genesisHash, Number: genesisNumber})
base := state.PrevoteGHOST
Expand Down

0 comments on commit 2f30b62

Please sign in to comment.