Save Archived State (#6503)

This commit is contained in:
Nishant Das 2020-07-07 23:04:55 +08:00 committed by GitHub
parent 46b82eb15d
commit b868dfa481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -62,7 +62,7 @@ func (s *State) Resume(ctx context.Context) (*state.BeaconState, error) {
return s.beaconDB.GenesisState(ctx)
}
s.finalizedInfo = &finalizedInfo{slot: lastArchivedState.Slot(), root: lastArchivedRoot}
s.finalizedInfo = &finalizedInfo{slot: lastArchivedState.Slot(), root: lastArchivedRoot, state: lastArchivedState.Copy()}
return lastArchivedState, nil
}

View File

@ -45,4 +45,7 @@ func TestResume(t *testing.T) {
if root != service.finalizedInfo.root {
t.Errorf("Did not get wanted root")
}
if service.finalizedState() == nil {
t.Error("Wanted a non nil finalized state")
}
}