mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-09-13 03:40:10 +00:00

* added DER module * scaffold type --module der DER zigbeeID dirigeraID dirigeraMAC plmntAddress liquidAddress * ./ignite scaffold message registerDER der:DER --module der * changed URL * storing DER * added query * added liquid der asset type * added der asset notarization logic * added nft notarization for DER * added nft query * added query and fixed linter aspects * added store testcases to the der module * added test cases adjusted to the linter requirements * addd ignite generate code changes * added metadata json instead of specific data Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
21 lines
721 B
Go
21 lines
721 B
Go
package keeper
|
|
|
|
import (
|
|
"github.com/cosmos/cosmos-sdk/store/prefix"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/planetmint/planetmint-go/util"
|
|
)
|
|
|
|
// storeAsset is a helper for storing any asset type.
|
|
func (k Keeper) storeAsset(ctx sdk.Context, keyPrefix []byte, zigbeeID string, value []byte) {
|
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), keyPrefix)
|
|
store.Set(util.SerializeString(zigbeeID), value)
|
|
}
|
|
|
|
// lookupAsset is a helper for looking up any asset type.
|
|
func (k Keeper) lookupAsset(ctx sdk.Context, keyPrefix []byte, zigbeeID string) (bz []byte, found bool) {
|
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), keyPrefix)
|
|
bz = store.Get(util.SerializeString(zigbeeID))
|
|
return bz, bz != nil
|
|
}
|