Skip to content

Commit

Permalink
Fix missing Batch.ClassKey
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Mar 19, 2024
1 parent fa5a465 commit 6e60592
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/ecocredit/base/keeper/msg_bridge_receive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (s *bridgeReceiveSuite) AProjectWithIdAndReferenceId(a, b string) {
func (s *bridgeReceiveSuite) ACreditBatchWithDenomAndIssuerAlice(a string) {
bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Issuer: s.alice,
Denom: a,
Open: true, // always true unless specified
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/base/keeper/msg_bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func (s *bridgeSuite) creditBatchSetup() {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: pKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down
3 changes: 3 additions & 0 deletions x/ecocredit/base/keeper/msg_cancel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (s *cancel) ACreditBatchWithDenom(a string) {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: a,
})
require.NoError(s.t, err)
Expand Down Expand Up @@ -101,6 +102,7 @@ func (s *cancel) ACreditBatchFromCreditClassWithCreditType(a string) {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down Expand Up @@ -246,6 +248,7 @@ func (s *cancel) creditBatchSetup() {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/base/keeper/msg_create_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (k Keeper) CreateBatch(ctx context.Context, req *types.MsgCreateBatch) (*ty
EndDate: endDate,
IssuanceDate: issuanceDate,
Open: req.Open,
ClassKey: class.Key,
})
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/base/keeper/msg_mint_batch_credits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (s *mintBatchCredits) AProjectWithId(a string) {
func (s *mintBatchCredits) ACreditBatchWithDenomAndIssuerAlice(a string) {
bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Issuer: s.alice,
Denom: a,
Open: true, // always true unless specified
Expand All @@ -109,6 +110,7 @@ func (s *mintBatchCredits) ACreditBatchWithDenomOpenAndIssuerAlice(a, b string)
Issuer: s.alice,
Denom: a,
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Open: open,
})
require.NoError(s.t, err)
Expand Down
3 changes: 3 additions & 0 deletions x/ecocredit/base/keeper/msg_retire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (s *retire) ACreditBatchWithDenom(a string) {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: a,
})
require.NoError(s.t, err)
Expand Down Expand Up @@ -106,6 +107,7 @@ func (s *retire) ACreditBatchFromCreditClassWithCreditType(a string) {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down Expand Up @@ -279,6 +281,7 @@ func (s *retire) creditBatchSetup() {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/base/keeper/msg_seal_batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (s *sealBatch) AProjectWithId(a string) {
func (s *sealBatch) ACreditBatchWithDenomAndIssuerAlice(a string) {
bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Issuer: s.alice,
Denom: a,
Open: true,
Expand Down
3 changes: 3 additions & 0 deletions x/ecocredit/base/keeper/msg_send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (s *send) ACreditBatchWithDenom(a string) {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: a,
})
require.NoError(s.t, err)
Expand Down Expand Up @@ -102,6 +103,7 @@ func (s *send) ACreditBatchFromCreditClassWithCreditType(a string) {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down Expand Up @@ -355,6 +357,7 @@ func (s *send) creditBatchSetup() {

bKey, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Denom: s.batchDenom,
})
require.NoError(s.t, err)
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/base/keeper/msg_update_batch_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (s *updateBatchMetadata) AProjectWithId(a string) {
func (s *updateBatchMetadata) ACreditBatchWithBatchDenomAndIssuerAlice(a string) {
_, err := s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Issuer: s.alice,
Denom: a,
Open: true, // true unless specified
Expand All @@ -92,6 +93,7 @@ func (s *updateBatchMetadata) ACreditBatchWithBatchDenomIssuerAliceAndOpen(a, b

_, err = s.k.stateStore.BatchTable().InsertReturningID(s.ctx, &api.Batch{
ProjectKey: s.projectKey,
ClassKey: s.classKey,
Issuer: s.alice,
Denom: a,
Open: open,
Expand Down

0 comments on commit 6e60592

Please sign in to comment.