Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Mar 19, 2024
1 parent 84ba6f9 commit 8a18b1a
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions x/ecocredit/genesis/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ func TestValidateGenesis(t *testing.T) {
Precision: 6,
}))

cls1 := &baseapi.Class{
Id: "BIO001",
Admin: sdk.AccAddress("addr4"),
CreditTypeAbbrev: "BIO",
}
cls2 := &baseapi.Class{
Id: "BIO002",
Admin: sdk.AccAddress("addr5"),
CreditTypeAbbrev: "BIO",
}

clsKey1, err := ss.ClassTable().InsertReturningID(ormCtx, cls1)
require.NoError(t, err)
clsKey2, err := ss.ClassTable().InsertReturningID(ormCtx, cls2)
require.NoError(t, err)

require.NoError(t, ss.BatchBalanceTable().Insert(ormCtx,
&baseapi.BatchBalance{
BatchKey: 1,
Expand All @@ -55,6 +71,7 @@ func TestValidateGenesis(t *testing.T) {
{
Issuer: sdk.AccAddress("addr2"),
ProjectKey: 1,
ClassKey: clsKey1,
Denom: "BIO01-P001-00000000-00000000-001",
StartDate: &timestamppb.Timestamp{Seconds: 100},
EndDate: &timestamppb.Timestamp{Seconds: 101},
Expand All @@ -63,6 +80,7 @@ func TestValidateGenesis(t *testing.T) {
{
Issuer: sdk.AccAddress("addr3"),
ProjectKey: 1,
ClassKey: clsKey2,
Denom: "BIO02-P001-00000000-00000000-001",
StartDate: &timestamppb.Timestamp{Seconds: 100},
EndDate: &timestamppb.Timestamp{Seconds: 101},
Expand All @@ -80,22 +98,6 @@ func TestValidateGenesis(t *testing.T) {
RetiredAmount: "9.997",
}))

classes := []*baseapi.Class{
{
Id: "BIO001",
Admin: sdk.AccAddress("addr4"),
CreditTypeAbbrev: "BIO",
},
{
Id: "BIO002",
Admin: sdk.AccAddress("addr5"),
CreditTypeAbbrev: "BIO",
},
}
for _, c := range classes {
require.NoError(t, ss.ClassTable().Insert(ormCtx, c))
}

projects := []*baseapi.Project{
{
Id: "P001",
Expand Down

0 comments on commit 8a18b1a

Please sign in to comment.