Skip to content

Commit 5c7741d

Browse files
committedAug 10, 2024··
feat: run migrations
1 parent 6333e56 commit 5c7741d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
 

‎abci/example/kvstore/persistent_kvstore.go

+4
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ func (app *PersistentKVStoreApplication) ProcessProposal(
183183
return types.ResponseProcessProposal{Result: types.ResponseProcessProposal_ACCEPT}
184184
}
185185

186+
func (app *PersistentKVStoreApplication) RunMigrations(req types.RequestRunMigrations) types.ResponseRunMigrations {
187+
return types.ResponseRunMigrations{AppHash: []byte{}}
188+
}
189+
186190
//---------------------------------------------
187191
// update validators
188192

‎abci/types/application.go

+13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ type Application interface {
3131
OfferSnapshot(RequestOfferSnapshot) ResponseOfferSnapshot // Offer a snapshot to the application
3232
LoadSnapshotChunk(RequestLoadSnapshotChunk) ResponseLoadSnapshotChunk // Load a snapshot chunk
3333
ApplySnapshotChunk(RequestApplySnapshotChunk) ResponseApplySnapshotChunk // Apply a shapshot chunk
34+
35+
RunMigrations(RequestRunMigrations) ResponseRunMigrations
36+
}
37+
38+
type RequestRunMigrations struct{}
39+
40+
type ResponseRunMigrations struct {
41+
AppHash []byte
3442
}
3543

3644
//-------------------------------------------------------
@@ -105,6 +113,11 @@ func (BaseApplication) ProcessProposal(req RequestProcessProposal) ResponseProce
105113
return ResponseProcessProposal{Result: ResponseProcessProposal_ACCEPT}
106114
}
107115

116+
// RunMigrations implements Application.
117+
func (BaseApplication) RunMigrations(RequestRunMigrations) ResponseRunMigrations {
118+
return ResponseRunMigrations{AppHash: []byte{}}
119+
}
120+
108121
//-------------------------------------------------------
109122

110123
// GRPCApplication is a GRPC wrapper for Application

0 commit comments

Comments
 (0)
Please sign in to comment.