sonr/x/vault/keeper/orm_test.go
Prad Nukala 60c48d2409
feature/did accounts (#23)
* feat: add support for DID number as primary key for Controllers

* refactor: rename pkg/proxy to app/proxy

* feat: add vault module keeper tests

* feat(vault): add DID keeper to vault module

* refactor: move vault client code to its own package

* refactor(vault): extract schema definition

* refactor: use vaulttypes for MsgAllocateVault

* refactor: update vault assembly logic to use new methods

* feat: add dwn-proxy command

* refactor: remove unused context.go file

* refactor: remove unused web-related code

* feat: add DWN proxy server

* feat: add BuildTx RPC to vault module

* fix: Implement BuildTx endpoint

* feat: add devbox integration to project
2024-09-25 19:45:28 -04:00

32 lines
581 B
Go

package keeper_test
import (
"testing"
apiv1 "github.com/onsonr/sonr/api/vault/v1"
"github.com/stretchr/testify/require"
)
func TestORM(t *testing.T) {
f := SetupTest(t)
dt := f.k.OrmDB.DWNTable()
acc := []byte("test_acc")
amt := uint64(7)
err := dt.Insert(f.ctx, &apiv1.DWN{
Account: acc,
Amount: amt,
})
require.NoError(t, err)
d, err := dt.Has(f.ctx, []byte("test_acc"))
require.NoError(t, err)
require.True(t, d)
res, err := dt.Get(f.ctx, []byte("test_acc"))
require.NoError(t, err)
require.NotNil(t, res)
require.EqualValues(t, amt, res.Amount)
}