Skip to content

Commit

Permalink
add back ProvideKVStore/Service
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 committed Dec 19, 2024
1 parent 08a7dd2 commit 189f874
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/beacond/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func DefaultComponents() []any {
*KVStore, *Logger,
*StorageBackend,
],
// TODO Hacks
components.ProvideKVStoreService,
components.ProvideKVStoreKey,
}
c = append(c,
components.ProvideNodeAPIServer[*Logger, NodeAPIContext],
Expand Down
37 changes: 37 additions & 0 deletions node-core/components/depinject.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: BUSL-1.1
//
// Copyright (C) 2024, Berachain Foundation. All rights reserved.
// Use of this software is governed by the Business Source License included
// in the LICENSE file of this repository and at www.mariadb.com/bsl11.
//
// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY
// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER
// VERSIONS OF THE LICENSED WORK.
//
// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF
// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF
// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE).
//
// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
// TITLE.

package components

import (
"cosmossdk.io/core/store"
"cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/runtime"
)

var storeKey = types.NewKVStoreKey("beacon")

func ProvideKVStoreKey() *types.KVStoreKey {
return storeKey
}

func ProvideKVStoreService(storeKey *types.KVStoreKey) store.KVStoreService {
return runtime.NewKVStoreService(storeKey)
}
4 changes: 2 additions & 2 deletions scripts/build/linting.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ license-fix:

nilaway:
@echo "--> Running nilaway"
(go run go.uber.org/nilaway/cmd/nilaway -exclude-errors-in-files "geth-primitives/deposit/" -v ./...) || exit 1;
(go run go.uber.org/nilaway/cmd/nilaway --tags bls12381 -exclude-errors-in-files "geth-primitives/deposit/" -v ./...) || exit 1;
@printf "Nilaway check complete\n"

#################
Expand All @@ -62,7 +62,7 @@ nilaway:

gosec:
@echo "--> Running gosec"
@go run github.com/cosmos/gosec/v2/cmd/gosec -exclude G702 ./...
@go run github.com/cosmos/gosec/v2/cmd/gosec -tags bls12381 -exclude G702 ./...

#################
# slither #
Expand Down

0 comments on commit 189f874

Please sign in to comment.