Skip to content

Commit

Permalink
Merge branch 'main' into aaronc/ipfs-resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc authored Mar 14, 2024
2 parents be0f559 + 5fb7e60 commit 1d53b64
Show file tree
Hide file tree
Showing 36 changed files with 3,883 additions and 703 deletions.
431 changes: 386 additions & 45 deletions api/regen/ecocredit/marketplace/v1/events.pulsar.go

Large diffs are not rendered by default.

1,881 changes: 1,502 additions & 379 deletions api/regen/ecocredit/marketplace/v1/tx.pulsar.go

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ import (
datamodule "github.com/regen-network/regen-ledger/x/data/v3/module"
"github.com/regen-network/regen-ledger/x/ecocredit/v3"
baskettypes "github.com/regen-network/regen-ledger/x/ecocredit/v3/basket"
"github.com/regen-network/regen-ledger/x/ecocredit/v3/marketplace"
ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/v3/module"
"github.com/regen-network/regen-ledger/x/intertx"
intertxkeeper "github.com/regen-network/regen-ledger/x/intertx/keeper"
Expand Down Expand Up @@ -191,6 +192,7 @@ var (
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ecocredit.ModuleName: {authtypes.Burner},
baskettypes.BasketSubModuleName: {authtypes.Burner, authtypes.Minter},
marketplace.FeePoolName: {authtypes.Burner},
}

return perms
Expand Down
16 changes: 16 additions & 0 deletions proto/regen/ecocredit/marketplace/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package regen.ecocredit.marketplace.v1;

import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/types/v1";

// EventSell is an event emitted when a sell order is created.
Expand All @@ -17,6 +19,20 @@ message EventBuyDirect {
// sell_order_id is the unique identifier of the sell order that credits were
// purchased from.
uint64 sell_order_id = 1;

// seller is the address of the account that sold the credits.
string seller = 2;

// seller_fee_paid is the amount of coins paid by the seller
// to the marketplace as a fee for facilitating the sale.
cosmos.base.v1beta1.Coin seller_fee_paid = 3;

// buyer is the address of the account that purchased the credits.
string buyer = 4;

// buyer_fee_paid is the amount of coins paid by the buyer
// to the marketplace as a fee for facilitating the sale.
cosmos.base.v1beta1.Coin buyer_fee_paid = 5;
}

// EventUpdateSellOrder is an event emitted when a sell order is updated.
Expand Down
36 changes: 30 additions & 6 deletions proto/regen/ecocredit/marketplace/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package regen.ecocredit.marketplace.v1;

import "cosmos/base/v1beta1/coin.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "regen/ecocredit/marketplace/v1/state.proto";
Expand Down Expand Up @@ -44,6 +43,14 @@ service Msg {
// Since Revision 3
rpc GovSetFeeParams(MsgGovSetFeeParams)
returns (MsgGovSetFeeParamsResponse);

// GovSendFromFeePool is a governance method that allows the sending of the
// marketplace fees.
//
// Since Revision 3
rpc GovSendFromFeePool(MsgGovSendFromFeePool)
returns (MsgGovSendFromFeePoolResponse);

}

// MsgSell is the Msg/Sell request type.
Expand Down Expand Up @@ -185,13 +192,10 @@ message MsgBuyDirect {

// max_fee_amount is the maximum amount of buyer side fees being paid to the marketplace.
// If the marketplace fees end up being greater than this amount, the transaction will fail.
// If this field is left empty, the marketplace fees will be calculated based on the bid price
// and quantity and automatically deducted from the buyer's account.
// Fees are always paid in the same denomination as the bid price and max fee amount should
// be an integer value of that denom.
// Fees are always paid in the same denomination as the bid price.
//
// Since Revision 3
string max_fee_amount = 8 [(cosmos_proto.scalar) = "cosmos.Int"];
cosmos.base.v1beta1.Coin max_fee_amount = 8;

Check failure on line 198 in proto/regen/ecocredit/marketplace/v1/tx.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "8" on message "Order" changed type from "string" to "message".
}
}

Expand Down Expand Up @@ -255,3 +259,23 @@ message MsgGovSetFeeParams {

// MsgSetFeeParamsResponse is the Msg/SetFeeParams response type.
message MsgGovSetFeeParamsResponse {}

// MsgSendFromFeePool is the Msg/SendFromFeePool request type.
message MsgGovSendFromFeePool {
option (cosmos.msg.v1.signer) = "authority";

// authority is the address of the governance account.
string authority = 1;

// recipient is the address of the account that will receive the funds.
string recipient = 2;

// coins is the amount of coins to send from the fee pool.
repeated cosmos.base.v1beta1.Coin coins = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}

// MsgSendFromFeePoolResponse is the Msg/SendFromFeePool response type.
message MsgGovSendFromFeePoolResponse {}
Loading

0 comments on commit 1d53b64

Please sign in to comment.