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

* aligning imports * added config/upgrade-v0.13.0.json upgrade description to make upgrades to v0.13.0 more flexible content should look as { "der-upgrade-height": 2198251 } Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
27 lines
634 B
Go
27 lines
634 B
Go
package keeper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
dertypes "github.com/planetmint/planetmint-go/x/der/types"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestStoreDerAssetAndLookupDerAsset(t *testing.T) {
|
|
keeper, ctx := CreateTestKeeper(t)
|
|
asset := dertypes.DER{
|
|
ZigbeeID: "test-zigbee-id",
|
|
}
|
|
|
|
keeper.StoreDerAsset(ctx, asset)
|
|
result, found := keeper.LookupDerAsset(ctx, "test-zigbee-id")
|
|
require.True(t, found)
|
|
require.Equal(t, asset.ZigbeeID, result.ZigbeeID)
|
|
}
|
|
|
|
func TestLookupDerAsset_NotFound(t *testing.T) {
|
|
keeper, ctx := CreateTestKeeper(t)
|
|
_, found := keeper.LookupDerAsset(ctx, "nonexistent-id")
|
|
require.False(t, found)
|
|
}
|