Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(marketplace): Buy ORM #899

Merged
merged 64 commits into from
Mar 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
85c713e
feat(wip): marketplace Sell ORM
technicallyty Mar 10, 2022
a6f0bcc
Merge branch 'master' into ty/856-marketplace_ORM
technicallyty Mar 10, 2022
2644c5d
feat: sell
technicallyty Mar 10, 2022
531376d
refactor: move general utils
technicallyty Mar 10, 2022
356e511
feat: create market if not found
technicallyty Mar 10, 2022
8f768ad
chore: comments
technicallyty Mar 10, 2022
e4a818e
chore: remove iface guard comment
technicallyty Mar 10, 2022
23804d1
wip
technicallyty Mar 11, 2022
cfcd8f1
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 11, 2022
97244db
wip
technicallyty Mar 12, 2022
501ed4d
feat: escrow credits
technicallyty Mar 12, 2022
cb104de
fix: revert mock times
technicallyty Mar 12, 2022
0ed55f4
fix: typo
technicallyty Mar 12, 2022
d8957d0
Merge branch 'ty/821-escrow' into ty/856-buy_orm
technicallyty Mar 12, 2022
e81fef4
feat: balance update method
technicallyty Mar 12, 2022
1f901eb
chore: add event emission to sell
technicallyty Mar 12, 2022
863aa05
chore: test setup
technicallyty Mar 12, 2022
ad01737
fix: assert precision of sell order qty
technicallyty Mar 12, 2022
c124478
feat: more tests
technicallyty Mar 12, 2022
bf710e3
wip: prune
technicallyty Mar 14, 2022
d9576a8
feat: pruning
technicallyty Mar 14, 2022
cf7f9d3
chore: fmt.Errorf -> sdkerrors.ErrInvalidRequest
technicallyty Mar 15, 2022
06f65b7
Merge branch 'master' into ty/821-escrow
technicallyty Mar 15, 2022
70d0d40
Merge branch 'master' into ty/821-escrow
technicallyty Mar 15, 2022
4a52730
Merge branch 'ty/821-escrow' into ty/856-buy_orm
technicallyty Mar 15, 2022
a0291b9
chore: cleanup
technicallyty Mar 15, 2022
2ae117c
chore: add invalid test
technicallyty Mar 15, 2022
95a48c4
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 16, 2022
a809dc2
chore: add events
technicallyty Mar 16, 2022
3b8bfde
chore: go fmt
technicallyty Mar 16, 2022
0dd8475
chore: godoc
technicallyty Mar 16, 2022
0290e19
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 16, 2022
497e19a
chore: revert, comments, cleanup
technicallyty Mar 16, 2022
6c52726
chore: address review comments
technicallyty Mar 17, 2022
bb2f9ef
Update x/ecocredit/server/marketplace/buy.go
technicallyty Mar 17, 2022
cbce516
chore: add test
technicallyty Mar 17, 2022
d93ae80
Merge branch 'ty/856-buy_orm' of https://github.com/regen-network/reg…
technicallyty Mar 17, 2022
5012b5e
chore: tidy imports
technicallyty Mar 17, 2022
89f21d8
Update x/ecocredit/server/marketplace/buy.go
technicallyty Mar 17, 2022
97c7676
Update x/ecocredit/server/marketplace/buy.go
technicallyty Mar 17, 2022
668a495
Merge branch 'ty/856-buy_orm' of https://github.com/regen-network/reg…
technicallyty Mar 17, 2022
81d2c29
Update x/ecocredit/server/marketplace/buy_test.go
technicallyty Mar 17, 2022
f93417a
Update x/ecocredit/server/marketplace/buy_test.go
technicallyty Mar 17, 2022
813b04d
Update x/ecocredit/server/marketplace/buy_test.go
technicallyty Mar 17, 2022
73ae70b
chore: review comments
technicallyty Mar 17, 2022
d714593
Merge branch 'ty/856-buy_orm' of https://github.com/regen-network/reg…
technicallyty Mar 17, 2022
7aee047
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 17, 2022
3993ab9
Update x/ecocredit/server/marketplace/buy.go
technicallyty Mar 29, 2022
cfcec78
chore: ErrInvalidRequest -> ErrIO
technicallyty Mar 29, 2022
6241556
Update x/ecocredit/server/marketplace/buy.go
technicallyty Mar 29, 2022
3164bdf
Merge branch 'ty/856-buy_orm' of https://github.com/regen-network/reg…
technicallyty Mar 29, 2022
52580a3
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 29, 2022
63ff796
chore: refactor purchase logic
technicallyty Mar 29, 2022
933449a
chore: fix conflicts
technicallyty Mar 29, 2022
48c2a72
fix: use correct error
technicallyty Mar 29, 2022
eb715aa
fix: charge correct amount of coins
technicallyty Mar 29, 2022
4e7d6ce
fix: check the coin send amount in test
technicallyty Mar 29, 2022
8f227d7
chore: address review
technicallyty Mar 30, 2022
3569f0f
Update x/ecocredit/server/marketplace/buy.go
technicallyty Mar 30, 2022
94520db
chore: update tests
technicallyty Mar 30, 2022
ec9804e
chore: cleanup error message
technicallyty Mar 30, 2022
f198a7c
chore: update error in test
technicallyty Mar 30, 2022
1c317da
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 30, 2022
591a4a4
Merge branch 'master' into ty/856-buy_orm
technicallyty Mar 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: add event emission to sell
  • Loading branch information
technicallyty committed Mar 12, 2022
commit 1f901eba2ab8c5cf826785f051773b02f64774ce
10 changes: 10 additions & 0 deletions x/ecocredit/server/marketplace/sell.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ func (k Keeper) Sell(ctx context.Context, req *marketplacev1.MsgSell) (*marketpl
}
sellOrderIds[i] = id
sdkCtx.GasMeter().ConsumeGas(gasCostPerIteration, "create sell order")
if err = sdkCtx.EventManager().EmitTypedEvent(&marketplacev1.EventSell{
OrderId: id,
BatchDenom: batch.BatchDenom,
Quantity: order.Quantity,
AskPrice: order.AskPrice,
DisableAutoRetire: order.DisableAutoRetire,
Expiration: order.Expiration,
}); err != nil {
return nil, err
}
}
return &marketplacev1.MsgSellResponse{SellOrderIds: sellOrderIds}, nil
}
Expand Down