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>
26 lines
694 B
Go
26 lines
694 B
Go
package keeper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
dertypes "github.com/planetmint/planetmint-go/x/der/types"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestStoreLiquidDerAssetAndLookupLiquidDerAsset(t *testing.T) {
|
|
keeper, ctx := CreateTestKeeper(t)
|
|
asset := dertypes.LiquidDerAsset{
|
|
ZigbeeID: "liquid-test-zigbee-id",
|
|
}
|
|
keeper.StoreLiquidDerAsset(ctx, asset)
|
|
result, found := keeper.LookupLiquidDerAsset(ctx, "liquid-test-zigbee-id")
|
|
require.True(t, found)
|
|
require.Equal(t, asset.ZigbeeID, result.ZigbeeID)
|
|
}
|
|
|
|
func TestLookupLiquidDerAsset_NotFound(t *testing.T) {
|
|
keeper, ctx := CreateTestKeeper(t)
|
|
_, found := keeper.LookupLiquidDerAsset(ctx, "nonexistent-id")
|
|
require.False(t, found)
|
|
}
|