-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#40 introduce in-memory store #41
Conversation
cosmos/poc/app/handler.go
Outdated
// imms - in-memory storage | ||
func NewLinksHandler(cis CidIndexStorage, ils LinksStorage, ols LinksStorage, imms *InMemoryStorage) sdk.Handler { | ||
|
||
getCidIndex := func(ctx sdk.Context, cid Cid) CidNumber { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move function creation to external function
cosmos/poc/app/storage/inmemory.go
Outdated
|
||
// Load from underlying persistent storage | ||
// Heavy operation | ||
func (s *InMemoryStorage) Load(ctx sdk.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be move CyberdPersistentStorages from struct to that function param?
cosmos/poc/app/storage/cids.go
Outdated
func (cis CidIndexStorage) GetCidsCount(ctx sdk.Context) uint64 { | ||
|
||
mainStore := ctx.KVStore(cis.mainStoreKey) | ||
lastIndexAsBytes := mainStore.Get(cidsCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastCidIndex
cosmos/poc/app/storage/links.go
Outdated
return nil, nil, err | ||
} | ||
|
||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to func
No description provided.