diff --git a/.changelog/unreleased/client-breaking/2158-fix-metadata-nav-example.md b/.changelog/unreleased/client-breaking/2158-fix-metadata-nav-example.md new file mode 100644 index 000000000..216351fcc --- /dev/null +++ b/.changelog/unreleased/client-breaking/2158-fix-metadata-nav-example.md @@ -0,0 +1,4 @@ +* Fixes the metadata nav cli command example to use the correct module name [#2058](https://github.com/provenance-io/provenance/issues/2058) + During this fix it was discovered that the volume parameter was not present but was required for proper price ratios. The volume + parameter has been added to the NAV entry and when not present a default value of 1 (which should be the most common case for a scope) is + used instead. \ No newline at end of file diff --git a/.changelog/unreleased/dependencies/2154-cosmossdk-io-x-tx-0-13-5.md b/.changelog/unreleased/dependencies/2154-cosmossdk-io-x-tx-0-13-5.md new file mode 100644 index 000000000..f4eaa8723 --- /dev/null +++ b/.changelog/unreleased/dependencies/2154-cosmossdk-io-x-tx-0-13-5.md @@ -0,0 +1 @@ +* `cosmossdk.io/x/tx` bumped to v0.13.5 (from v0.13.4) [PR 2154](https://github.com/provenance-io/provenance/pull/2154). diff --git a/.changelog/unreleased/dependencies/2155-bufbuild-buf-setup-action-1-42-0.md b/.changelog/unreleased/dependencies/2155-bufbuild-buf-setup-action-1-42-0.md new file mode 100644 index 000000000..4d7d8c0f4 --- /dev/null +++ b/.changelog/unreleased/dependencies/2155-bufbuild-buf-setup-action-1-42-0.md @@ -0,0 +1 @@ +* `bufbuild/buf-setup-action` bumped to 1.42.0 (from 1.41.0) [PR 2155](https://github.com/provenance-io/provenance/pull/2155). diff --git a/.changelog/unreleased/dependencies/2156-peter-evans-create-pull-request-7-0-5.md b/.changelog/unreleased/dependencies/2156-peter-evans-create-pull-request-7-0-5.md new file mode 100644 index 000000000..f3314497d --- /dev/null +++ b/.changelog/unreleased/dependencies/2156-peter-evans-create-pull-request-7-0-5.md @@ -0,0 +1 @@ +* `peter-evans/create-pull-request` bumped to 7.0.5 (from 7.0.2) [PR 2156](https://github.com/provenance-io/provenance/pull/2156). diff --git a/.changelog/unreleased/dependencies/2157-google-golang-org-grpc-1-67-0.md b/.changelog/unreleased/dependencies/2157-google-golang-org-grpc-1-67-0.md new file mode 100644 index 000000000..0400fb3e4 --- /dev/null +++ b/.changelog/unreleased/dependencies/2157-google-golang-org-grpc-1-67-0.md @@ -0,0 +1,7 @@ +* `cloud.google.com/go/compute/metadata` bumped to v0.5.0 (from v0.3.0) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). +* `github.com/golang/glog` bumped to v1.2.2 (from v1.2.1) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). +* `golang.org/x/oauth2` bumped to v0.22.0 (from v0.21.0) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). +* `golang.org/x/sys` bumped to v0.24.0 (from v0.23.0) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). +* `google.golang.org/genproto/googleapis/api` bumped to v0.0.0-20240814211410-ddb44dafa142 (from v0.0.0-20240604185151-ef581f913117) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). +* `google.golang.org/genproto/googleapis/rpc` bumped to v0.0.0-20240814211410-ddb44dafa142 (from v0.0.0-20240709173604-40e1e62336c5) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). +* `google.golang.org/grpc` bumped to v1.67.0 (from v1.66.2) [PR 2157](https://github.com/provenance-io/provenance/pull/2157). diff --git a/.changelog/unreleased/dependencies/2161-github-com-cosmwasm-wasmvm-v2-2-1-3.md b/.changelog/unreleased/dependencies/2161-github-com-cosmwasm-wasmvm-v2-2-1-3.md new file mode 100644 index 000000000..9118e949b --- /dev/null +++ b/.changelog/unreleased/dependencies/2161-github-com-cosmwasm-wasmvm-v2-2-1-3.md @@ -0,0 +1 @@ +* `github.com/CosmWasm/wasmvm/v2` bumped to v2.1.3 (from v2.1.2) [PR 2161](https://github.com/provenance-io/provenance/pull/2161). diff --git a/.changelog/unreleased/dependencies/2162-cosmossdk-io-api-0-7-6.md b/.changelog/unreleased/dependencies/2162-cosmossdk-io-api-0-7-6.md new file mode 100644 index 000000000..e375092c6 --- /dev/null +++ b/.changelog/unreleased/dependencies/2162-cosmossdk-io-api-0-7-6.md @@ -0,0 +1 @@ +* `cosmossdk.io/api` bumped to v0.7.6 (from v0.7.5) [PR 2162](https://github.com/provenance-io/provenance/pull/2162). diff --git a/.changelog/unreleased/dependencies/2164-bufbuild-buf-setup-action-1-43-0.md b/.changelog/unreleased/dependencies/2164-bufbuild-buf-setup-action-1-43-0.md new file mode 100644 index 000000000..e3760e0c5 --- /dev/null +++ b/.changelog/unreleased/dependencies/2164-bufbuild-buf-setup-action-1-43-0.md @@ -0,0 +1 @@ +* `bufbuild/buf-setup-action` bumped to 1.43.0 (from 1.42.0) [PR 2164](https://github.com/provenance-io/provenance/pull/2164). diff --git a/.changelog/unreleased/dependencies/2165-google-golang-org-grpc-1-67-1.md b/.changelog/unreleased/dependencies/2165-google-golang-org-grpc-1-67-1.md new file mode 100644 index 000000000..0043ce89e --- /dev/null +++ b/.changelog/unreleased/dependencies/2165-google-golang-org-grpc-1-67-1.md @@ -0,0 +1 @@ +* `google.golang.org/grpc` bumped to v1.67.1 (from v1.67.0) [PR 2165](https://github.com/provenance-io/provenance/pull/2165). diff --git a/.changelog/unreleased/improvements/2030-explicit-navs.md b/.changelog/unreleased/improvements/2030-explicit-navs.md new file mode 100644 index 000000000..f883e41a6 --- /dev/null +++ b/.changelog/unreleased/improvements/2030-explicit-navs.md @@ -0,0 +1 @@ +* Only set a NAV record when explicitly provided. [#2030](https://github.com/provenance-io/provenance/issues/2030). \ No newline at end of file diff --git a/.changelog/unreleased/improvements/2134-metadata-nav-doc.md b/.changelog/unreleased/improvements/2134-metadata-nav-doc.md new file mode 100644 index 000000000..14bcee167 --- /dev/null +++ b/.changelog/unreleased/improvements/2134-metadata-nav-doc.md @@ -0,0 +1 @@ +* Address missing documentation on metadata/scope nav command [#2134](https://github.com/provenance-io/provenance/issues/2134). \ No newline at end of file diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index b8e5049d1..ce75f8e23 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -30,7 +30,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Buf setup action - uses: bufbuild/buf-setup-action@v1.41.0 + uses: bufbuild/buf-setup-action@v1.43.0 - name: Buf push 'third_party/proto' uses: bufbuild/buf-push-action@v1 with: @@ -54,7 +54,7 @@ jobs: git commit -S -m "Update buf.lock to latest commit hash" - name: Create Pull Request id: cpr - uses: peter-evans/create-pull-request@v7.0.2 + uses: peter-evans/create-pull-request@v7.0.5 with: base: main branch: provenanceio-bot/patch-buf-lock diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 57ce99973..ddd52b448 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -40,7 +40,7 @@ jobs: fi echo "Setting output: base-branch=$branch" echo "base-branch=$branch" >> "$GITHUB_OUTPUT" - - uses: bufbuild/buf-setup-action@v1.41.0 + - uses: bufbuild/buf-setup-action@v1.43.0 - uses: bufbuild/buf-lint-action@v1.1.1 if: always() with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82a4b9755..a187d969c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -118,7 +118,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Buf setup action - uses: bufbuild/buf-setup-action@v1.41.0 + uses: bufbuild/buf-setup-action@v1.43.0 - name: Buf push 'proto/' uses: bufbuild/buf-push-action@v1 with: diff --git a/app/scope_navs_updater.go b/app/scope_navs_updater.go index 528627b90..2e17ff3eb 100644 --- a/app/scope_navs_updater.go +++ b/app/scope_navs_updater.go @@ -72,7 +72,7 @@ func ReadScopeNAVs(fileName string) ([]ScopeNAV, error) { asset := ScopeNAV{ ScopeUUID: scopeUUID, - NetAssetValue: metadatatypes.NewNetAssetValue(price), + NetAssetValue: metadatatypes.NewNetAssetValue(price, 1), Height: height, } diff --git a/app/scope_navs_updater_test.go b/app/scope_navs_updater_test.go index 5d22b6e87..bb796dfb4 100644 --- a/app/scope_navs_updater_test.go +++ b/app/scope_navs_updater_test.go @@ -23,12 +23,12 @@ func TestReadScopeNAVs(t *testing.T) { expCount: 1101, expFirst: ScopeNAV{ ScopeUUID: "2f389a9f-873d-4920-85a6-7734f27e1738", - NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 398820670)), + NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 398820670), 1), Height: 23056719, }, expLast: ScopeNAV{ ScopeUUID: "65939db0-6d7a-42ef-9443-378304d33225", - NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 93661920)), + NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 93661920), 1), Height: 23056719, }, }, @@ -37,12 +37,12 @@ func TestReadScopeNAVs(t *testing.T) { expCount: 215558, expFirst: ScopeNAV{ ScopeUUID: "b0b97639-5ecf-4808-b679-99c11a5cda47", - NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 47395000)), + NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 47395000), 1), Height: 14871216, }, expLast: ScopeNAV{ ScopeUUID: "98503480-12be-4142-bd9d-e80c6e017e22", - NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 43768160)), + NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 43768160), 1), Height: 9787583, }, }, diff --git a/go.mod b/go.mod index 2c30bdf44..34f728f80 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/provenance-io/provenance go 1.23 require ( - cosmossdk.io/api v0.7.5 + cosmossdk.io/api v0.7.6 cosmossdk.io/client/v2 v2.0.0-beta.4 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.11.2 @@ -14,10 +14,10 @@ require ( cosmossdk.io/x/circuit v0.1.1 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 - cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.3 github.com/CosmWasm/wasmd v0.52.0 - github.com/CosmWasm/wasmvm/v2 v2.1.2 + github.com/CosmWasm/wasmvm/v2 v2.1.3 github.com/cometbft/cometbft v0.38.12 github.com/cometbft/cometbft-db v0.11.0 github.com/cosmos/cosmos-db v1.0.2 @@ -42,15 +42,15 @@ require ( github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 golang.org/x/text v0.18.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 - google.golang.org/grpc v1.66.2 + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 + google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.34.2 sigs.k8s.io/yaml v1.4.0 ) require ( cloud.google.com/go v0.112.1 // indirect - cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.38.0 // indirect cosmossdk.io/depinject v1.0.0 // indirect @@ -105,7 +105,7 @@ require ( github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.2.1 // indirect + github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect @@ -191,14 +191,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.26.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect + golang.org/x/sys v0.24.0 // indirect golang.org/x/term v0.23.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.171.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 36311329f..1867205e3 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -182,8 +182,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= -cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= @@ -208,8 +208,8 @@ cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= -cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= -cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= +cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -221,8 +221,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= -github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/CosmWasm/wasmvm/v2 v2.1.3 h1:CSJTauZqkHyb9yic6JVYCjiGUgxI2MJV2QzfSu8m49c= +github.com/CosmWasm/wasmvm/v2 v2.1.3/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= @@ -500,8 +500,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= -github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= +github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -1228,8 +1228,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1346,8 +1346,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1620,10 +1620,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1665,8 +1665,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= -google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/proto/provenance/metadata/v1/events.proto b/proto/provenance/metadata/v1/events.proto index 6e487e02a..3e320faac 100644 --- a/proto/provenance/metadata/v1/events.proto +++ b/proto/provenance/metadata/v1/events.proto @@ -181,4 +181,5 @@ message EventSetNetAssetValue { string scope_id = 1; string price = 2; string source = 3; + string volume = 4; } \ No newline at end of file diff --git a/proto/provenance/metadata/v1/scope.proto b/proto/provenance/metadata/v1/scope.proto index 68bf9fa61..a09fd255e 100644 --- a/proto/provenance/metadata/v1/scope.proto +++ b/proto/provenance/metadata/v1/scope.proto @@ -229,4 +229,8 @@ message NetAssetValue { cosmos.base.v1beta1.Coin price = 1 [(gogoproto.nullable) = false]; // updated_block_height is the block height of last update uint64 updated_block_height = 2; + // volume is the number of scope instances that were purchased for the price + // Typically this will be null (equivalent to one) or one. The only reason this would be more than + // one is for cases where the precision of the price denom is insufficient to represent the actual price + uint64 volume = 3; } diff --git a/x/marker/keeper/marker.go b/x/marker/keeper/marker.go index dc884a0ef..89650b6f4 100644 --- a/x/marker/keeper/marker.go +++ b/x/marker/keeper/marker.go @@ -447,9 +447,6 @@ func (k Keeper) FinalizeMarker(ctx sdk.Context, caller sdk.Address, denom string if err != nil { return err } - if len(navs) == 0 { - return fmt.Errorf("marker %v does not have any net asset values assigned", denom) - } // transition to finalized state ... then to active once mint is complete if err = m.SetStatus(types.StatusFinalized); err != nil { diff --git a/x/marker/keeper/msg_server.go b/x/marker/keeper/msg_server.go index 6ad2d6184..02f3091e0 100644 --- a/x/marker/keeper/msg_server.go +++ b/x/marker/keeper/msg_server.go @@ -114,12 +114,17 @@ func (k msgServer) AddMarker(goCtx context.Context, msg *types.MsgAddMarkerReque return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) } - usdMills := sdkmath.NewIntFromUint64(msg.UsdMills) - nav := types.NewNetAssetValue(sdk.NewCoin(types.UsdDenom, usdMills), msg.Volume) - err = k.AddSetNetAssetValues(ctx, ma, []types.NetAssetValue{nav}, types.ModuleName) - if err != nil { - return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) + // Only create a NAV entry if an explicit value is given for a NAV. If a zero value is desired this can be set explicitly in a followup call. + // This check prevents a proliferation of incorrect NAV entries being recorded when setting up markers. + if msg.UsdMills > 0 { + usdMills := sdkmath.NewIntFromUint64(msg.UsdMills) + nav := types.NewNetAssetValue(sdk.NewCoin(types.UsdDenom, usdMills), msg.Volume) + err = k.AddSetNetAssetValues(ctx, ma, []types.NetAssetValue{nav}, types.ModuleName) + if err != nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) + } } + // Note: The status can only be Active if this is being done via gov prop. if ma.Status == types.StatusActive { // Active markers should have supply set. @@ -517,10 +522,14 @@ func (k msgServer) AddFinalizeActivateMarker(goCtx context.Context, msg *types.M normalizedReqAttrs, ) - usdMills := sdkmath.NewIntFromUint64(msg.UsdMills) - err = k.AddSetNetAssetValues(ctx, ma, []types.NetAssetValue{types.NewNetAssetValue(sdk.NewCoin(types.UsdDenom, usdMills), msg.Volume)}, types.ModuleName) - if err != nil { - return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) + // Only create a NAV entry if an explicit value is given for a NAV. If a zero value is desired this can be set explicitly in a followup call. + // This check prevents a proliferation of incorrect NAV entries being recorded when setting up markers. + if msg.UsdMills > 0 { + usdMills := sdkmath.NewIntFromUint64(msg.UsdMills) + err = k.AddSetNetAssetValues(ctx, ma, []types.NetAssetValue{types.NewNetAssetValue(sdk.NewCoin(types.UsdDenom, usdMills), msg.Volume)}, types.ModuleName) + if err != nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) + } } if err := k.Keeper.AddFinalizeAndActivateMarker(ctx, ma); err != nil { diff --git a/x/marker/keeper/msg_server_test.go b/x/marker/keeper/msg_server_test.go index 9b1ab589c..e260f8535 100644 --- a/x/marker/keeper/msg_server_test.go +++ b/x/marker/keeper/msg_server_test.go @@ -108,12 +108,6 @@ func (s *MsgServerTestSuite) TestMsgAddMarkerRequest() { Manager: s.owner1, MarkerType: types.MarkerType_Coin.String(), }, - &types.EventSetNetAssetValue{ - Denom: denom, - Price: "0usd", - Volume: "0", - Source: types.ModuleName, - }, }, }, { @@ -212,12 +206,6 @@ func (s *MsgServerTestSuite) TestMsgAddMarkerRequest() { Manager: s.owner1, MarkerType: types.MarkerType_Coin.String(), }, - &types.EventSetNetAssetValue{ - Denom: denomWithDashPeriod, - Price: "0usd", - Volume: "0", - Source: types.ModuleName, - }, }, }, { @@ -242,12 +230,6 @@ func (s *MsgServerTestSuite) TestMsgAddMarkerRequest() { Manager: s.owner1, MarkerType: types.MarkerType_RestrictedCoin.String(), }, - &types.EventSetNetAssetValue{ - Denom: rdenom, - Price: "0usd", - Volume: "0", - Source: types.ModuleName, - }, }, }, } @@ -311,11 +293,6 @@ func (s *MsgServerTestSuite) TestMsgFinalizeMarkerRequest() { msg types.MsgFinalizeRequest expErr string }{ - { - name: "marker does not have net asset value", - msg: types.MsgFinalizeRequest{Denom: noNavMarker.Denom, Administrator: authUser.String()}, - expErr: "marker nonav does not have any net asset values assigned: invalid request", - }, { name: "successfully finalize", msg: types.MsgFinalizeRequest{Denom: validMarker.Denom, Administrator: authUser.String()}, diff --git a/x/metadata/client/cli/cli_test.go b/x/metadata/client/cli/cli_test.go index 19fc2b51a..ded2b5f24 100644 --- a/x/metadata/client/cli/cli_test.go +++ b/x/metadata/client/cli/cli_test.go @@ -3860,7 +3860,7 @@ func (s *IntegrationCLITestSuite) TestGetCmdAddNetAssetValues() { }, { name: "successful with multi net asset values", - args: argsWStdFlags(scopeID, "1usd,2jackthecat"), + args: argsWStdFlags(scopeID, "1usd;2jackthecat"), }, } @@ -3924,17 +3924,29 @@ func (s *IntegrationCLITestSuite) TestParseNetAssertValueString() { expErr: "invalid net asset value coin : notacoin", expResult: []types.NetAssetValue{}, }, + { + name: "invalid volume (previous format of comma separated coins is invalid)", + netAssetValues: "1hotdog,5cheesedog", + expErr: "invalid volume : 5cheesedog", + expResult: []types.NetAssetValue{}, + }, { name: "successfully parse single nav", + netAssetValues: "1hotdog,10", + expErr: "", + expResult: []types.NetAssetValue{{Price: sdk.NewInt64Coin("hotdog", 1), Volume: 10}}, + }, + { + name: "successfully parse single nav (no volume)", netAssetValues: "1hotdog", expErr: "", - expResult: []types.NetAssetValue{{Price: sdk.NewInt64Coin("hotdog", 1)}}, + expResult: []types.NetAssetValue{{Price: sdk.NewInt64Coin("hotdog", 1), Volume: 1}}, }, { name: "successfully parse multi nav", - netAssetValues: "1hotdog,20jackthecat", + netAssetValues: "1hotdog,20;20jackthecat", expErr: "", - expResult: []types.NetAssetValue{{Price: sdk.NewInt64Coin("hotdog", 1)}, {Price: sdk.NewInt64Coin("jackthecat", 20)}}, + expResult: []types.NetAssetValue{{Price: sdk.NewInt64Coin("hotdog", 1), Volume: 20}, {Price: sdk.NewInt64Coin("jackthecat", 20), Volume: 1}}, }, } for _, tc := range testCases { diff --git a/x/metadata/client/cli/tx.go b/x/metadata/client/cli/tx.go index e89e87a49..1c5357d5b 100644 --- a/x/metadata/client/cli/tx.go +++ b/x/metadata/client/cli/tx.go @@ -2,7 +2,9 @@ package cli import ( "encoding/base64" + "errors" "fmt" + "strconv" "strings" "github.com/google/uuid" @@ -1190,11 +1192,47 @@ $ %[1]s tx metadata account-data %[2]s --%[5]s // GetCmdAddNetAssetValues returns a CLI command for adding/updating scopes net asset values. func GetCmdAddNetAssetValues() *cobra.Command { cmd := &cobra.Command{ - Use: "add-net-asset-values " + attrcli.AccountDataFlagsUse, - Aliases: []string{"add-navs", "anavs"}, - Short: "Add/updates net asset values for a scope", - Example: fmt.Sprintf(`$ %[1]s tx marker add-net-asset-values scope1234... 1usd,1;2nhash,3`, - version.AppName), + Use: "add-net-asset-values ", + Aliases: []string{"add-nav", "nav"}, + Short: "Provide net asset value for a scope", + Long: ` +Provide net asset valuation for a scope. Net asset values are used to establish +the relative value of the digital asset in relation to other assets or currencies. + +Net asset values are expressed as a ratio between an amount of coin paid (price) +and the scope (generally one) which are considered equivalent in value. + +The denomination of the amount paid (price) must either: + + 1) Exist on-chain as a marker, or + 2) Be supplied as [1000usd], an integer valued in mils (1000 mils = $1 USD). + +IMPORTANT: The net asset value contains a volume which should be set to one +in almost all cases. All values must be represented as whole integers. If a +decimal value is required, adjust the ratio between the price and volume as the +least common denominator to achieve the desired precision. +`, + Example: fmt.Sprintf(` + Set a value of $1 (Note USD is denominated in mils) + $ %[1]s tx %[2]s add-net-asset-values %[3]s 1000usd + + Set a value of $1 (Note USD is denominated in mils) and include optional volume + $ %[1]s tx %[2]s add-net-asset-values %[3]s 1000usd,1 + + Provide more than one valuation in a single call + $ %[1]s tx %[2]s add-net-asset-values %[3]s 1000usd;5000000000nhash,1 + + Valuation for asset with volumes greater than 1 to adjust for high value price denom + $ %[1]s tx %[2]s add-net-asset-values %[3]s 1btc,60000 + + Note: When the valuations are recorded, each will indicate the address of the admin + who provided the value. This will be published in the associated event data and + captured in the NAV record. For NAVs set by other modules such as x/exchange the + protocol will indicate these sources. This separates established values from + the owner (self-attestation) from those set through blockchain transactions. + `, + version.AppName, types.ModuleName, "scope1qzhp...tsk0cn"), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -1264,19 +1302,31 @@ func validateAccAddress(addr, argName string) (string, error) { return addr, nil } -// ParseNetAssetValueString splits string (example 1hotdog,2jackthecat) to list of NetAssetValue's +// ParseNetAssetValueString splits string (example 1hotdog,1;2jackthecat100,...) to list of NetAssetValue's func ParseNetAssetValueString(netAssetValuesString string) ([]types.NetAssetValue, error) { - navs := strings.Split(netAssetValuesString, ",") + navs := strings.Split(netAssetValuesString, ";") if len(navs) == 1 && len(navs[0]) == 0 { return []types.NetAssetValue{}, nil } netAssetValues := make([]types.NetAssetValue, len(navs)) for i, nav := range navs { - coin, err := sdk.ParseCoinNormalized(nav) + parts := strings.Split(nav, ",") + if len(parts) != 1 && len(parts) != 2 { + return []types.NetAssetValue{}, errors.New("invalid net asset value, expected [coin,volume] or [coin]") + } + coin, err := sdk.ParseCoinNormalized(parts[0]) if err != nil { - return []types.NetAssetValue{}, fmt.Errorf("invalid net asset value coin : %s", nav) + return []types.NetAssetValue{}, fmt.Errorf("invalid net asset value coin : %s", parts[0]) + } + if len(parts) == 2 { + volume, err := strconv.ParseUint(parts[1], 10, 64) + if err != nil || volume < 1 { + return []types.NetAssetValue{}, fmt.Errorf("invalid volume : %s", parts[1]) + } + netAssetValues[i] = types.NewNetAssetValue(coin, volume) + } else { + netAssetValues[i] = types.NewNetAssetValue(coin, 1) } - netAssetValues[i] = types.NewNetAssetValue(coin) } return netAssetValues, nil } diff --git a/x/metadata/keeper/genesis.go b/x/metadata/keeper/genesis.go index f2607b393..1fb9c2a0c 100644 --- a/x/metadata/keeper/genesis.go +++ b/x/metadata/keeper/genesis.go @@ -67,7 +67,12 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) { if err != nil { panic(err) } - err = k.SetNetAssetValue(ctx, address, types.NewNetAssetValue(nav.Price), types.ModuleName) + // Extra guard here in case volume is null or invalid + volume := nav.GetVolume() + if volume < 1 { + volume = 1 + } + err = k.SetNetAssetValue(ctx, address, types.NewNetAssetValue(nav.Price, volume), types.ModuleName) if err != nil { panic(err) } diff --git a/x/metadata/keeper/msg_server.go b/x/metadata/keeper/msg_server.go index ca019ba1b..69d1c5c23 100644 --- a/x/metadata/keeper/msg_server.go +++ b/x/metadata/keeper/msg_server.go @@ -46,11 +46,16 @@ func (k msgServer) WriteScope( return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) } - usdMills := sdkmath.NewIntFromUint64(msg.UsdMills) - nav := types.NewNetAssetValue(sdk.NewCoin(types.UsdDenom, usdMills)) - err := k.AddSetNetAssetValues(ctx, msg.Scope.ScopeId, []types.NetAssetValue{nav}, types.ModuleName) - if err != nil { - return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) + // Do not set a NAV entry at this time unless a value greater than zero is specified. This avoids the common case of + // not having a NAV entry value at hand during a scope write request. A zero value can still be set explicitly with + // an add NAV call made separately. + if msg.UsdMills > 0 { + usdMills := sdkmath.NewIntFromUint64(msg.UsdMills) + nav := types.NewNetAssetValue(sdk.NewCoin(types.UsdDenom, usdMills), 1) + err := k.AddSetNetAssetValues(ctx, msg.Scope.ScopeId, []types.NetAssetValue{nav}, types.ModuleName) + if err != nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error()) + } } k.SetScope(ctx, msg.Scope) diff --git a/x/metadata/keeper/scope.go b/x/metadata/keeper/scope.go index c2c017db9..9fd8ce571 100644 --- a/x/metadata/keeper/scope.go +++ b/x/metadata/keeper/scope.go @@ -701,7 +701,12 @@ func (k Keeper) SetNetAssetValue(ctx sdk.Context, scopeID types.MetadataAddress, return err } - setNetAssetValueEvent := types.NewEventSetNetAssetValue(scopeID, netAssetValue.Price, source) + // Since this field was added we need to ensure the default value matches the previous behavior of always presuming one is used. + if netAssetValue.Volume < 1 { + netAssetValue.Volume = 1 + } + + setNetAssetValueEvent := types.NewEventSetNetAssetValue(scopeID, netAssetValue.Price, netAssetValue.Volume, source) if err := ctx.EventManager().EmitTypedEvent(setNetAssetValueEvent); err != nil { return err } @@ -757,7 +762,7 @@ func (k Keeper) SetNetAssetValueWithBlockHeight(ctx sdk.Context, scopeID types.M return err } - setNetAssetValueEvent := types.NewEventSetNetAssetValue(scopeID, netAssetValue.Price, source) + setNetAssetValueEvent := types.NewEventSetNetAssetValue(scopeID, netAssetValue.Price, netAssetValue.Volume, source) if err := ctx.EventManager().EmitTypedEvent(setNetAssetValueEvent); err != nil { return err } diff --git a/x/metadata/keeper/scope_test.go b/x/metadata/keeper/scope_test.go index ccb03b0d9..2ed635bc2 100644 --- a/x/metadata/keeper/scope_test.go +++ b/x/metadata/keeper/scope_test.go @@ -2550,7 +2550,7 @@ func (s *ScopeKeeperTestSuite) TestSetNetAssetValue() { var expErrs []string var expEvents sdk.Events if len(tc.expErr) == 0 { - event := types.NewEventSetNetAssetValue(scopeID, tc.netAssetValue.Price, "test") + event := types.NewEventSetNetAssetValue(scopeID, tc.netAssetValue.Price, 1, "test") eventU, err := sdk.TypedEventToEvent(event) s.Require().NoError(err, "TypedEventToEvent(NewEventSetNetAssetValue)") expEvents = sdk.Events{eventU} @@ -2588,6 +2588,7 @@ func (s *ScopeKeeperTestSuite) TestRemoveNetAssetValues() { Denom: "usd", Amount: sdkmath.NewInt(1000), }, + Volume: 1, }, expErr: "", }, @@ -2605,7 +2606,7 @@ func (s *ScopeKeeperTestSuite) TestRemoveNetAssetValues() { }) s.Require().NoError(err, "IterateNetAssetValues err") s.Require().Len(netAssetValues, 1, "Should have added a NAV") - s.Require().Equal(tc.netAssetValue, netAssetValues[0], "Should have added the test case nave.") + s.Require().Equal(tc.netAssetValue, netAssetValues[0], "Should have added the test case nav.") s.app.MetadataKeeper.RemoveNetAssetValues(ctx, tc.scopeID) netAssetValues = []types.NetAssetValue{} err = s.app.MetadataKeeper.IterateNetAssetValues(ctx, tc.scopeID, func(state types.NetAssetValue) (stop bool) { diff --git a/x/metadata/spec/06_events.md b/x/metadata/spec/06_events.md index 37b36e556..ae87bfb4e 100644 --- a/x/metadata/spec/06_events.md +++ b/x/metadata/spec/06_events.md @@ -9,6 +9,7 @@ The metadata module emits the following events and telemetry information. - [EventScopeCreated](#eventscopecreated) - [EventScopeUpdated](#eventscopeupdated) - [EventScopeDeleted](#eventscopedeleted) + - [EventSetNetAssetValue](#eventsetnetassetvalue) - [Session](#session) - [EventSessionCreated](#eventsessioncreated) - [EventSessionUpdated](#eventsessionupdated) @@ -75,6 +76,25 @@ This event is emitted whenever an existing scope is deleted. | --------------------- | ------------------------------------------------- | | ScopeAddr | The bech32 address string of the ScopeId | +### EventSetNetAssetValue + +This event is emitted whenever a `NetAssetValue` is added or updated for +a scope. The Price is the value assigned to the scope and volume indicates +if the price should be divided. + +Note: Generally the volume should be set to one however if the units of the +price token are not sufficiently precise the volume can be used to define a +ratio of integers to represent the decimal. + +Type: `provenance.metadata.v1.EventSetNetAssetValue` + +| Attribute Key | Attribute Value | +|---------------|-----------------------------------------------------------| +| ScopeId | The bech32 address string of the ScopeId | +| Price | Token amount the scope is valued at for volume | +| Source | Source address of caller or module name | +| Volume | Total volume associated with price (typically 1) | + --- ## Session diff --git a/x/metadata/types/events.go b/x/metadata/types/events.go index 85373f4a4..885864dc4 100644 --- a/x/metadata/types/events.go +++ b/x/metadata/types/events.go @@ -1,6 +1,8 @@ package types import ( + "strconv" + "github.com/hashicorp/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" @@ -277,10 +279,11 @@ func NewEventOSLocatorDeleted(owner string) *EventOSLocatorDeleted { } // NewEventSetNetAssetValue returns a new instance of EventSetNetAssetValue -func NewEventSetNetAssetValue(scopeID MetadataAddress, price sdk.Coin, source string) *EventSetNetAssetValue { +func NewEventSetNetAssetValue(scopeID MetadataAddress, price sdk.Coin, volume uint64, source string) *EventSetNetAssetValue { return &EventSetNetAssetValue{ ScopeId: scopeID.String(), Price: price.String(), Source: source, + Volume: strconv.FormatUint(volume, 10), } } diff --git a/x/metadata/types/events.pb.go b/x/metadata/types/events.pb.go index 973e3ab98..7f19e0b73 100644 --- a/x/metadata/types/events.pb.go +++ b/x/metadata/types/events.pb.go @@ -1168,6 +1168,7 @@ type EventSetNetAssetValue struct { ScopeId string `protobuf:"bytes,1,opt,name=scope_id,json=scopeId,proto3" json:"scope_id,omitempty"` Price string `protobuf:"bytes,2,opt,name=price,proto3" json:"price,omitempty"` Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` + Volume string `protobuf:"bytes,4,opt,name=volume,proto3" json:"volume,omitempty"` } func (m *EventSetNetAssetValue) Reset() { *m = EventSetNetAssetValue{} } @@ -1224,6 +1225,13 @@ func (m *EventSetNetAssetValue) GetSource() string { return "" } +func (m *EventSetNetAssetValue) GetVolume() string { + if m != nil { + return m.Volume + } + return "" +} + func init() { proto.RegisterType((*EventTxCompleted)(nil), "provenance.metadata.v1.EventTxCompleted") proto.RegisterType((*EventScopeCreated)(nil), "provenance.metadata.v1.EventScopeCreated") @@ -1255,42 +1263,43 @@ func init() { } var fileDescriptor_476cf6cf9459cf25 = []byte{ - // 556 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0x13, 0x7d, 0x6d, 0x73, 0xfb, 0x2d, 0xc0, 0x40, 0x70, 0x40, 0xb8, 0x3f, 0x6c, 0xba, - 0xa9, 0xad, 0x02, 0x0b, 0xc4, 0x02, 0xa9, 0x04, 0x16, 0x48, 0x08, 0x50, 0x52, 0x40, 0xea, 0x86, - 0x4e, 0x67, 0x2e, 0x65, 0x44, 0xe2, 0xb1, 0x66, 0x26, 0x69, 0x79, 0x0b, 0x5e, 0x80, 0xf7, 0x61, - 0xd9, 0x25, 0x4b, 0x94, 0xbc, 0x08, 0xf2, 0x78, 0x86, 0xb8, 0x8d, 0x8b, 0x81, 0x50, 0x60, 0x79, - 0x66, 0xee, 0x39, 0xe7, 0xde, 0xe3, 0x9b, 0x68, 0xe0, 0x66, 0x2a, 0xc5, 0x08, 0x13, 0x92, 0x50, - 0x8c, 0x07, 0xa8, 0x09, 0x23, 0x9a, 0xc4, 0xa3, 0xad, 0x18, 0x47, 0x98, 0x68, 0x15, 0xa5, 0x52, - 0x68, 0xe1, 0xb7, 0xa6, 0x45, 0x91, 0x2b, 0x8a, 0x46, 0x5b, 0xeb, 0x7b, 0x70, 0xe1, 0x51, 0x56, - 0xb7, 0x73, 0xd4, 0x11, 0x83, 0xb4, 0x8f, 0x1a, 0x99, 0xdf, 0x82, 0x85, 0x81, 0x60, 0xc3, 0x3e, - 0x06, 0xde, 0xaa, 0xb7, 0xd1, 0xec, 0x5a, 0xe4, 0x5f, 0x83, 0x25, 0x4c, 0x58, 0x2a, 0x78, 0xa2, - 0x83, 0xba, 0xb9, 0xf9, 0x86, 0xfd, 0x00, 0x16, 0x15, 0x3f, 0x48, 0x50, 0xaa, 0xa0, 0xb1, 0xda, - 0xd8, 0x68, 0x76, 0x1d, 0x5c, 0xbf, 0x05, 0x17, 0x8d, 0x43, 0x8f, 0x8a, 0x14, 0x3b, 0x12, 0x49, - 0x66, 0x71, 0x03, 0x40, 0x65, 0xf8, 0x35, 0x61, 0x4c, 0x5a, 0x9b, 0xa6, 0x39, 0xd9, 0x66, 0x4c, - 0x9e, 0xe4, 0xbc, 0x48, 0xd9, 0x4f, 0x73, 0x1e, 0x62, 0x3e, 0x4a, 0x05,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 0xd9, 0xdf, 0x26, 0x5c, 0x31, 0xed, 0x3d, 0xeb, 0x3d, 0x11, 0x94, 0x68, 0x21, 0xdd, 0x47, - 0xbd, 0x0c, 0xff, 0x89, 0xc3, 0x04, 0x5d, 0x03, 0x39, 0x98, 0x2d, 0x77, 0x19, 0xff, 0x60, 0xb9, - 0x1b, 0xb9, 0xbc, 0x7c, 0xcf, 0x96, 0xf7, 0x50, 0x3f, 0x45, 0xbd, 0xad, 0x14, 0xea, 0x97, 0xa4, - 0x3f, 0x44, 0xbf, 0x0d, 0x4b, 0xf9, 0xcf, 0x9d, 0x33, 0xcb, 0x58, 0x34, 0xf8, 0xb1, 0x51, 0x4a, - 0x25, 0xa7, 0x68, 0x47, 0xcd, 0x41, 0xf6, 0x6c, 0x50, 0x62, 0x28, 0x29, 0xda, 0x3f, 0x45, 0x8b, - 0x1e, 0xbc, 0xfb, 0x34, 0x0e, 0xbd, 0xe3, 0x71, 0xe8, 0x7d, 0x19, 0x87, 0xde, 0x87, 0x49, 0x58, - 0x3b, 0x9e, 0x84, 0xb5, 0xcf, 0x93, 0xb0, 0x06, 0x6d, 0x2e, 0xa2, 0xf2, 0x77, 0xc9, 0x73, 0x6f, - 0xf7, 0xce, 0x01, 0xd7, 0x6f, 0x87, 0xfb, 0x11, 0x15, 0x83, 0x78, 0x5a, 0xb4, 0xc9, 0x45, 0x01, - 0xc5, 0x47, 0xd3, 0x17, 0x8f, 0x7e, 0x9f, 0xa2, 0xda, 0x5f, 0x30, 0xcf, 0x9d, 0xdb, 0x5f, 0x03, - 0x00, 0x00, 0xff, 0xff, 0xaa, 0xcf, 0x7c, 0x06, 0x15, 0x09, 0x00, 0x00, + // 565 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4d, 0x6f, 0x13, 0x31, + 0x10, 0xcd, 0x26, 0xd0, 0x36, 0x53, 0x0e, 0xb0, 0x40, 0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, 0x3e, 0x1f, 0xf4, 0x59, 0x9d, 0xcf, 0x7f, 0xa3, 0xff, 0x39, + 0xdf, 0x26, 0x5c, 0x35, 0xe3, 0x3d, 0xef, 0x3c, 0x15, 0x94, 0x68, 0x21, 0xfd, 0x47, 0xbd, 0x02, + 0xe7, 0xc5, 0x41, 0x82, 0x7e, 0x00, 0x0b, 0xa6, 0xdb, 0x7d, 0xc6, 0xbf, 0xd8, 0xee, 0xaf, 0x3c, + 0xbb, 0x7d, 0xe8, 0xda, 0x3b, 0xa8, 0x9f, 0xa1, 0xde, 0x56, 0x0a, 0xf5, 0x2b, 0xd2, 0xed, 0x63, + 0x58, 0x87, 0x25, 0xfb, 0x73, 0xe7, 0xcc, 0x31, 0x16, 0x0d, 0x7e, 0x62, 0x94, 0x52, 0xc9, 0x29, + 0xba, 0xab, 0x5a, 0x90, 0x3d, 0x1b, 0x94, 0xe8, 0x4b, 0x8a, 0xee, 0x4f, 0xd1, 0xa1, 0xac, 0x3e, + 0x10, 0xdd, 0x7e, 0x0f, 0xa3, 0x73, 0xb6, 0x6e, 0xd1, 0xc3, 0x0f, 0x5f, 0x46, 0x71, 0x70, 0x38, + 0x8a, 0x83, 0x6f, 0xa3, 0x38, 0xf8, 0x34, 0x8e, 0x4b, 0x87, 0xe3, 0xb8, 0xf4, 0x75, 0x1c, 0x97, + 0xa0, 0xce, 0x45, 0x63, 0xf6, 0x7b, 0xe5, 0x45, 0xb0, 0x7b, 0x77, 0x9f, 0xeb, 0xf7, 0xfd, 0xbd, + 0x06, 0x15, 0xbd, 0xe6, 0xa4, 0x69, 0x93, 0x8b, 0x1c, 0x6a, 0x0e, 0x27, 0x2f, 0x21, 0xfd, 0x31, + 0x45, 0xb5, 0xb7, 0x60, 0x9e, 0x41, 0x77, 0xbe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xd9, 0xf3, + 0xfa, 0x2d, 0x09, 0x00, 0x00, } func (m *EventTxCompleted) Marshal() (dAtA []byte, err error) { @@ -2066,6 +2075,13 @@ func (m *EventSetNetAssetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Volume) > 0 { + i -= len(m.Volume) + copy(dAtA[i:], m.Volume) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Volume))) + i-- + dAtA[i] = 0x22 + } if len(m.Source) > 0 { i -= len(m.Source) copy(dAtA[i:], m.Source) @@ -2459,6 +2475,10 @@ func (m *EventSetNetAssetValue) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } + l = len(m.Volume) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -4813,6 +4833,38 @@ func (m *EventSetNetAssetValue) Unmarshal(dAtA []byte) error { } m.Source = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volume = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/x/metadata/types/scope.go b/x/metadata/types/scope.go index df9d12403..fe90bbbb9 100644 --- a/x/metadata/types/scope.go +++ b/x/metadata/types/scope.go @@ -585,9 +585,10 @@ s2Loop: } // NewNetAssetValue returns a new instance of NetAssetValue -func NewNetAssetValue(price sdk.Coin) NetAssetValue { +func NewNetAssetValue(price sdk.Coin, volume uint64) NetAssetValue { return NetAssetValue{ - Price: price, + Price: price, + Volume: volume, } } diff --git a/x/metadata/types/scope.pb.go b/x/metadata/types/scope.pb.go index 796b4e204..ac418b3b1 100644 --- a/x/metadata/types/scope.pb.go +++ b/x/metadata/types/scope.pb.go @@ -758,6 +758,10 @@ type NetAssetValue struct { Price types.Coin `protobuf:"bytes,1,opt,name=price,proto3" json:"price"` // updated_block_height is the block height of last update UpdatedBlockHeight uint64 `protobuf:"varint,2,opt,name=updated_block_height,json=updatedBlockHeight,proto3" json:"updated_block_height,omitempty"` + // volume is the number of scope instances that were purchased for the price + // Typically this will be null (equivalent to one) or one. The only reason this would be more than + // one is for cases where the precision of the price denom is insufficient to represent the actual price + Volume uint64 `protobuf:"varint,3,opt,name=volume,proto3" json:"volume,omitempty"` } func (m *NetAssetValue) Reset() { *m = NetAssetValue{} } @@ -807,6 +811,13 @@ func (m *NetAssetValue) GetUpdatedBlockHeight() uint64 { return 0 } +func (m *NetAssetValue) GetVolume() uint64 { + if m != nil { + return m.Volume + } + return 0 +} + func init() { proto.RegisterEnum("provenance.metadata.v1.RecordInputStatus", RecordInputStatus_name, RecordInputStatus_value) proto.RegisterEnum("provenance.metadata.v1.ResultStatus", ResultStatus_name, ResultStatus_value) @@ -826,78 +837,79 @@ func init() { } var fileDescriptor_edeea634bfb18aba = []byte{ - // 1126 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xf6, 0xf8, 0xdf, 0x65, 0x2f, 0xeb, 0xed, 0x8d, 0x82, 0x63, 0x88, 0x6d, 0x0c, 0x07, 0x13, - 0x89, 0xf1, 0xc6, 0xb0, 0x48, 0x2c, 0x20, 0x64, 0xe7, 0x87, 0x58, 0x2c, 0x89, 0x35, 0x4e, 0x38, - 0x70, 0x19, 0x8d, 0x67, 0x3a, 0xf6, 0x28, 0xf6, 0xf4, 0x30, 0xdd, 0xe3, 0x8d, 0xe1, 0xc2, 0x39, - 0xa7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0xb2, 0x3c, 0x4c, 0xa9, 0x96, 0x12, 0xc0, 0xb6, 0x85, 0x5a, - 0x90, 0x5f, 0x58, 0x94, 0xe7, 0x46, 0x6f, 0xce, 0xbd, 0xbf, 0x90, 0xd0, 0xb6, 0xd0, 0xc7, 0x90, - 0x24, 0xcf, 0x1c, 0xec, 0xd1, 0x42, 0xac, 0x12, 0xab, 0x65, 0x1b, 0xeb, 0xea, 0x72, 0x3e, 0xd5, - 0x8e, 0xe1, 0xb1, 0x49, 0x2b, 0xce, 0x17, 0xd6, 0x64, 0x0a, 0x2a, 0x43, 0x96, 0x87, 0x75, 0xc3, - 0x34, 0x31, 0xa5, 0x85, 0x78, 0x25, 0x56, 0xcb, 0x68, 0x20, 0xea, 0x09, 0x0f, 0x52, 0xe1, 0xe1, - 0xd8, 0x18, 0xfa, 0x58, 0x17, 0x09, 0xba, 0x11, 0x74, 0x51, 0x48, 0x54, 0x94, 0x5a, 0x46, 0x7b, - 0x20, 0x42, 0x07, 0x3c, 0x22, 0xdb, 0x43, 0x8f, 0x60, 0xc5, 0xc3, 0xdf, 0xf8, 0xb6, 0x87, 0x75, - 0x97, 0xd7, 0xd3, 0x3d, 0x32, 0x1c, 0xfa, 0x6e, 0x21, 0x59, 0x51, 0x6a, 0x69, 0x0d, 0xc9, 0x98, - 0x68, 0x45, 0x13, 0x91, 0x27, 0xe9, 0x1f, 0x7f, 0x2a, 0x47, 0xbe, 0xff, 0xb3, 0xa2, 0x54, 0x7f, - 0x89, 0x42, 0xaa, 0x8b, 0x29, 0xb5, 0x89, 0x83, 0x3e, 0x04, 0xa0, 0xc1, 0xe7, 0x2d, 0xf8, 0xcc, - 0x48, 0xe8, 0xff, 0xc4, 0xe8, 0xa7, 0x90, 0xe2, 0xbd, 0xdb, 0xf8, 0x4e, 0x94, 0x86, 0x39, 0x08, - 0x41, 0xdc, 0x31, 0x46, 0xb8, 0x10, 0x17, 0x1c, 0x89, 0x6f, 0x54, 0x80, 0x94, 0x49, 0x1c,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17, 0xea, 0x4d, - 0x02, 0xd9, 0x69, 0x19, 0xe9, 0x69, 0x4d, 0x78, 0x1d, 0xdf, 0xb5, 0x66, 0x75, 0x62, 0x77, 0xa9, - 0x23, 0x33, 0xc3, 0x3a, 0xe1, 0x42, 0xbd, 0x89, 0x54, 0x45, 0x46, 0x7a, 0x5a, 0x82, 0xd2, 0x31, - 0xf6, 0xf8, 0x1d, 0x22, 0x74, 0x71, 0x4f, 0x0b, 0x4d, 0x1e, 0x19, 0x61, 0x4a, 0x8d, 0x3e, 0x16, - 0xa7, 0x2f, 0xa3, 0x85, 0x66, 0xf5, 0x14, 0xee, 0xed, 0x63, 0xd6, 0xa4, 0x14, 0xb3, 0xaf, 0xf8, - 0xa3, 0x82, 0x1e, 0x43, 0xc2, 0xf5, 0x6c, 0x33, 0x64, 0x63, 0x4d, 0x0d, 0xfe, 0x06, 0x54, 0xfe, - 0x37, 0xa0, 0xca, 0xbf, 0x01, 0x75, 0x8b, 0xd8, 0x8e, 0x3c, 0xea, 0x01, 0x9a, 0xbf, 0x3f, 0xd3, - 0xd6, 0x86, 0xc4, 0x3c, 0xd1, 0x07, 0xd8, 0xee, 0x0f, 0x98, 0x20, 0x23, 0xae, 0xa1, 0xb0, 0x49, - 0x1e, 0xda, 0x13, 0x91, 0x8d, 0x9f, 0x15, 0x78, 0x70, 0x45, 0x9f, 0xe8, 0x11, 0x94, 0xb5, 0x9d, - 0xad, 0x03, 0x6d, 0x5b, 0x6f, 0xef, 0x77, 0x8e, 0x0e, 0xf5, 0xee, 0x61, 0xf3, 0xf0, 0xa8, 0xab, - 0x1f, 0xed, 0x77, 0x3b, 0x3b, 0x5b, 0xed, 0xdd, 0xf6, 0xce, 0x76, 0x3e, 0x52, 0xcc, 0x9e, 0x9d, - 0x57, 0x52, 0x47, 0xce, 0x89, 0x43, 0x9e, 0x39, 0x48, 0x85, 0x37, 0x97, 0x65, 0x74, 0xb4, 0x83, - 0xce, 0x41, 0x77, 0x67, 0x3b, 0xaf, 0x14, 0x73, 0x67, 0xe7, 0x95, 0x74, 0xc7, 0x23, 0x2e, 0xa1, - 0xd8, 0x42, 0x1b, 0x50, 0x5c, 0x86, 0x0f, 0x7c, 0xf9, 0x68, 0x11, 0xce, 0xce, 0x2b, 0xf2, 0x52, - 0xdf, 0xf0, 0xf9, 0xa9, 0x98, 0x69, 0x19, 0xad, 0xc3, 0x9a, 0xb6, 0xd3, 0x3d, 0x7a, 0xba, 0xbc, - 0x2f, 0xb4, 0x0a, 0x68, 0x31, 0xdc, 0x69, 0x76, 0xbb, 0x79, 0xe5, 0xaa, 0xbf, 0xfb, 0x45, 0xbb, - 0x93, 0x8f, 0x5e, 0xf5, 0xef, 0x36, 0xdb, 0x4f, 0xf3, 0xb1, 0xd6, 0xc9, 0x8b, 0x8b, 0x92, 0xf2, - 0xf2, 0xa2, 0xa4, 0xfc, 0x7d, 0x51, 0x52, 0x9e, 0x5f, 0x96, 0x22, 0x2f, 0x2f, 0x4b, 0x91, 0xdf, - 0x2e, 0x4b, 0x11, 0x58, 0xb3, 0xc9, 0x35, 0xe7, 0xa1, 0xa3, 0x7c, 0xfd, 0x41, 0xdf, 0x66, 0x03, - 0xbf, 0xa7, 0x9a, 0x64, 0x54, 0x9f, 0x81, 0xde, 0xb3, 0xc9, 0x9c, 0x55, 0x3f, 0x9d, 0xfd, 0x5a, - 0xf1, 0xfb, 0x84, 0xf6, 0x92, 0x42, 0x7f, 0xef, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x61, 0xf7, - 0xe7, 0xe3, 0x33, 0x0a, 0x00, 0x00, + // 1138 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xfa, 0xbf, 0x9f, 0x5d, 0xea, 0x4e, 0xab, 0xe2, 0x1a, 0x6a, 0x1b, 0xc3, 0xc1, 0x44, + 0x62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, 0x97, 0xe0, 0x33, + 0xa7, 0xa0, 0xff, 0x13, 0xa3, 0x9f, 0x42, 0x46, 0xe4, 0xee, 0x90, 0x2b, 0x51, 0x1a, 0xf9, 0x20, + 0x04, 0x49, 0xd7, 0x9c, 0x90, 0x52, 0x52, 0x72, 0x24, 0xbf, 0x51, 0x09, 0x32, 0x16, 0x75, 0x39, + 0x79, 0xce, 0x25, 0x75, 0x05, 0x1c, 0x89, 0xe8, 0x23, 0x48, 0x99, 0x81, 0xed, 0xf0, 0x92, 0x55, + 0xd3, 0x1a, 0xf9, 0xd6, 0xdb, 0xe7, 0x85, 0x6a, 0x0b, 0xd0, 0x23, 0x87, 0x8c, 0x6d, 0x86, 0x43, + 0x8f, 0x25, 0xe6, 0xfe, 0x89, 0x43, 0x1a, 0x13, 0x8b, 0xfa, 0xf6, 0x3c, 0xba, 0xb6, 0x14, 0x7d, + 0x95, 0xcc, 0xf8, 0xa5, 0xc9, 0xfc, 0x0c, 0x32, 0x9e, 0x4f, 0xe5, 0x64, 0x24, 0x64, 0x76, 0xd5, + 0x73, 0x89, 0x08, 0x61, 0x73, 0x2a, 0x42, 0x11, 0xb5, 0x21, 0xed, 0xb8, 0x5e, 0xc0, 0xc3, 0xc9, + 0xba, 0xa0, 0xba, 0x30, 0xf9, 0xae, 0xc0, 0x46, 0x13, 0x1a, 0x3a, 0xa2, 0x2d, 0xc8, 0xd0, 0x80, + 0xcb, 0x33, 0x52, 0xf2, 0x8c, 0x77, 0x2e, 0x3e, 0x63, 0x57, 0x82, 0xa3, 0x44, 0x94, 0xeb, 0xda, + 0xb1, 0x48, 0x5f, 0x6d, 0x2c, 0x96, 0xe8, 0xfe, 0x0e, 0x32, 0xaa, 0x60, 0x54, 0x86, 0x4c, 0xb4, + 0x13, 0x92, 0xf1, 0xc7, 0x31, 0x1c, 0x29, 0xd0, 0x2d, 0x48, 0x8e, 0x4c, 0x36, 0x92, 0x84, 0x0b, + 0x83, 0x94, 0xe6, 0x0d, 0x4a, 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x03, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x50, 0x80, 0x91, 0x4c, 0x0a, + 0x00, 0x00, } func (m *Scope) Marshal() (dAtA []byte, err error) { @@ -1479,6 +1491,11 @@ func (m *NetAssetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Volume != 0 { + i = encodeVarintScope(dAtA, i, uint64(m.Volume)) + i-- + dAtA[i] = 0x18 + } if m.UpdatedBlockHeight != 0 { i = encodeVarintScope(dAtA, i, uint64(m.UpdatedBlockHeight)) i-- @@ -1759,6 +1776,9 @@ func (m *NetAssetValue) Size() (n int) { if m.UpdatedBlockHeight != 0 { n += 1 + sovScope(uint64(m.UpdatedBlockHeight)) } + if m.Volume != 0 { + n += 1 + sovScope(uint64(m.Volume)) + } return n } @@ -3489,6 +3509,25 @@ func (m *NetAssetValue) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) + } + m.Volume = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScope + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Volume |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipScope(dAtA[iNdEx:])