Skip to content

Commit

Permalink
chore: gomod/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Mar 16, 2022
1 parent 46ac0e3 commit 4bacfdb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion x/ecocredit/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.7
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -68,7 +69,6 @@ require (
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down Expand Up @@ -125,6 +125,7 @@ require (
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
23 changes: 13 additions & 10 deletions x/ecocredit/server/marketplace/cancel_sell_order_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package marketplace

import (
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/protobuf/types/known/timestamppb"
"gotest.tools/v3/assert"

"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp/cmpopts"

api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1"
"github.com/regen-network/regen-ledger/x/ecocredit"
"github.com/regen-network/regen-ledger/x/ecocredit/marketplace"
"google.golang.org/protobuf/types/known/timestamppb"
"gotest.tools/v3/assert"
"testing"
"time"
)

func TestSell_CancelOrder(t *testing.T) {
Expand Down Expand Up @@ -41,7 +44,7 @@ func TestSell_CancelOrder(t *testing.T) {
assert.NilError(t, err)

res, err := s.k.Sell(s.ctx, &marketplace.MsgSell{
Owner: s.addr.String(),
Owner: s.addr.String(),
Orders: []*marketplace.MsgSell_Order{
{BatchDenom: batchDenom, Quantity: "10", AskPrice: &ask, Expiration: &expir},
},
Expand Down Expand Up @@ -80,10 +83,10 @@ func TestSell_CancelOrderInvalid(t *testing.T) {
p.CreditTypes = []*ecocredit.CreditType{&creditType}
}).Times(1)

_,_,otherAddr := testdata.KeyTestPubAddr()
_, _, otherAddr := testdata.KeyTestPubAddr()

res, err := s.k.Sell(s.ctx, &marketplace.MsgSell{
Owner: s.addr.String(),
Owner: s.addr.String(),
Orders: []*marketplace.MsgSell_Order{
{BatchDenom: batchDenom, Quantity: "10", AskPrice: &ask, Expiration: &expir},
},
Expand All @@ -95,4 +98,4 @@ func TestSell_CancelOrderInvalid(t *testing.T) {
SellOrderId: res.SellOrderIds[0],
})
assert.ErrorContains(t, err, sdkerrors.ErrUnauthorized.Error())
}
}

0 comments on commit 4bacfdb

Please sign in to comment.