diff --git a/go.mod b/go.mod
index 3398c58dc6..d27fac0169 100644
--- a/go.mod
+++ b/go.mod
@@ -17,8 +17,8 @@ require (
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.14
github.com/tendermint/tm-db v0.6.6
- golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2 // indirect
- google.golang.org/genproto v0.0.0-20220210181026-6fee9acbd336 // indirect
+ golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
+ google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect
)
require (
@@ -111,7 +111,7 @@ require (
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
- github.com/regen-network/regen-ledger/api v0.6.0 // indirect
+ github.com/regen-network/regen-ledger/api v0.8.0 // indirect
github.com/regen-network/regen-ledger/orm v1.0.0-beta1 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
@@ -129,7 +129,7 @@ require (
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
- golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect
+ 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
google.golang.org/grpc v1.44.0 // indirect
diff --git a/go.sum b/go.sum
index 4a28c754a1..e4066e66bc 100644
--- a/go.sum
+++ b/go.sum
@@ -914,8 +914,8 @@ github.com/regen-network/cosmos-sdk v0.44.2-regen-1 h1:Sm7rU4rMwLpEpgrQkF/4w/V/y
github.com/regen-network/cosmos-sdk v0.44.2-regen-1/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU80QCZUPnHr4=
github.com/regen-network/protobuf v1.3.2-alpha.regen.4 h1:c9jEnU+xm6vqyrQe3M94UFWqiXxRIKKnqBOh2EACmBE=
github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQDLUaq15LjNE83nRzkyrLAMcPewig=
-github.com/regen-network/regen-ledger/api v0.6.0 h1:Wsr+zWimB/i9wYM8q4ffU8qn38AldbYjDe0lhQ9n8VU=
-github.com/regen-network/regen-ledger/api v0.6.0/go.mod h1:kWly2pK0u3fDfyoYYilpEoTEg61pCjV/f5XSY0KzJQY=
+github.com/regen-network/regen-ledger/api v0.8.0 h1:Aovi26UTimyOoInl8xyE99Y3TE70P3CWr0t569KpFN0=
+github.com/regen-network/regen-ledger/api v0.8.0/go.mod h1:kWly2pK0u3fDfyoYYilpEoTEg61pCjV/f5XSY0KzJQY=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
@@ -1151,8 +1151,8 @@ golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWP
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2 h1:XdAboW3BNMv9ocSCOk/u1MFioZGzCNkiJZ19v9Oe3Ig=
-golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE=
+golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1354,8 +1354,9 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw=
+golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -1563,8 +1564,8 @@ google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220210181026-6fee9acbd336 h1:RK2ysGpQApbI6U7xn+ROT2rrm08lE/t8AcGqG8XI1CY=
-google.golang.org/genproto v0.0.0-20220210181026-6fee9acbd336/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf h1:SVYXkUz2yZS9FWb2Gm8ivSlbNQzL2Z/NpPKE3RG2jWk=
+google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
diff --git a/proto/regen/ecocredit/basket/v1/query.proto b/proto/regen/ecocredit/basket/v1/query.proto
index 6c42331b8b..462b1eeb73 100644
--- a/proto/regen/ecocredit/basket/v1/query.proto
+++ b/proto/regen/ecocredit/basket/v1/query.proto
@@ -3,7 +3,7 @@ syntax = "proto3";
package regen.ecocredit.basket.v1;
import "google/api/annotations.proto";
-import "regen/ecocredit/basket/v1/state.proto";
+import "regen/ecocredit/basket/v1/types.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/basket";
@@ -46,6 +46,9 @@ message QueryBasketRequest {
message QueryBasketResponse {
// basket is the queried basket.
Basket basket = 1;
+
+ // classes are the credit classes that can be deposited in the basket.
+ repeated string classes = 2;
}
// QueryBasketsRequest is the Query/Baskets request type.
diff --git a/proto/regen/ecocredit/basket/v1/types.proto b/proto/regen/ecocredit/basket/v1/types.proto
index 83f0529769..86b6e22b56 100644
--- a/proto/regen/ecocredit/basket/v1/types.proto
+++ b/proto/regen/ecocredit/basket/v1/types.proto
@@ -37,3 +37,46 @@ message DateCriteria {
// At most only one of `start_date_window` and `min_start_date` can be set.
google.protobuf.Duration start_date_window = 2;
}
+
+// Basket represents a basket in state.
+message Basket {
+ // id is the uint64 ID of the basket. It is used internally for reducing
+ // storage space.
+ uint64 id = 1;
+
+ // basket_denom is the basket bank denom.
+ string basket_denom = 2;
+
+ // name is the unique name of the basket specified in MsgCreate. Basket
+ // names must be unique across all credit types and choices of exponent
+ // above and beyond the uniqueness constraint on basket_denom.
+ string name = 3;
+
+ // disable_auto_retire indicates whether or not the credits will be retired upon withdraw from the basket.
+ bool disable_auto_retire = 4;
+
+ // credit_type_abbrev is the abbreviation of the credit type this basket is able to hold.
+ string credit_type_abbrev = 5;
+
+ // date_criteria is the date criteria for batches admitted to the basket.
+ DateCriteria date_criteria = 6;
+
+ // exponent is the exponent for converting credits to/from basket tokens.
+ uint32 exponent = 7;
+}
+
+// BasketBalance stores the amount of credits from a batch in a basket
+message BasketBalance {
+ // basket_id is the ID of the basket
+ uint64 basket_id = 1;
+
+ // batch_denom is the denom of the credit batch
+ string batch_denom = 2;
+
+ // balance is the amount of ecocredits held in the basket
+ string balance = 3;
+
+ // batch_start_date is the start date of the batch. This field is used
+ // to create an index which is used to remove the oldest credits first.
+ google.protobuf.Timestamp batch_start_date = 4;
+}
diff --git a/x/basket/spec/protobuf.md b/x/basket/spec/protobuf.md
index 3d67a8d288..b97033c971 100644
--- a/x/basket/spec/protobuf.md
+++ b/x/basket/spec/protobuf.md
@@ -5,9 +5,28 @@
## Table of Contents
- [regen/ecocredit/basket/v1/types.proto](#regen/ecocredit/basket/v1/types.proto)
+ - [Basket](#regen.ecocredit.basket.v1.Basket)
+ - [BasketBalance](#regen.ecocredit.basket.v1.BasketBalance)
- [BasketCredit](#regen.ecocredit.basket.v1.BasketCredit)
- [DateCriteria](#regen.ecocredit.basket.v1.DateCriteria)
+- [regen/ecocredit/basket/v1/events.proto](#regen/ecocredit/basket/v1/events.proto)
+ - [EventCreate](#regen.ecocredit.basket.v1.EventCreate)
+ - [EventPut](#regen.ecocredit.basket.v1.EventPut)
+ - [EventTake](#regen.ecocredit.basket.v1.EventTake)
+
+- [regen/ecocredit/basket/v1/query.proto](#regen/ecocredit/basket/v1/query.proto)
+ - [QueryBasketBalanceRequest](#regen.ecocredit.basket.v1.QueryBasketBalanceRequest)
+ - [QueryBasketBalanceResponse](#regen.ecocredit.basket.v1.QueryBasketBalanceResponse)
+ - [QueryBasketBalancesRequest](#regen.ecocredit.basket.v1.QueryBasketBalancesRequest)
+ - [QueryBasketBalancesResponse](#regen.ecocredit.basket.v1.QueryBasketBalancesResponse)
+ - [QueryBasketRequest](#regen.ecocredit.basket.v1.QueryBasketRequest)
+ - [QueryBasketResponse](#regen.ecocredit.basket.v1.QueryBasketResponse)
+ - [QueryBasketsRequest](#regen.ecocredit.basket.v1.QueryBasketsRequest)
+ - [QueryBasketsResponse](#regen.ecocredit.basket.v1.QueryBasketsResponse)
+
+ - [Query](#regen.ecocredit.basket.v1.Query)
+
- [regen/ecocredit/basket/v1/tx.proto](#regen/ecocredit/basket/v1/tx.proto)
- [MsgCreate](#regen.ecocredit.basket.v1.MsgCreate)
- [MsgCreateResponse](#regen.ecocredit.basket.v1.MsgCreateResponse)
@@ -29,6 +48,45 @@
+
+
+### Basket
+Basket represents a basket in state.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| id | [uint64](#uint64) | | id is the uint64 ID of the basket. It is used internally for reducing storage space. |
+| basket_denom | [string](#string) | | basket_denom is the basket bank denom. |
+| name | [string](#string) | | name is the unique name of the basket specified in MsgCreate. Basket names must be unique across all credit types and choices of exponent above and beyond the uniqueness constraint on basket_denom. |
+| disable_auto_retire | [bool](#bool) | | disable_auto_retire indicates whether or not the credits will be retired upon withdraw from the basket. |
+| credit_type_abbrev | [string](#string) | | credit_type_abbrev is the abbreviation of the credit type this basket is able to hold. |
+| date_criteria | [DateCriteria](#regen.ecocredit.basket.v1.DateCriteria) | | date_criteria is the date criteria for batches admitted to the basket. |
+| exponent | [uint32](#uint32) | | exponent is the exponent for converting credits to/from basket tokens. |
+
+
+
+
+
+
+
+
+### BasketBalance
+BasketBalance stores the amount of credits from a batch in a basket
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| basket_id | [uint64](#uint64) | | basket_id is the ID of the basket |
+| batch_denom | [string](#string) | | batch_denom is the denom of the credit batch |
+| balance | [string](#string) | | balance is the amount of ecocredits held in the basket |
+| batch_start_date | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | batch_start_date is the start date of the batch. This field is used to create an index which is used to remove the oldest credits first. |
+
+
+
+
+
+
### BasketCredit
@@ -48,13 +106,17 @@ BasketCredit represents the information for a credit batch inside a basket.
### DateCriteria
-DateCriteria represents a basket credit batch date criteria.
+DateCriteria represents the information for credit acceptance in a basket.
+At most, only one of the values should be set.
+NOTE: gogo proto `oneof` is not compatible with Amino signing, hence we directly define
+both `start_date_window` and `min_start_date`. In the future, with pulsar, this should change
+and we should use `oneof`.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| min_start_date | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | min_start_date is the earliest start date for batches of credits allowed into the basket. |
-| start_date_window | [google.protobuf.Duration](#google.protobuf.Duration) | | start_date_window is a duration of time measured into the past which sets a cutoff for batch start dates when adding new credits to the basket. Based on the current block timestamp, credits whose start date is before `block_timestamp - batch_date_window` will not be allowed into the basket. |
+| min_start_date | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | min_start_date (optional) is the earliest start date for batches of credits allowed into the basket. At most only one of `start_date_window` and `min_start_date` can be set. |
+| start_date_window | [google.protobuf.Duration](#google.protobuf.Duration) | | start_date_window (optional) is a duration of time measured into the past which sets a cutoff for batch start dates when adding new credits to the basket. Based on the current block timestamp, credits whose start date is before `block_timestamp - batch_date_window` will not be allowed into the basket. At most only one of `start_date_window` and `min_start_date` can be set. |
@@ -70,6 +132,230 @@ DateCriteria represents a basket credit batch date criteria.
+
+
Top
+
+## regen/ecocredit/basket/v1/events.proto
+
+
+
+
+
+### EventCreate
+EventCreate is an event emitted when a basket is created.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| basket_denom | [string](#string) | | basket_denom is the basket bank denom. |
+| curator | [string](#string) | | curator is the address of the basket curator who is able to change certain basket settings. |
+
+
+
+
+
+
+
+
+### EventPut
+EventPut is an event emitted when credits are put into a basket in return
+for basket tokens.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| owner | [string](#string) | | owner is the owner of the credits put into the basket. |
+| basket_denom | [string](#string) | | basket_denom is the basket bank denom that the credits were added to. |
+| credits | [BasketCredit](#regen.ecocredit.basket.v1.BasketCredit) | repeated | credits are the credits that were added to the basket. |
+| amount | [string](#string) | | amount is the integer number of basket tokens converted from credits. |
+
+
+
+
+
+
+
+
+### EventTake
+EventTake is an event emitted when credits are taken from a basket starting
+from the oldest credits first.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| owner | [string](#string) | | owner is the owner of the credits taken from the basket. |
+| basket_denom | [string](#string) | | basket_denom is the basket bank denom that credits were taken from. |
+| credits | [BasketCredit](#regen.ecocredit.basket.v1.BasketCredit) | repeated | credits are the credits that were taken from the basket. |
+| amount | [string](#string) | | amount is the integer number of basket tokens converted to credits. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Top
+
+## regen/ecocredit/basket/v1/query.proto
+
+
+
+
+
+### QueryBasketBalanceRequest
+QueryBasketBalanceRequest is the Query/BasketBalance request type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| basket_denom | [string](#string) | | basket_denom is the denom of the basket. |
+| batch_denom | [string](#string) | | batch_denom is the denom of the credit batch. |
+
+
+
+
+
+
+
+
+### QueryBasketBalanceResponse
+QueryBasketBalanceResponse is the Query/BasketBalance response type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| balance | [string](#string) | | balance is the amount of the queried credit batch in the basket. |
+
+
+
+
+
+
+
+
+### QueryBasketBalancesRequest
+QueryBasketBalancesRequest is the Query/BasketBalances request type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| basket_denom | [string](#string) | | basket_denom is the denom of the basket. |
+| pagination | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
+
+
+
+
+
+
+
+
+### QueryBasketBalancesResponse
+QueryBasketBalancesResponse is the Query/BasketBalances response type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| balances | [BasketBalance](#regen.ecocredit.basket.v1.BasketBalance) | repeated | balances is a list of credit balances in the basket. |
+| pagination | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
+
+
+
+
+
+
+
+
+### QueryBasketRequest
+QueryBasketRequest is the Query/Basket request type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| basket_denom | [string](#string) | | basket_denom represents the denom of the basket to query. |
+
+
+
+
+
+
+
+
+### QueryBasketResponse
+QueryBasketResponse is the Query/Basket response type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| basket | [Basket](#regen.ecocredit.basket.v1.Basket) | | basket is the queried basket. |
+| classes | [string](#string) | repeated | classes are the credit classes that can be deposited in the basket. |
+
+
+
+
+
+
+
+
+### QueryBasketsRequest
+QueryBasketsRequest is the Query/Baskets request type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| pagination | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
+
+
+
+
+
+
+
+
+### QueryBasketsResponse
+QueryBasketsResponse is the Query/Baskets response type.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| baskets | [Basket](#regen.ecocredit.basket.v1.Basket) | repeated | baskets are the fetched baskets. |
+| pagination | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Query
+Msg is the regen.ecocredit.basket.v1beta1 Query service.
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| Basket | [QueryBasketRequest](#regen.ecocredit.basket.v1.QueryBasketRequest) | [QueryBasketResponse](#regen.ecocredit.basket.v1.QueryBasketResponse) | Basket queries one basket by denom. |
+| Baskets | [QueryBasketsRequest](#regen.ecocredit.basket.v1.QueryBasketsRequest) | [QueryBasketsResponse](#regen.ecocredit.basket.v1.QueryBasketsResponse) | Baskets lists all baskets in the ecocredit module. |
+| BasketBalances | [QueryBasketBalancesRequest](#regen.ecocredit.basket.v1.QueryBasketBalancesRequest) | [QueryBasketBalancesResponse](#regen.ecocredit.basket.v1.QueryBasketBalancesResponse) | BasketBalances lists the balance of each credit batch in the basket. |
+| BasketBalance | [QueryBasketBalanceRequest](#regen.ecocredit.basket.v1.QueryBasketBalanceRequest) | [QueryBasketBalanceResponse](#regen.ecocredit.basket.v1.QueryBasketBalanceResponse) | BasketBalance queries the balance of a specific credit batch in the basket. |
+
+
+
+
+
Top
@@ -80,19 +366,23 @@ DateCriteria represents a basket credit batch date criteria.
### MsgCreate
-MsgCreateBasket is the Msg/CreateBasket request type.
+MsgCreate is the Msg/Create request type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| curator | [string](#string) | | curator is the address of the basket curator who is able to change certain basket settings. |
-| name | [string](#string) | | name will be used to create a bank denom for this basket token. |
-| display_name | [string](#string) | | display_name will be used to create a bank Metadata display name for this basket token. |
-| exponent | [uint32](#uint32) | | exponent is the exponent that will be used for converting credits to basket tokens and for bank denom metadata. It also limits the precision of credit amounts when putting credits into a basket. An exponent of 6 will mean that 10^6 units of a basket token will be issued for 1.0 credits and that this should be displayed as one unit in user interfaces. It also means that the maximum precision of credit amounts is 6 decimal places so that the need to round is eliminated. The exponent must be >= the precision of the credit type at the time the basket is created. |
+| name | [string](#string) | | name will be used to together with prefix to create a bank denom for this basket token. It can be between 3-8 alphanumeric characters, with the first character being alphabetic.
+
+The bank denom will be formed from name, credit type and exponent and be of the form `eco..` where prefix is derived from exponent. |
+| description | [string](#string) | | description is a human-readable description of the basket denom that should be at most 256 characters. |
+| exponent | [uint32](#uint32) | | exponent is the exponent that will be used for converting credits to basket tokens and for bank denom metadata. It also limits the precision of credit amounts when putting credits into a basket. An exponent of 6 will mean that 10^6 units of a basket token will be issued for 1.0 credits and that this should be displayed as one unit in user interfaces. It also means that the maximum precision of credit amounts is 6 decimal places so that the need to round is eliminated. The exponent must be >= the precision of the credit type at the time the basket is created and be of one of the following values 0, 1, 2, 3, 6, 9, 12, 15, 18, 21, or 24 which correspond to the exponents which have an official SI prefix.
+
+The exponent will be used to form the prefix part of the bank denom and will be mapped as follows: 0 - no prefix 1 - d (deci) 2 - c (centi) 3 - m (milli) 6 - u (micro) 9 - n (nano) 12 - p (pico) 15 - f (femto) 18 - a (atto) 21 - z (zepto) 24 - y (yocto) |
| disable_auto_retire | [bool](#bool) | | disable_auto_retire allows auto-retirement to be disabled. The credits will be auto-retired if disable_auto_retire is false unless the credits were previously put into the basket by the address picking them from the basket, in which case they will remain tradable. |
-| credit_type_name | [string](#string) | | credit_type_name filters against credits from this credit type name. |
+| credit_type_abbrev | [string](#string) | | credit_type_abbrev is the abbreviation of the credit type this basket is able to hold. |
| allowed_classes | [string](#string) | repeated | allowed_classes are the credit classes allowed to be put in the basket |
-| date_criteria | [DateCriteria](#regen.ecocredit.basket.v1.DateCriteria) | | date_criteria is the date criteria for batches admitted to the basket. |
+| date_criteria | [DateCriteria](#regen.ecocredit.basket.v1.DateCriteria) | | date_criteria is the date criteria for batches admitted to the basket. At most, only one of the fields in the date_criteria should be set. |
| fee | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | fee is the fee that the curator will pay to create the basket. It must be >= the required Params.basket_creation_fee. We include the fee explicitly here so that the curator explicitly acknowledges paying this fee and is not surprised to learn that the paid a big fee and didn't know beforehand. |
@@ -103,7 +393,7 @@ MsgCreateBasket is the Msg/CreateBasket request type.
### MsgCreateResponse
-MsgCreateBasketResponse is the Msg/CreateBasket response type.
+MsgCreateResponse is the Msg/Create response type.
| Field | Type | Label | Description |
@@ -118,7 +408,7 @@ MsgCreateBasketResponse is the Msg/CreateBasket response type.
### MsgPut
-MsgAddToBasket is the Msg/AddToBasket request type.
+MsgPut is the Msg/Put request type.
| Field | Type | Label | Description |
@@ -135,7 +425,7 @@ MsgAddToBasket is the Msg/AddToBasket request type.
### MsgPutResponse
-MsgAddToBasketResponse is the Msg/AddToBasket response type.
+MsgPutResponse is the Msg/Put response type.
| Field | Type | Label | Description |
@@ -150,13 +440,13 @@ MsgAddToBasketResponse is the Msg/AddToBasket response type.
### MsgTake
-MsgTakeFromBasket is the Msg/TakeFromBasket request type.
+MsgTake is the Msg/Take request type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| owner | [string](#string) | | owner is the owner of the basket tokens. |
-| basket_denom | [string](#string) | | basket_denom is the basket denom to take credits from. |
+| basket_denom | [string](#string) | | basket_denom is the basket bank denom to take credits from. |
| amount | [string](#string) | | amount is the integer number of basket tokens to convert into credits. |
| retirement_location | [string](#string) | | retirement_location is the optional retirement location for the credits which will be used only if retire_on_take is true for this basket. |
| retire_on_take | [bool](#bool) | | retire_on_take is a boolean that dictates whether the ecocredits received in exchange for the basket tokens will be received as retired or tradable credits. |
@@ -169,7 +459,7 @@ MsgTakeFromBasket is the Msg/TakeFromBasket request type.
### MsgTakeResponse
-MsgTakeFromBasketResponse is the Msg/TakeFromBasket response type.
+MsgTakeResponse is the Msg/Take response type.
| Field | Type | Label | Description |
diff --git a/x/ecocredit/basket/events.pb.go b/x/ecocredit/basket/events.pb.go
index 8d68ee5f11..78d2e79a32 100644
--- a/x/ecocredit/basket/events.pb.go
+++ b/x/ecocredit/basket/events.pb.go
@@ -599,7 +599,10 @@ func (m *EventCreate) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
@@ -779,7 +782,10 @@ func (m *EventPut) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
@@ -959,7 +965,10 @@ func (m *EventTake) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
diff --git a/x/ecocredit/basket/query.pb.go b/x/ecocredit/basket/query.pb.go
index 7a10cb11c4..9de4c077f3 100644
--- a/x/ecocredit/basket/query.pb.go
+++ b/x/ecocredit/basket/query.pb.go
@@ -79,6 +79,8 @@ func (m *QueryBasketRequest) GetBasketDenom() string {
type QueryBasketResponse struct {
// basket is the queried basket.
Basket *Basket `protobuf:"bytes,1,opt,name=basket,proto3" json:"basket,omitempty"`
+ // classes are the credit classes that can be deposited in the basket.
+ Classes []string `protobuf:"bytes,2,rep,name=classes,proto3" json:"classes,omitempty"`
}
func (m *QueryBasketResponse) Reset() { *m = QueryBasketResponse{} }
@@ -121,6 +123,13 @@ func (m *QueryBasketResponse) GetBasket() *Basket {
return nil
}
+func (m *QueryBasketResponse) GetClasses() []string {
+ if m != nil {
+ return m.Classes
+ }
+ return nil
+}
+
// QueryBasketsRequest is the Query/Baskets request type.
type QueryBasketsRequest struct {
// pagination defines an optional pagination for the request.
@@ -449,44 +458,45 @@ func init() {
}
var fileDescriptor_a83a50529e6be723 = []byte{
- // 585 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xbf, 0x6f, 0xd3, 0x4e,
- 0x18, 0xc6, 0x73, 0xf9, 0xaa, 0xe9, 0x97, 0x0b, 0x30, 0x1c, 0x0c, 0xa9, 0x41, 0xa6, 0xb5, 0xf8,
- 0x51, 0x55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2, 0xf0, 0x04, 0x3d, 0x3e, 0xbf, 0x85, 0xb8,
+ 0x3e, 0xbe, 0x93, 0xc3, 0xa6, 0xfb, 0x75, 0x68, 0x83, 0xa3, 0xa1, 0x0d, 0x7e, 0x0d, 0x6d, 0xf0,
+ 0x6e, 0x64, 0x17, 0x8e, 0x46, 0x76, 0xe1, 0xc7, 0xc8, 0x2e, 0x3c, 0xbb, 0x1b, 0xb4, 0xe5, 0x6e,
+ 0xdf, 0xc3, 0x3e, 0xef, 0xea, 0x69, 0x2b, 0x21, 0x93, 0x2f, 0x79, 0xb4, 0x67, 0x5e, 0x1d, 0xd6,
+ 0x0a, 0x58, 0x44, 0x5e, 0x4d, 0x89, 0xf0, 0x4a, 0xea, 0xe7, 0x6a, 0xed, 0x4f, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xc4, 0x84, 0xc3, 0x22, 0x63, 0x07, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -735,6 +745,15 @@ func (m *QueryBasketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.Classes) > 0 {
+ for iNdEx := len(m.Classes) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Classes[iNdEx])
+ copy(dAtA[i:], m.Classes[iNdEx])
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Classes[iNdEx])))
+ i--
+ dAtA[i] = 0x12
+ }
+ }
if m.Basket != nil {
{
size, err := m.Basket.MarshalToSizedBuffer(dAtA[:i])
@@ -1026,6 +1045,12 @@ func (m *QueryBasketResponse) Size() (n int) {
l = m.Basket.Size()
n += 1 + l + sovQuery(uint64(l))
}
+ if len(m.Classes) > 0 {
+ for _, s := range m.Classes {
+ l = len(s)
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ }
return n
}
@@ -1200,7 +1225,10 @@ func (m *QueryBasketRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1280,13 +1308,48 @@ func (m *QueryBasketResponse) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Classes", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Classes = append(m.Classes, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1372,7 +1435,10 @@ func (m *QueryBasketsRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1492,7 +1558,10 @@ func (m *QueryBasketsResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1610,7 +1679,10 @@ func (m *QueryBasketBalancesRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1730,7 +1802,10 @@ func (m *QueryBasketBalancesResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1844,7 +1919,10 @@ func (m *QueryBasketBalanceRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -1926,7 +2004,10 @@ func (m *QueryBasketBalanceResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
diff --git a/x/ecocredit/basket/query.pb.gw.go b/x/ecocredit/basket/query.pb.gw.go
index 210400ead3..4a8578bbfe 100644
--- a/x/ecocredit/basket/query.pb.gw.go
+++ b/x/ecocredit/basket/query.pb.gw.go
@@ -20,7 +20,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
- "google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
@@ -31,7 +30,6 @@ var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
-var _ = metadata.Join
func request_Query_Basket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBasketRequest
@@ -274,14 +272,12 @@ func local_request_Query_BasketBalance_0(ctx context.Context, marshaler runtime.
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
-// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
+// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
mux.Handle("GET", pattern_Query_Basket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
- var stream runtime.ServerTransportStream
- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
@@ -289,7 +285,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return
}
resp, md, err := local_request_Query_Basket_0(rctx, inboundMarshaler, server, req, pathParams)
- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@@ -303,8 +298,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
mux.Handle("GET", pattern_Query_Baskets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
- var stream runtime.ServerTransportStream
- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
@@ -312,7 +305,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return
}
resp, md, err := local_request_Query_Baskets_0(rctx, inboundMarshaler, server, req, pathParams)
- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@@ -326,8 +318,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
mux.Handle("GET", pattern_Query_BasketBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
- var stream runtime.ServerTransportStream
- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
@@ -335,7 +325,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return
}
resp, md, err := local_request_Query_BasketBalances_0(rctx, inboundMarshaler, server, req, pathParams)
- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@@ -349,8 +338,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
mux.Handle("GET", pattern_Query_BasketBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
- var stream runtime.ServerTransportStream
- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
@@ -358,7 +345,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return
}
resp, md, err := local_request_Query_BasketBalance_0(rctx, inboundMarshaler, server, req, pathParams)
- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@@ -494,13 +480,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
- pattern_Query_Basket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"regen", "ecocredit", "basket", "v1", "baskets", "basket_denom"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_Basket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"regen", "ecocredit", "basket", "v1", "baskets", "basket_denom"}, "", runtime.AssumeColonVerbOpt(true)))
- pattern_Query_Baskets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"regen", "ecocredit", "basket", "v1", "baskets"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_Baskets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"regen", "ecocredit", "basket", "v1", "baskets"}, "", runtime.AssumeColonVerbOpt(true)))
- pattern_Query_BasketBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"regen", "ecocredit", "basket", "v1", "baskets", "basket_denom", "balances"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_BasketBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"regen", "ecocredit", "basket", "v1", "baskets", "basket_denom", "balances"}, "", runtime.AssumeColonVerbOpt(true)))
- pattern_Query_BasketBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"regen", "ecocredit", "basket", "v1", "baskets", "basket_denom", "balances", "batch_denom"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_BasketBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"regen", "ecocredit", "basket", "v1", "baskets", "basket_denom", "balances", "batch_denom"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
diff --git a/x/ecocredit/basket/state.pb.go b/x/ecocredit/basket/state.pb.go
index 1a92af70a4..c111795884 100644
--- a/x/ecocredit/basket/state.pb.go
+++ b/x/ecocredit/basket/state.pb.go
@@ -5,12 +5,8 @@ package basket
import (
fmt "fmt"
- _ "github.com/cosmos/cosmos-sdk/api/cosmos/orm/v1alpha1"
proto "github.com/gogo/protobuf/proto"
- types "github.com/gogo/protobuf/types"
- io "io"
math "math"
- math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
@@ -24,1134 +20,19 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-// Basket represents a basket in state.
-type Basket struct {
- // id is the uint64 ID of the basket. It is used internally for reducing
- // storage space.
- Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
- // basket_denom is the basket bank denom.
- BasketDenom string `protobuf:"bytes,2,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"`
- // name is the unique name of the basket specified in MsgCreate. Basket
- // names must be unique across all credit types and choices of exponent
- // above and beyond the uniqueness constraint on basket_denom.
- Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
- // disable_auto_retire indicates whether or not the credits will be retired upon withdraw from the basket.
- DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"`
- // credit_type_abbrev is the abbreviation of the credit type this basket is able to hold.
- CreditTypeAbbrev string `protobuf:"bytes,5,opt,name=credit_type_abbrev,json=creditTypeAbbrev,proto3" json:"credit_type_abbrev,omitempty"`
- // date_criteria is the date criteria for batches admitted to the basket.
- DateCriteria *DateCriteria `protobuf:"bytes,6,opt,name=date_criteria,json=dateCriteria,proto3" json:"date_criteria,omitempty"`
- // exponent is the exponent for converting credits to/from basket tokens.
- Exponent uint32 `protobuf:"varint,7,opt,name=exponent,proto3" json:"exponent,omitempty"`
-}
-
-func (m *Basket) Reset() { *m = Basket{} }
-func (m *Basket) String() string { return proto.CompactTextString(m) }
-func (*Basket) ProtoMessage() {}
-func (*Basket) Descriptor() ([]byte, []int) {
- return fileDescriptor_c416a19075224f85, []int{0}
-}
-func (m *Basket) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Basket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Basket.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *Basket) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Basket.Merge(m, src)
-}
-func (m *Basket) XXX_Size() int {
- return m.Size()
-}
-func (m *Basket) XXX_DiscardUnknown() {
- xxx_messageInfo_Basket.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Basket proto.InternalMessageInfo
-
-func (m *Basket) GetId() uint64 {
- if m != nil {
- return m.Id
- }
- return 0
-}
-
-func (m *Basket) GetBasketDenom() string {
- if m != nil {
- return m.BasketDenom
- }
- return ""
-}
-
-func (m *Basket) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *Basket) GetDisableAutoRetire() bool {
- if m != nil {
- return m.DisableAutoRetire
- }
- return false
-}
-
-func (m *Basket) GetCreditTypeAbbrev() string {
- if m != nil {
- return m.CreditTypeAbbrev
- }
- return ""
-}
-
-func (m *Basket) GetDateCriteria() *DateCriteria {
- if m != nil {
- return m.DateCriteria
- }
- return nil
-}
-
-func (m *Basket) GetExponent() uint32 {
- if m != nil {
- return m.Exponent
- }
- return 0
-}
-
-// BasketClass describes a credit class that can be deposited in a basket.
-type BasketClass struct {
- // basket_id is the ID of the basket
- BasketId uint64 `protobuf:"varint,1,opt,name=basket_id,json=basketId,proto3" json:"basket_id,omitempty"`
- // class_id is the id of the credit class that is allowed to be deposited in the basket
- ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
-}
-
-func (m *BasketClass) Reset() { *m = BasketClass{} }
-func (m *BasketClass) String() string { return proto.CompactTextString(m) }
-func (*BasketClass) ProtoMessage() {}
-func (*BasketClass) Descriptor() ([]byte, []int) {
- return fileDescriptor_c416a19075224f85, []int{1}
-}
-func (m *BasketClass) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *BasketClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_BasketClass.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *BasketClass) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BasketClass.Merge(m, src)
-}
-func (m *BasketClass) XXX_Size() int {
- return m.Size()
-}
-func (m *BasketClass) XXX_DiscardUnknown() {
- xxx_messageInfo_BasketClass.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BasketClass proto.InternalMessageInfo
-
-func (m *BasketClass) GetBasketId() uint64 {
- if m != nil {
- return m.BasketId
- }
- return 0
-}
-
-func (m *BasketClass) GetClassId() string {
- if m != nil {
- return m.ClassId
- }
- return ""
-}
-
-// BasketBalance stores the amount of credits from a batch in a basket
-type BasketBalance struct {
- // basket_id is the ID of the basket
- BasketId uint64 `protobuf:"varint,1,opt,name=basket_id,json=basketId,proto3" json:"basket_id,omitempty"`
- // batch_denom is the denom of the credit batch
- BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"`
- // balance is the amount of ecocredits held in the basket
- Balance string `protobuf:"bytes,3,opt,name=balance,proto3" json:"balance,omitempty"`
- // batch_start_date is the start date of the batch. This field is used
- // to create an index which is used to remove the oldest credits first.
- BatchStartDate *types.Timestamp `protobuf:"bytes,4,opt,name=batch_start_date,json=batchStartDate,proto3" json:"batch_start_date,omitempty"`
-}
-
-func (m *BasketBalance) Reset() { *m = BasketBalance{} }
-func (m *BasketBalance) String() string { return proto.CompactTextString(m) }
-func (*BasketBalance) ProtoMessage() {}
-func (*BasketBalance) Descriptor() ([]byte, []int) {
- return fileDescriptor_c416a19075224f85, []int{2}
-}
-func (m *BasketBalance) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *BasketBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_BasketBalance.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *BasketBalance) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BasketBalance.Merge(m, src)
-}
-func (m *BasketBalance) XXX_Size() int {
- return m.Size()
-}
-func (m *BasketBalance) XXX_DiscardUnknown() {
- xxx_messageInfo_BasketBalance.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BasketBalance proto.InternalMessageInfo
-
-func (m *BasketBalance) GetBasketId() uint64 {
- if m != nil {
- return m.BasketId
- }
- return 0
-}
-
-func (m *BasketBalance) GetBatchDenom() string {
- if m != nil {
- return m.BatchDenom
- }
- return ""
-}
-
-func (m *BasketBalance) GetBalance() string {
- if m != nil {
- return m.Balance
- }
- return ""
-}
-
-func (m *BasketBalance) GetBatchStartDate() *types.Timestamp {
- if m != nil {
- return m.BatchStartDate
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Basket)(nil), "regen.ecocredit.basket.v1.Basket")
- proto.RegisterType((*BasketClass)(nil), "regen.ecocredit.basket.v1.BasketClass")
- proto.RegisterType((*BasketBalance)(nil), "regen.ecocredit.basket.v1.BasketBalance")
-}
-
func init() {
proto.RegisterFile("regen/ecocredit/basket/v1/state.proto", fileDescriptor_c416a19075224f85)
}
var fileDescriptor_c416a19075224f85 = []byte{
- // 549 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xc1, 0x6e, 0xd3, 0x40,
- 0x10, 0xed, 0xa6, 0x25, 0x4d, 0x27, 0x6d, 0x65, 0x16, 0x10, 0xdb, 0x20, 0xdc, 0x10, 0x09, 0x11,
- 0xa1, 0x62, 0x93, 0x72, 0x41, 0xe1, 0x94, 0x34, 0x97, 0x4a, 0x9c, 0x4c, 0x4f, 0x5c, 0xac, 0xb5,
- 0x3d, 0x24, 0x56, 0x6d, 0xaf, 0xb5, 0xde, 0x84, 0xf6, 0x27, 0x10, 0x5f, 0xc0, 0xf7, 0xc0, 0xad,
- 0x12, 0x17, 0x8e, 0x28, 0xf9, 0x01, 0xc4, 0x17, 0x20, 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e, 0x9b, 0xc7, 0x2d, 0xc7, 0xdc, 0x9f, 0xb3, 0xbc, 0x3f, 0xe7, 0x6c, 0x79, 0x7f,
- 0xde, 0xbe, 0xf6, 0xbc, 0x2b, 0x2d, 0x65, 0xf4, 0xfd, 0x81, 0x7e, 0xcf, 0x1b, 0x78, 0x08, 0x0f,
- 0xd6, 0xef, 0xb9, 0x36, 0x12, 0xb5, 0xa1, 0xf5, 0x37, 0xb1, 0x6e, 0x68, 0x11, 0xb6, 0x39, 0xf4,
- 0xbe, 0xce, 0x6d, 0x72, 0x35, 0xb7, 0xc9, 0xcf, 0xb9, 0x4d, 0x3e, 0x2f, 0xec, 0x8d, 0xab, 0x85,
- 0xbd, 0xf1, 0x63, 0x61, 0x6f, 0xbc, 0x7f, 0x3d, 0x8e, 0xd5, 0x64, 0x1a, 0x38, 0xa1, 0x48, 0x5d,
- 0x7d, 0x02, 0x2f, 0x32, 0x54, 0x1f, 0x85, 0x3c, 0xaf, 0x50, 0x82, 0xd1, 0x18, 0xa5, 0x7b, 0xf1,
- 0xcf, 0x1f, 0x21, 0xa8, 0xeb, 0xd1, 0x5f, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x21, 0x6b, 0x6c,
- 0x9b, 0xab, 0x03, 0x00, 0x00,
-}
-
-func (m *Basket) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *Basket) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Basket) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.Exponent != 0 {
- i = encodeVarintState(dAtA, i, uint64(m.Exponent))
- i--
- dAtA[i] = 0x38
- }
- if m.DateCriteria != nil {
- {
- size, err := m.DateCriteria.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintState(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x32
- }
- if len(m.CreditTypeAbbrev) > 0 {
- i -= len(m.CreditTypeAbbrev)
- copy(dAtA[i:], m.CreditTypeAbbrev)
- i = encodeVarintState(dAtA, i, uint64(len(m.CreditTypeAbbrev)))
- i--
- dAtA[i] = 0x2a
- }
- if m.DisableAutoRetire {
- i--
- if m.DisableAutoRetire {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x20
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintState(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.BasketDenom) > 0 {
- i -= len(m.BasketDenom)
- copy(dAtA[i:], m.BasketDenom)
- i = encodeVarintState(dAtA, i, uint64(len(m.BasketDenom)))
- i--
- dAtA[i] = 0x12
- }
- if m.Id != 0 {
- i = encodeVarintState(dAtA, i, uint64(m.Id))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *BasketClass) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *BasketClass) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *BasketClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.ClassId) > 0 {
- i -= len(m.ClassId)
- copy(dAtA[i:], m.ClassId)
- i = encodeVarintState(dAtA, i, uint64(len(m.ClassId)))
- i--
- dAtA[i] = 0x12
- }
- if m.BasketId != 0 {
- i = encodeVarintState(dAtA, i, uint64(m.BasketId))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *BasketBalance) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *BasketBalance) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *BasketBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.BatchStartDate != nil {
- {
- size, err := m.BatchStartDate.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintState(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- if len(m.Balance) > 0 {
- i -= len(m.Balance)
- copy(dAtA[i:], m.Balance)
- i = encodeVarintState(dAtA, i, uint64(len(m.Balance)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.BatchDenom) > 0 {
- i -= len(m.BatchDenom)
- copy(dAtA[i:], m.BatchDenom)
- i = encodeVarintState(dAtA, i, uint64(len(m.BatchDenom)))
- i--
- dAtA[i] = 0x12
- }
- if m.BasketId != 0 {
- i = encodeVarintState(dAtA, i, uint64(m.BasketId))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintState(dAtA []byte, offset int, v uint64) int {
- offset -= sovState(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Basket) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Id != 0 {
- n += 1 + sovState(uint64(m.Id))
- }
- l = len(m.BasketDenom)
- if l > 0 {
- n += 1 + l + sovState(uint64(l))
- }
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovState(uint64(l))
- }
- if m.DisableAutoRetire {
- n += 2
- }
- l = len(m.CreditTypeAbbrev)
- if l > 0 {
- n += 1 + l + sovState(uint64(l))
- }
- if m.DateCriteria != nil {
- l = m.DateCriteria.Size()
- n += 1 + l + sovState(uint64(l))
- }
- if m.Exponent != 0 {
- n += 1 + sovState(uint64(m.Exponent))
- }
- return n
-}
-
-func (m *BasketClass) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.BasketId != 0 {
- n += 1 + sovState(uint64(m.BasketId))
- }
- l = len(m.ClassId)
- if l > 0 {
- n += 1 + l + sovState(uint64(l))
- }
- return n
-}
-
-func (m *BasketBalance) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.BasketId != 0 {
- n += 1 + sovState(uint64(m.BasketId))
- }
- l = len(m.BatchDenom)
- if l > 0 {
- n += 1 + l + sovState(uint64(l))
- }
- l = len(m.Balance)
- if l > 0 {
- n += 1 + l + sovState(uint64(l))
- }
- if m.BatchStartDate != nil {
- l = m.BatchStartDate.Size()
- n += 1 + l + sovState(uint64(l))
- }
- return n
+ // 144 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2d, 0x4a, 0x4d, 0x4f,
+ 0xcd, 0xd3, 0x4f, 0x4d, 0xce, 0x4f, 0x2e, 0x4a, 0x4d, 0xc9, 0x2c, 0xd1, 0x4f, 0x4a, 0x2c, 0xce,
+ 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f,
+ 0xc9, 0x17, 0x92, 0x04, 0x2b, 0xd3, 0x83, 0x2b, 0xd3, 0x83, 0x28, 0xd3, 0x2b, 0x33, 0x74, 0x0a,
+ 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96,
+ 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8b, 0xf4, 0xcc, 0x92, 0x8c,
+ 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xb0, 0x7e, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2,
+ 0x6c, 0x28, 0x2f, 0x27, 0x35, 0x25, 0x3d, 0xb5, 0x48, 0xbf, 0x02, 0xc3, 0xf6, 0x24, 0x36, 0xb0,
+ 0xad, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0xc6, 0xf3, 0x6e, 0x9e, 0x00, 0x00, 0x00,
}
-
-func sovState(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozState(x uint64) (n int) {
- return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (m *Basket) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Basket: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Basket: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
- }
- m.Id = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Id |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.BasketDenom = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.DisableAutoRetire = bool(v != 0)
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreditTypeAbbrev", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.CreditTypeAbbrev = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DateCriteria", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.DateCriteria == nil {
- m.DateCriteria = &DateCriteria{}
- }
- if err := m.DateCriteria.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType)
- }
- m.Exponent = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Exponent |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipState(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthState
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *BasketClass) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: BasketClass: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: BasketClass: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field BasketId", wireType)
- }
- m.BasketId = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.BasketId |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ClassId = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipState(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthState
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *BasketBalance) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: BasketBalance: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: BasketBalance: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field BasketId", wireType)
- }
- m.BasketId = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.BasketId |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.BatchDenom = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Balance = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field BatchStartDate", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowState
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthState
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthState
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.BatchStartDate == nil {
- m.BatchStartDate = &types.Timestamp{}
- }
- if err := m.BatchStartDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipState(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthState
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipState(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowState
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowState
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowState
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthState
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupState
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthState
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/x/ecocredit/basket/tx.pb.go b/x/ecocredit/basket/tx.pb.go
index 808b0012d6..3899eca597 100644
--- a/x/ecocredit/basket/tx.pb.go
+++ b/x/ecocredit/basket/tx.pb.go
@@ -30,7 +30,7 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-// MsgCreateBasket is the Msg/CreateBasket request type.
+// MsgCreate is the Msg/Create request type.
type MsgCreate struct {
// curator is the address of the basket curator who is able to change certain
// basket settings.
@@ -57,7 +57,7 @@ type MsgCreate struct {
// following values 0, 1, 2, 3, 6, 9, 12, 15, 18, 21, or 24 which correspond
// to the exponents which have an official SI prefix.
//
- // The exponent will be used to form the prefix part of the the bank denom
+ // The exponent will be used to form the prefix part of the bank denom
// and will be mapped as follows:
// 0 - no prefix
// 1 - d (deci)
@@ -189,7 +189,7 @@ func (m *MsgCreate) GetFee() github_com_cosmos_cosmos_sdk_types.Coins {
return nil
}
-// MsgCreateBasketResponse is the Msg/CreateBasket response type.
+// MsgCreateResponse is the Msg/Create response type.
type MsgCreateResponse struct {
// basket_denom is the unique denomination ID of the newly created basket.
BasketDenom string `protobuf:"bytes,1,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"`
@@ -235,7 +235,7 @@ func (m *MsgCreateResponse) GetBasketDenom() string {
return ""
}
-// MsgAddToBasket is the Msg/AddToBasket request type.
+// MsgPut is the Msg/Put request type.
type MsgPut struct {
// owner is the owner of credits being put into the basket.
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
@@ -302,7 +302,7 @@ func (m *MsgPut) GetCredits() []*BasketCredit {
return nil
}
-// MsgAddToBasketResponse is the Msg/AddToBasket response type.
+// MsgPutResponse is the Msg/Put response type.
type MsgPutResponse struct {
// amount_received is the integer amount of basket tokens received.
AmountReceived string `protobuf:"bytes,1,opt,name=amount_received,json=amountReceived,proto3" json:"amount_received,omitempty"`
@@ -348,7 +348,7 @@ func (m *MsgPutResponse) GetAmountReceived() string {
return ""
}
-// MsgTakeFromBasket is the Msg/TakeFromBasket request type.
+// MsgTake is the Msg/Take request type.
type MsgTake struct {
// owner is the owner of the basket tokens.
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
@@ -433,7 +433,7 @@ func (m *MsgTake) GetRetireOnTake() bool {
return false
}
-// MsgTakeFromBasketResponse is the Msg/TakeFromBasket response type.
+// MsgTakeResponse is the Msg/Take response type.
type MsgTakeResponse struct {
// credits are the credits taken out of the basket.
Credits []*BasketCredit `protobuf:"bytes,1,rep,name=credits,proto3" json:"credits,omitempty"`
@@ -1469,7 +1469,10 @@ func (m *MsgCreate) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -1551,7 +1554,10 @@ func (m *MsgCreateResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -1699,7 +1705,10 @@ func (m *MsgPut) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -1781,7 +1790,10 @@ func (m *MsgPutResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -1979,7 +1991,10 @@ func (m *MsgTake) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -2063,7 +2078,10 @@ func (m *MsgTakeResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
diff --git a/x/ecocredit/basket/types.pb.go b/x/ecocredit/basket/types.pb.go
index bfda218363..4514fdcd29 100644
--- a/x/ecocredit/basket/types.pb.go
+++ b/x/ecocredit/basket/types.pb.go
@@ -82,6 +82,9 @@ func (m *BasketCredit) GetAmount() string {
// DateCriteria represents the information for credit acceptance in a basket.
// At most, only one of the values should be set.
+// NOTE: gogo proto `oneof` is not compatible with Amino signing, hence we directly define
+// both `start_date_window` and `min_start_date`. In the future, with pulsar, this should change
+// and we should use `oneof`.
type DateCriteria struct {
// min_start_date (optional) is the earliest start date for batches of credits allowed
// into the basket.
@@ -142,9 +145,188 @@ func (m *DateCriteria) GetStartDateWindow() *types.Duration {
return nil
}
+// Basket represents a basket in state.
+type Basket struct {
+ // id is the uint64 ID of the basket. It is used internally for reducing
+ // storage space.
+ Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ // basket_denom is the basket bank denom.
+ BasketDenom string `protobuf:"bytes,2,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"`
+ // name is the unique name of the basket specified in MsgCreate. Basket
+ // names must be unique across all credit types and choices of exponent
+ // above and beyond the uniqueness constraint on basket_denom.
+ Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
+ // disable_auto_retire indicates whether or not the credits will be retired upon withdraw from the basket.
+ DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"`
+ // credit_type_abbrev is the abbreviation of the credit type this basket is able to hold.
+ CreditTypeAbbrev string `protobuf:"bytes,5,opt,name=credit_type_abbrev,json=creditTypeAbbrev,proto3" json:"credit_type_abbrev,omitempty"`
+ // date_criteria is the date criteria for batches admitted to the basket.
+ DateCriteria *DateCriteria `protobuf:"bytes,6,opt,name=date_criteria,json=dateCriteria,proto3" json:"date_criteria,omitempty"`
+ // exponent is the exponent for converting credits to/from basket tokens.
+ Exponent uint32 `protobuf:"varint,7,opt,name=exponent,proto3" json:"exponent,omitempty"`
+}
+
+func (m *Basket) Reset() { *m = Basket{} }
+func (m *Basket) String() string { return proto.CompactTextString(m) }
+func (*Basket) ProtoMessage() {}
+func (*Basket) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e6c256e957c69c4d, []int{2}
+}
+func (m *Basket) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *Basket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_Basket.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *Basket) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Basket.Merge(m, src)
+}
+func (m *Basket) XXX_Size() int {
+ return m.Size()
+}
+func (m *Basket) XXX_DiscardUnknown() {
+ xxx_messageInfo_Basket.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Basket proto.InternalMessageInfo
+
+func (m *Basket) GetId() uint64 {
+ if m != nil {
+ return m.Id
+ }
+ return 0
+}
+
+func (m *Basket) GetBasketDenom() string {
+ if m != nil {
+ return m.BasketDenom
+ }
+ return ""
+}
+
+func (m *Basket) GetName() string {
+ if m != nil {
+ return m.Name
+ }
+ return ""
+}
+
+func (m *Basket) GetDisableAutoRetire() bool {
+ if m != nil {
+ return m.DisableAutoRetire
+ }
+ return false
+}
+
+func (m *Basket) GetCreditTypeAbbrev() string {
+ if m != nil {
+ return m.CreditTypeAbbrev
+ }
+ return ""
+}
+
+func (m *Basket) GetDateCriteria() *DateCriteria {
+ if m != nil {
+ return m.DateCriteria
+ }
+ return nil
+}
+
+func (m *Basket) GetExponent() uint32 {
+ if m != nil {
+ return m.Exponent
+ }
+ return 0
+}
+
+// BasketBalance stores the amount of credits from a batch in a basket
+type BasketBalance struct {
+ // basket_id is the ID of the basket
+ BasketId uint64 `protobuf:"varint,1,opt,name=basket_id,json=basketId,proto3" json:"basket_id,omitempty"`
+ // batch_denom is the denom of the credit batch
+ BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"`
+ // balance is the amount of ecocredits held in the basket
+ Balance string `protobuf:"bytes,3,opt,name=balance,proto3" json:"balance,omitempty"`
+ // batch_start_date is the start date of the batch. This field is used
+ // to create an index which is used to remove the oldest credits first.
+ BatchStartDate *types.Timestamp `protobuf:"bytes,4,opt,name=batch_start_date,json=batchStartDate,proto3" json:"batch_start_date,omitempty"`
+}
+
+func (m *BasketBalance) Reset() { *m = BasketBalance{} }
+func (m *BasketBalance) String() string { return proto.CompactTextString(m) }
+func (*BasketBalance) ProtoMessage() {}
+func (*BasketBalance) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e6c256e957c69c4d, []int{3}
+}
+func (m *BasketBalance) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *BasketBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_BasketBalance.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *BasketBalance) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_BasketBalance.Merge(m, src)
+}
+func (m *BasketBalance) XXX_Size() int {
+ return m.Size()
+}
+func (m *BasketBalance) XXX_DiscardUnknown() {
+ xxx_messageInfo_BasketBalance.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_BasketBalance proto.InternalMessageInfo
+
+func (m *BasketBalance) GetBasketId() uint64 {
+ if m != nil {
+ return m.BasketId
+ }
+ return 0
+}
+
+func (m *BasketBalance) GetBatchDenom() string {
+ if m != nil {
+ return m.BatchDenom
+ }
+ return ""
+}
+
+func (m *BasketBalance) GetBalance() string {
+ if m != nil {
+ return m.Balance
+ }
+ return ""
+}
+
+func (m *BasketBalance) GetBatchStartDate() *types.Timestamp {
+ if m != nil {
+ return m.BatchStartDate
+ }
+ return nil
+}
+
func init() {
proto.RegisterType((*BasketCredit)(nil), "regen.ecocredit.basket.v1.BasketCredit")
proto.RegisterType((*DateCriteria)(nil), "regen.ecocredit.basket.v1.DateCriteria")
+ proto.RegisterType((*Basket)(nil), "regen.ecocredit.basket.v1.Basket")
+ proto.RegisterType((*BasketBalance)(nil), "regen.ecocredit.basket.v1.BasketBalance")
}
func init() {
@@ -152,27 +334,40 @@ func init() {
}
var fileDescriptor_e6c256e957c69c4d = []byte{
- // 318 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xc1, 0x4e, 0x3a, 0x31,
- 0x10, 0xc6, 0xe9, 0xff, 0x40, 0xf2, 0x2f, 0x44, 0xe3, 0x1e, 0x0c, 0x70, 0x28, 0x86, 0xc4, 0xc4,
- 0x8b, 0x6d, 0xc0, 0x8b, 0x47, 0x03, 0x18, 0xef, 0xab, 0x89, 0x89, 0x97, 0x4d, 0x77, 0x3b, 0x2e,
- 0x0d, 0xb4, 0x25, 0xdd, 0x59, 0xd0, 0xb7, 0xf0, 0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, 0xd6, 0xc6, 0xa0,
- 0x7d, 0x00, 0x19, 0xef, 0xde, 0x15, 0x1f, 0x17, 0x7b, 0xc0, 0x63, 0x70, 0x0c, 0xe3, 0x8f, 0x35,
- 0x23, 0xab, 0x35, 0x23, 0x5f, 0x6b, 0x46, 0xde, 0x36, 0xac, 0xb6, 0xda, 0xb0, 0xda, 0xe7, 0x86,
- 0xd5, 0x9e, 0xae, 0x73, 0x8d, 0x93, 0x32, 0xe5, 0x99, 0x33, 0x22, 0xfc, 0xf1, 0xa5, 0x05, 0x5c,
- 0x3a, 0x3f, 0xdd, 0x55, 0x33, 0x50, 0x39, 0x78, 0xf1, 0x72, 0x70, 0xa1, 0xb4, 0x1e, 0xf6, 0x5e,
- 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x06, 0xdb, 0x38, 0x47, 0xc2, 0x01, 0x00, 0x00,
+ // 517 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcb, 0x6e, 0xd3, 0x40,
+ 0x14, 0x8d, 0x43, 0x48, 0xd3, 0xc9, 0x83, 0x76, 0x90, 0x90, 0x1b, 0x24, 0x37, 0x44, 0x42, 0x64,
+ 0x01, 0x63, 0xb5, 0x6c, 0x58, 0xd2, 0x34, 0x08, 0x21, 0xb1, 0x32, 0x95, 0x90, 0xd8, 0x58, 0x63,
+ 0xcf, 0x25, 0x1d, 0x35, 0x9e, 0x89, 0xc6, 0xe3, 0xa4, 0xfd, 0x0b, 0x76, 0xfd, 0x0a, 0xfe, 0x83,
+ 0x65, 0x97, 0x2c, 0x51, 0xf2, 0x23, 0x28, 0x77, 0x9c, 0x10, 0x35, 0x42, 0xdd, 0xf9, 0xbe, 0xce,
+ 0xdc, 0x73, 0xee, 0x31, 0x79, 0x69, 0x60, 0x0c, 0x2a, 0x84, 0x54, 0xa7, 0x06, 0x84, 0xb4, 0x61,
+ 0xc2, 0xf3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0x3f, 0x8b, 0xc0, 0xfb, 0xb1, 0x0c, 0x2a, 0x77,
+ 0xcb, 0xa0, 0xf2, 0x7b, 0x19, 0x54, 0xbe, 0xbd, 0x1b, 0x4b, 0x7b, 0x59, 0x24, 0x2c, 0xd5, 0x59,
+ 0x88, 0x32, 0xbd, 0x51, 0x60, 0xe7, 0xda, 0x5c, 0x95, 0xd1, 0x04, 0xc4, 0x18, 0x4c, 0x78, 0xbd,
+ 0xf3, 0xaf, 0x25, 0x75, 0x7c, 0xf7, 0xed, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, 0x26, 0x0a,
+ 0x3a, 0x8c, 0x03, 0x00, 0x00,
}
func (m *BasketCredit) Marshal() (dAtA []byte, err error) {
@@ -259,6 +454,136 @@ func (m *DateCriteria) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *Basket) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *Basket) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *Basket) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Exponent != 0 {
+ i = encodeVarintTypes(dAtA, i, uint64(m.Exponent))
+ i--
+ dAtA[i] = 0x38
+ }
+ if m.DateCriteria != nil {
+ {
+ size, err := m.DateCriteria.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintTypes(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x32
+ }
+ if len(m.CreditTypeAbbrev) > 0 {
+ i -= len(m.CreditTypeAbbrev)
+ copy(dAtA[i:], m.CreditTypeAbbrev)
+ i = encodeVarintTypes(dAtA, i, uint64(len(m.CreditTypeAbbrev)))
+ i--
+ dAtA[i] = 0x2a
+ }
+ if m.DisableAutoRetire {
+ i--
+ if m.DisableAutoRetire {
+ dAtA[i] = 1
+ } else {
+ dAtA[i] = 0
+ }
+ i--
+ dAtA[i] = 0x20
+ }
+ if len(m.Name) > 0 {
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintTypes(dAtA, i, uint64(len(m.Name)))
+ i--
+ dAtA[i] = 0x1a
+ }
+ if len(m.BasketDenom) > 0 {
+ i -= len(m.BasketDenom)
+ copy(dAtA[i:], m.BasketDenom)
+ i = encodeVarintTypes(dAtA, i, uint64(len(m.BasketDenom)))
+ i--
+ dAtA[i] = 0x12
+ }
+ if m.Id != 0 {
+ i = encodeVarintTypes(dAtA, i, uint64(m.Id))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *BasketBalance) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *BasketBalance) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *BasketBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.BatchStartDate != nil {
+ {
+ size, err := m.BatchStartDate.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintTypes(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x22
+ }
+ if len(m.Balance) > 0 {
+ i -= len(m.Balance)
+ copy(dAtA[i:], m.Balance)
+ i = encodeVarintTypes(dAtA, i, uint64(len(m.Balance)))
+ i--
+ dAtA[i] = 0x1a
+ }
+ if len(m.BatchDenom) > 0 {
+ i -= len(m.BatchDenom)
+ copy(dAtA[i:], m.BatchDenom)
+ i = encodeVarintTypes(dAtA, i, uint64(len(m.BatchDenom)))
+ i--
+ dAtA[i] = 0x12
+ }
+ if m.BasketId != 0 {
+ i = encodeVarintTypes(dAtA, i, uint64(m.BasketId))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
offset -= sovTypes(v)
base := offset
@@ -304,6 +629,64 @@ func (m *DateCriteria) Size() (n int) {
return n
}
+func (m *Basket) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Id != 0 {
+ n += 1 + sovTypes(uint64(m.Id))
+ }
+ l = len(m.BasketDenom)
+ if l > 0 {
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ l = len(m.Name)
+ if l > 0 {
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ if m.DisableAutoRetire {
+ n += 2
+ }
+ l = len(m.CreditTypeAbbrev)
+ if l > 0 {
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ if m.DateCriteria != nil {
+ l = m.DateCriteria.Size()
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ if m.Exponent != 0 {
+ n += 1 + sovTypes(uint64(m.Exponent))
+ }
+ return n
+}
+
+func (m *BasketBalance) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.BasketId != 0 {
+ n += 1 + sovTypes(uint64(m.BasketId))
+ }
+ l = len(m.BatchDenom)
+ if l > 0 {
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ l = len(m.Balance)
+ if l > 0 {
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ if m.BatchStartDate != nil {
+ l = m.BatchStartDate.Size()
+ n += 1 + l + sovTypes(uint64(l))
+ }
+ return n
+}
+
func sovTypes(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -409,7 +792,10 @@ func (m *BasketCredit) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTypes
}
if (iNdEx + skippy) > l {
@@ -531,7 +917,425 @@ func (m *DateCriteria) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if (iNdEx + skippy) < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *Basket) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: Basket: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: Basket: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
+ }
+ m.Id = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Id |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.BasketDenom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 4:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.DisableAutoRetire = bool(v != 0)
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field CreditTypeAbbrev", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.CreditTypeAbbrev = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DateCriteria", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.DateCriteria == nil {
+ m.DateCriteria = &DateCriteria{}
+ }
+ if err := m.DateCriteria.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 7:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType)
+ }
+ m.Exponent = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Exponent |= uint32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTypes(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if (iNdEx + skippy) < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *BasketBalance) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: BasketBalance: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: BasketBalance: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BasketId", wireType)
+ }
+ m.BasketId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.BasketId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.BatchDenom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Balance = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BatchStartDate", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTypes
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthTypes
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.BatchStartDate == nil {
+ m.BatchStartDate = &types.Timestamp{}
+ }
+ if err := m.BatchStartDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTypes(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthTypes
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTypes
}
if (iNdEx + skippy) > l {
diff --git a/x/ecocredit/events.pb.go b/x/ecocredit/events.pb.go
index 241b69448c..7aa4e24615 100644
--- a/x/ecocredit/events.pb.go
+++ b/x/ecocredit/events.pb.go
@@ -182,7 +182,7 @@ func (m *EventCreateBatch) GetProjectLocation() string {
// EventReceive is an event emitted when credits are received either via
// creation of a new batch, transfer of credits, or taking credits from a
-// basket. Each batch_denom created, transferred or taken from a baset will
+// basket. Each batch_denom created, transferred or taken from a basket will
// result in a separate EventReceive for easy indexing.
type EventReceive struct {
// sender is the sender of the credits in the case that this event is the
@@ -197,9 +197,10 @@ type EventReceive struct {
TradableAmount string `protobuf:"bytes,4,opt,name=tradable_amount,json=tradableAmount,proto3" json:"tradable_amount,omitempty"`
// retired_amount is the decimal number of retired credits received.
RetiredAmount string `protobuf:"bytes,5,opt,name=retired_amount,json=retiredAmount,proto3" json:"retired_amount,omitempty"`
- // basket_denom is the denom of the basket. when the basket_denom field is set, it indicates that this event was
- // triggered by the transfer of credits from a basket. It will not be set if the credits were sent by a user, or
- // by initial issuance.
+ // basket_denom is the denom of the basket. when the basket_denom field is
+ // set, it indicates that this event was triggered by the transfer of credits
+ // from a basket. It will not be set if the credits were sent by a user, or by
+ // initial issuance.
BasketDenom string `protobuf:"bytes,6,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"`
}
@@ -989,7 +990,10 @@ func (m *EventCreateClass) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
@@ -1263,7 +1267,10 @@ func (m *EventCreateBatch) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
@@ -1505,7 +1512,10 @@ func (m *EventReceive) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
@@ -1683,7 +1693,10 @@ func (m *EventRetire) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
@@ -1829,7 +1842,10 @@ func (m *EventCancel) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
+ if skippy < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod
index 1d5a276799..d30f46703d 100644
--- a/x/ecocredit/go.mod
+++ b/x/ecocredit/go.mod
@@ -13,7 +13,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
- github.com/regen-network/regen-ledger/api v0.6.0
+ github.com/regen-network/regen-ledger/api v0.8.0
github.com/regen-network/regen-ledger/orm v1.0.0-beta1
github.com/regen-network/regen-ledger/types v1.0.0
github.com/spf13/cobra v1.2.1
diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum
index 44df20c8fb..762d87fc37 100644
--- a/x/ecocredit/go.sum
+++ b/x/ecocredit/go.sum
@@ -911,8 +911,8 @@ github.com/regen-network/cosmos-sdk v0.44.2-regen-1 h1:Sm7rU4rMwLpEpgrQkF/4w/V/y
github.com/regen-network/cosmos-sdk v0.44.2-regen-1/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU80QCZUPnHr4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
-github.com/regen-network/regen-ledger/api v0.6.0 h1:Wsr+zWimB/i9wYM8q4ffU8qn38AldbYjDe0lhQ9n8VU=
-github.com/regen-network/regen-ledger/api v0.6.0/go.mod h1:kWly2pK0u3fDfyoYYilpEoTEg61pCjV/f5XSY0KzJQY=
+github.com/regen-network/regen-ledger/api v0.8.0 h1:Aovi26UTimyOoInl8xyE99Y3TE70P3CWr0t569KpFN0=
+github.com/regen-network/regen-ledger/api v0.8.0/go.mod h1:kWly2pK0u3fDfyoYYilpEoTEg61pCjV/f5XSY0KzJQY=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
diff --git a/x/ecocredit/server/basket/query_basket.go b/x/ecocredit/server/basket/query_basket.go
index c05fe513d0..c630d5bd73 100644
--- a/x/ecocredit/server/basket/query_basket.go
+++ b/x/ecocredit/server/basket/query_basket.go
@@ -5,6 +5,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
+ basketv1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/basket/v1"
baskettypes "github.com/regen-network/regen-ledger/x/ecocredit/basket"
)
@@ -24,5 +25,22 @@ func (k Keeper) Basket(ctx context.Context, request *baskettypes.QueryBasketRequ
return nil, err
}
- return &baskettypes.QueryBasketResponse{Basket: basketGogo}, nil
+ it, err := k.stateStore.BasketClassStore().List(ctx, basketv1.BasketClassPrimaryKey{}.WithBasketId(basket.Id))
+ if err != nil {
+ return nil, err
+ }
+
+ var classes []string
+ for it.Next() {
+ class, err := it.Value()
+ if err != nil {
+ return nil, err
+ }
+
+ classes = append(classes, class.ClassId)
+ }
+
+ it.Close()
+
+ return &baskettypes.QueryBasketResponse{Basket: basketGogo, Classes: classes}, nil
}
diff --git a/x/ecocredit/server/basket/query_basket_test.go b/x/ecocredit/server/basket/query_basket_test.go
index 4d5946f834..f640767d83 100644
--- a/x/ecocredit/server/basket/query_basket_test.go
+++ b/x/ecocredit/server/basket/query_basket_test.go
@@ -34,3 +34,31 @@ func TestKeeper_Basket(t *testing.T) {
})
require.Error(t, err)
}
+
+func TestKeeper_BasketClasses(t *testing.T) {
+ t.Parallel()
+ s := setupBase(t)
+
+ // add a basket
+ basketDenom := "foo"
+ err := s.stateStore.BasketStore().Insert(s.ctx, &basketv1.Basket{
+ BasketDenom: basketDenom,
+ })
+ require.NoError(t, err)
+
+ // add a basket class
+ classId := "C01"
+ err = s.stateStore.BasketClassStore().Insert(s.ctx, &basketv1.BasketClass{
+ BasketId: 1,
+ ClassId: classId,
+ })
+ require.NoError(t, err)
+
+ // query
+ res, err := s.k.Basket(s.ctx, &baskettypes.QueryBasketRequest{
+ BasketDenom: basketDenom,
+ })
+ require.NoError(t, err)
+ require.Equal(t, basketDenom, res.Basket.BasketDenom)
+ require.Equal(t, []string{classId}, res.Classes)
+}
diff --git a/x/ecocredit/spec/protobuf.md b/x/ecocredit/spec/protobuf.md
index 802451a820..d054d4411b 100644
--- a/x/ecocredit/spec/protobuf.md
+++ b/x/ecocredit/spec/protobuf.md
@@ -137,18 +137,20 @@ EventCreateClass is an event emitted when a credit class is created.
### EventReceive
-EventReceive is an event emitted when credits are received either upon
-creation of a new batch or upon transfer. Each batch_denom created or
-transferred will result in a separate EventReceive for easy indexing.
+EventReceive is an event emitted when credits are received either via
+creation of a new batch, transfer of credits, or taking credits from a
+basket. Each batch_denom created, transferred or taken from a basket will
+result in a separate EventReceive for easy indexing.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| sender | [string](#string) | | sender is the sender of the credits in the case that this event is the result of a transfer. It will not be set when credits are received at initial issuance. |
-| recipient | [string](#string) | | recipient is the recipient of the credits |
+| sender | [string](#string) | | sender is the sender of the credits in the case that this event is the result of a transfer. It will not be set when credits are received at initial issuance or taken from a basket. |
+| recipient | [string](#string) | | recipient is the recipient of the credits. |
| batch_denom | [string](#string) | | batch_denom is the unique ID of credit batch. |
| tradable_amount | [string](#string) | | tradable_amount is the decimal number of tradable credits received. |
| retired_amount | [string](#string) | | retired_amount is the decimal number of retired credits received. |
+| basket_denom | [string](#string) | | basket_denom is the denom of the basket. when the basket_denom field is set, it indicates that this event was triggered by the transfer of credits from a basket. It will not be set if the credits were sent by a user, or by initial issuance. |
diff --git a/x/group/go.mod b/x/group/go.mod
index 6c36908fbb..9d829417c7 100644
--- a/x/group/go.mod
+++ b/x/group/go.mod
@@ -108,7 +108,7 @@ require (
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
- github.com/regen-network/regen-ledger/api v0.6.0 // indirect
+ github.com/regen-network/regen-ledger/api v0.8.0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/rs/zerolog v1.23.0 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
diff --git a/x/group/go.sum b/x/group/go.sum
index 79f96e78c5..8d654b00b9 100644
--- a/x/group/go.sum
+++ b/x/group/go.sum
@@ -930,8 +930,8 @@ github.com/regen-network/cosmos-sdk v0.44.2-regen-1 h1:Sm7rU4rMwLpEpgrQkF/4w/V/y
github.com/regen-network/cosmos-sdk v0.44.2-regen-1/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU80QCZUPnHr4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
-github.com/regen-network/regen-ledger/api v0.6.0 h1:Wsr+zWimB/i9wYM8q4ffU8qn38AldbYjDe0lhQ9n8VU=
-github.com/regen-network/regen-ledger/api v0.6.0/go.mod h1:kWly2pK0u3fDfyoYYilpEoTEg61pCjV/f5XSY0KzJQY=
+github.com/regen-network/regen-ledger/api v0.8.0 h1:Aovi26UTimyOoInl8xyE99Y3TE70P3CWr0t569KpFN0=
+github.com/regen-network/regen-ledger/api v0.8.0/go.mod h1:kWly2pK0u3fDfyoYYilpEoTEg61pCjV/f5XSY0KzJQY=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=