Skip to content

Commit

Permalink
feat!: Record retirement location for ecocredit module (#328)
Browse files Browse the repository at this point in the history
This commit introduces retirement locations for ecocredits. The retirement location is the location of the beneficiary or buyer of the retired credits. It is a string of the form <country-code>[-<sub-national-code>[ <postal-code>]], with the first two fields conforming to the ISO 3166-2 standard and the postal-code being an alphanumeric string up to 64 characters. The location is emitted during retirement events and can therefore be tracked by an indexer.

Closes: #328
  • Loading branch information
ruhatch committed Jul 6, 2021
1 parent 13c18cf commit 81f1347
Show file tree
Hide file tree
Showing 17 changed files with 650 additions and 149 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
* record retirement locations of ecocredit (#328)

## [1.0.0] - 2021-04-13

This release is the version of regen-ledger that will be used for the mainnet launch of Regen Network's blockchain (chain-id: `regen-1`).
Expand Down Expand Up @@ -34,7 +37,7 @@ It is not guaranteed that APIs of features in the experimental build will remain

## [0.6.0] - 2021-02-04

This release contains first iterations of the `x/ecocredit` and `x/data` modules which were launched in a Devnet as part of the Open Climate Collabathon in Nov 2020.
This release contains first iterations of the `x/ecocredit` and `x/data` modules which were launched in a Devnet as part of the Open Climate Collabathon in Nov 2020.

It is more or less a full rewrite of regen-ledger to upgrade it to Stargate (Cosmos SDK v0.40)

Expand Down Expand Up @@ -94,7 +97,7 @@ internal testnet
- [\#18](https://github.com/regen-network/regen-ledger/issues/18) Graph package and binary serialization format
- [\#27](https://github.com/regen-network/regen-ledger/issues/27) Create claim module
- [\#166185199](https://www.pivotaltracker.com/story/show/166185199) Integrate Cosmos staking modules

## [0.3.0] - 2019-01-09

- Updated `xrn-test-2` testnet at height `1000`
Expand Down
6 changes: 5 additions & 1 deletion docs/modules/ecocredit/protobuf.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ batches have been retired at once for easy indexing.
| retirer | [string](#string) | | retirer is the account which has done the "retiring". This will be the account receiving credits in the case that credits were retired upon issuance using Msg/CreateBatch or retired upon transfer using Msg/Send. |
| batch_denom | [string](#string) | | batch_denom is the unique ID of credit batch. |
| units | [string](#string) | | units is the decimal number of credits that have been retired. |
| location | [string](#string) | | location is the location of the beneficiary or buyer of the retired credits. It is a string of the form <country-code>[-<sub-national-code>[ <postal-code>]], with the first two fields conforming to ISO 3166-2, and postal-code being up to 64 alphanumeric characters. |



Expand Down Expand Up @@ -444,6 +445,7 @@ single recipient.
| recipient | [string](#string) | | recipient is the account of the recipient. |
| tradable_units | [string](#string) | | tradable_units are the units of credits in this issuance that can be traded by this recipient. Decimal values are acceptable. |
| retired_units | [string](#string) | | retired_units are the units of credits in this issuance that are effectively retired by the issuer on receipt. Decimal values are acceptable. |
| retirement_location | [string](#string) | | retirement_location is the location of the beneficiary or buyer of the retired credits. This must be provided if retired_units is positive. It is a string of the form <country-code>[-<sub-national-code>[ <postal-code>]], with the first two fields conforming to ISO 3166-2, and postal-code being up to 64 alphanumeric characters. |



Expand Down Expand Up @@ -507,6 +509,7 @@ MsgRetireRequest is the Msg/Retire request type.
| ----- | ---- | ----- | ----------- |
| holder | [string](#string) | | holder is the credit holder address. |
| credits | [MsgRetireRequest.RetireUnits](#regen.ecocredit.v1alpha1.MsgRetireRequest.RetireUnits) | repeated | credits are the credits being retired. |
| location | [string](#string) | | location is the location of the beneficiary or buyer of the retired credits. It is a string of the form <country-code>[-<sub-national-code>[ <postal-code>]], with the first two fields conforming to ISO 3166-2, and postal-code being up to 64 alphanumeric characters. |



Expand Down Expand Up @@ -566,7 +569,8 @@ SendUnits are the tradable and retired units of a credit batch to send.
| ----- | ---- | ----- | ----------- |
| batch_denom | [string](#string) | | batch_denom is the unique ID of the credit batch. |
| tradable_units | [string](#string) | | tradable_units are the units of credits in this issuance that can be traded by this recipient. Decimal values are acceptable within the precision returned by Query/Precision. |
| retired_units | [string](#string) | | retired_units are the units of credits in this issuance that are effectively retired by the issuer on receipt. Decimal values are acceptable within the precision returned by Query/Precision. |
| retired_units | [string](#string) | | retired_units are the units of credits in this transfer that are effectively retired by the recipient on receipt. Decimal values are acceptable within the precision returned by Query/Precision. |
| retirement_location | [string](#string) | | retirement_location is the location of the beneficiary or buyer of the retired credits. This must be provided if retired_units is positive. It is a string of the form <country-code>[-<sub-national-code>[ <postal-code>]], with the first two fields conforming to ISO 3166-2, and postal-code being up to 64 alphanumeric characters. |



Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.11
github.com/tendermint/tm-db v0.6.4
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
google.golang.org/genproto v0.0.0-20210611144927-798beca9d670 // indirect
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 // indirect
)

replace google.golang.org/grpc => google.golang.org/grpc v1.33.2
Expand Down
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cosmos/cosmos-sdk v0.43.0-beta1/go.mod h1:rpCPaC3MnityU4Io4CDZqZB4GMtPqNeYXxPk8iRqmYM=
github.com/cosmos/cosmos-sdk v0.43.0-beta1.0.20210622080249-5e564352ae77 h1:DS4Xxtx9xFlnvNIKedloNkj4aA/y0XYAqZcMFMhmydQ=
github.com/cosmos/cosmos-sdk v0.43.0-beta1.0.20210622080249-5e564352ae77/go.mod h1:sXYxQwivPFU5YWkIgsqOzBcJJgmKwJfA+X+3b3iveE8=
github.com/cosmos/cosmos-sdk v0.43.0-rc0 h1:+WGHEo1N/2zRSpWpKmuquTjDskL4j9K6zTc7CfDpfOM=
github.com/cosmos/cosmos-sdk v0.43.0-rc0/go.mod h1:ctcrTEAhei9s8O3KSNvL0dxe+fVQGp07QyRb/7H9JYE=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
Expand Down Expand Up @@ -628,6 +626,7 @@ github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT9
github.com/otiai10/mint v1.3.2 h1:VYWnrP5fXmz1MXvjuUvcBrXSjGE6xjON+axB/UrpO3E=
github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
github.com/pariz/gountries v0.0.0-20200430155801-1c6a393df9c7/go.mod h1:U0ETmPPEsfd7CpUKNMYi68xIOL8Ww4jPZlaqNngcwqs=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
Expand Down Expand Up @@ -890,8 +889,8 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
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=
Expand Down Expand Up @@ -1075,8 +1074,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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=
Expand Down Expand Up @@ -1150,6 +1150,7 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -1233,8 +1234,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
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-20210611144927-798beca9d670 h1:M9c2dapWGIISuWaz5vr/RUk5Qn2Hs8DZ9CJb5aH266Q=
google.golang.org/genproto v0.0.0-20210611144927-798beca9d670/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc=
google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U=
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=
Expand All @@ -1249,8 +1250,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
7 changes: 7 additions & 0 deletions proto/regen/ecocredit/v1alpha1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,11 @@ message EventRetire {

// units is the decimal number of credits that have been retired.
string units = 3;

// location is the location of the beneficiary or buyer of the retired
// credits. It is a string of the form
// <country-code>[-<sub-national-code>[ <postal-code>]], with the first two
// fields conforming to ISO 3166-2, and postal-code being up to 64
// alphanumeric characters.
string location = 4;
}
29 changes: 27 additions & 2 deletions proto/regen/ecocredit/v1alpha1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ message MsgCreateBatchRequest {
// acceptable.
string retired_units = 3
[ (gogoproto.moretags) = "yaml:\"retired_units\"" ];

// retirement_location is the location of the beneficiary or buyer of the
// retired credits. This must be provided if retired_units is positive. It
// is a string of the form
// <country-code>[-<sub-national-code>[ <postal-code>]], with the first two
// fields conforming to ISO 3166-2, and postal-code being up to 64
// alphanumeric characters.
string retirement_location = 4
[ (gogoproto.moretags) = "yaml:\"retirement_location\"" ];
}
}

Expand Down Expand Up @@ -136,11 +145,20 @@ message MsgSendRequest {
string tradable_units = 2
[ (gogoproto.moretags) = "yaml:\"tradable_units\"" ];

// retired_units are the units of credits in this issuance that are
// effectively retired by the issuer on receipt. Decimal values are
// retired_units are the units of credits in this transfer that are
// effectively retired by the recipient on receipt. Decimal values are
// acceptable within the precision returned by Query/Precision.
string retired_units = 3
[ (gogoproto.moretags) = "yaml:\"retired_units\"" ];

// retirement_location is the location of the beneficiary or buyer of the
// retired credits. This must be provided if retired_units is positive. It
// is a string of the form
// <country-code>[-<sub-national-code>[ <postal-code>]], with the first two
// fields conforming to ISO 3166-2, and postal-code being up to 64
// alphanumeric characters.
string retirement_location = 4
[ (gogoproto.moretags) = "yaml:\"retirement_location\"" ];
}
}

Expand All @@ -167,6 +185,13 @@ message MsgRetireRequest {
// Query/Precision.
string units = 2;
}

// location is the location of the beneficiary or buyer of the retired
// credits. It is a string of the form
// <country-code>[-<sub-national-code>[ <postal-code>]], with the first two
// fields conforming to ISO 3166-2, and postal-code being up to 64
// alphanumeric characters.
string location = 3;
}

// MsgRetireRequest is the Msg/Retire response type.
Expand Down
27 changes: 18 additions & 9 deletions x/ecocredit/client/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ Parameters:
class_id: credit class
metadata: base64 encoded issuance metadata
issuance: YAML encode issuance list. Note: numerical values must be written in strings.
eg: '[{recipient: "xrn:sdgkjhs2345u79ghisodg", tradable_units: "10", retired_units: "2"}]'
Note: "tradable_units" and "retired_units" default to 0.`,
eg: '[{recipient: "xrn:sdgkjhs2345u79ghisodg", tradable_units: "10", retired_units: "2", retirement_location: "YY-ZZ 12345"}]'
Note: "tradable_units" and "retired_units" default to 0.
Note: "retirement_location" is only required when "retired_units" is positive.`,
Args: cobra.ExactArgs(4),
RunE: func(cmd *cobra.Command, args []string) error {
b, err := base64.StdEncoding.DecodeString(args[2])
Expand Down Expand Up @@ -124,7 +125,8 @@ func txSend() *cobra.Command {
Parameters:
recipient: recipient address
credits: YAML encoded credit list. Note: numerical values must be written in strings.
eg: '[{batch_denom: "100/2", tradable_units: "5", retired_units: "0"}]'`,
eg: '[{batch_denom: "100/2", tradable_units: "5", retired_units: "0", retirement_location: "YY-ZZ 12345"}]'
Note: "retirement_location" is only required when "retired_units" is positive.`,
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
var credits = []*ecocredit.MsgSendRequest_SendUnits{}
Expand All @@ -146,14 +148,20 @@ Parameters:

func txRetire() *cobra.Command {
return &cobra.Command{
Use: "retire [credits]",
Use: "retire [credits] [retirement_location]",
Short: "Retires a specified amounts of credits from the account of the transaction author (--from)",
Long: `Retires a specified amounts of credits from the account of the transaction author (--from)
Parameters:
credits: YAML encoded credit list. Note: numerical values must be written in strings.
eg: '[{batch_denom: "100/2", units: "5"}]'`,
Args: cobra.ExactArgs(1),
credits: YAML encoded credit list. Note: numerical values must be written in strings.
eg: '[{batch_denom: "100/2", units: "5"}]'
retirement_location: A string representing the location of the buyer or
beneficiary of retired credits. It has the form
<country-code>[-<region-code>[ <postal-code>]], where
country-code and region-code are taken from ISO 3166, and
postal-code being up to 64 alphanumeric characters.
eg: 'AA-BB 12345'`,
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
var credits = []*ecocredit.MsgRetireRequest_RetireUnits{}
if err := yaml.Unmarshal([]byte(args[0]), &credits); err != nil {
Expand All @@ -164,8 +172,9 @@ Parameters:
return err
}
msg := ecocredit.MsgRetireRequest{
Holder: clientCtx.GetFromAddress().String(),
Credits: credits,
Holder: clientCtx.GetFromAddress().String(),
Credits: credits,
Location: args[1],
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
Expand Down
Loading

0 comments on commit 81f1347

Please sign in to comment.