Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support setting a nav attribute on metadata scopes #1791

Merged
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
82f7160
add nav protos to metadata module for scopes
nullpointer0x00 Jan 2, 2024
b33ec18
refactor proto, add scope-id to add nav tx
nullpointer0x00 Jan 2, 2024
d63a70c
add validations, add msg interface
nullpointer0x00 Jan 2, 2024
244791c
add nav key
nullpointer0x00 Jan 2, 2024
ccba0a7
add keeper methods, update typed event
nullpointer0x00 Jan 3, 2024
f77ce00
add usd_mils and volume to write scope
nullpointer0x00 Jan 3, 2024
1c2818c
Merge branch 'main' into 1749-support-setting-a-NAV-attribute-on-meta…
nullpointer0x00 Jan 16, 2024
c1eec18
add net asset value keeper call to msg server
nullpointer0x00 Jan 16, 2024
539bdd4
add nav when writing scope
nullpointer0x00 Jan 16, 2024
012eba4
add new parameters to write scope msg, add command line flags for usd…
nullpointer0x00 Jan 16, 2024
959988e
add genesis navs
nullpointer0x00 Jan 16, 2024
0fec3e9
add change log
nullpointer0x00 Jan 17, 2024
439b894
Merge branch 'main' into 1749-support-setting-a-NAV-attribute-on-meta…
nullpointer0x00 Jan 21, 2024
5c2c45c
rename mils to mills, add net asset values command
nullpointer0x00 Jan 21, 2024
42c157c
change some naming, add validate basic tests, cmdline test
nullpointer0x00 Jan 22, 2024
babcba6
fix property name
nullpointer0x00 Jan 22, 2024
b259445
add validation test
nullpointer0x00 Jan 22, 2024
f11c3da
add msg server test, remove check of scope id, move metadata app init…
nullpointer0x00 Jan 23, 2024
c219d33
add scope net asset value query
nullpointer0x00 Jan 23, 2024
9f1b48e
fix test
nullpointer0x00 Jan 23, 2024
8f9e6a0
add better error handling
nullpointer0x00 Jan 23, 2024
3ce60b4
remove unneeded check, add tests for keeper
nullpointer0x00 Jan 23, 2024
4bb85d4
Add ParseNetAssertValueString test
nullpointer0x00 Jan 23, 2024
e022773
add query server tests
nullpointer0x00 Jan 23, 2024
19a4da5
add more tests, refactor method name
nullpointer0x00 Jan 23, 2024
2b4f59e
fix test
nullpointer0x00 Jan 24, 2024
5b7a805
fix marker references for scope, fix a few missed mils to mills
nullpointer0x00 Jan 24, 2024
bae57a5
Merge branch 'main' into 1749-support-setting-a-NAV-attribute-on-meta…
nullpointer0x00 Jan 24, 2024
601f14b
ugh missed test assert
nullpointer0x00 Jan 24, 2024
a0f7cc3
fix proto doc
nullpointer0x00 Jan 24, 2024
0e4cb85
merge main
nullpointer0x00 Jan 24, 2024
4949743
remove volume from scope net asset value, update code and tests, add …
nullpointer0x00 Jan 25, 2024
ecd81aa
merge main
nullpointer0x00 Jan 25, 2024
d2e956a
better error logging
nullpointer0x00 Jan 25, 2024
3b89fc5
error changes, lint fix
nullpointer0x00 Jan 25, 2024
38ce700
change error message again
nullpointer0x00 Jan 26, 2024
ae5647e
Merge branch 'main' into 1749-support-setting-a-NAV-attribute-on-meta…
iramiller Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features

* Add the ibcratelimit module [#1498](https://github.com/provenance-io/provenance/issues/1498).
* Add NAV support for metadata scopes [#1749](https://github.com/provenance-io/provenance/issues/1749).

### Improvements

Expand Down
8 changes: 4 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,6 @@ func New(
appCodec, keys[attributetypes.StoreKey], app.GetSubspace(attributetypes.ModuleName), app.AccountKeeper, &app.NameKeeper,
)

app.MetadataKeeper = metadatakeeper.NewKeeper(
appCodec, keys[metadatatypes.StoreKey], app.GetSubspace(metadatatypes.ModuleName), app.AccountKeeper, app.AuthzKeeper, app.AttributeKeeper,
)

markerReqAttrBypassAddrs := []sdk.AccAddress{
authtypes.NewModuleAddress(authtypes.FeeCollectorName), // Allow collecting fees in restricted coins.
authtypes.NewModuleAddress(rewardtypes.ModuleName), // Allow rewards to hold onto restricted coins.
Expand All @@ -582,6 +578,10 @@ func New(
app.AttributeKeeper, app.NameKeeper, app.TransferKeeper, markerReqAttrBypassAddrs,
)

app.MetadataKeeper = metadatakeeper.NewKeeper(
appCodec, keys[metadatatypes.StoreKey], app.GetSubspace(metadatatypes.ModuleName), app.AccountKeeper, app.AuthzKeeper, app.AttributeKeeper, app.MarkerKeeper,
)

app.HoldKeeper = holdkeeper.NewKeeper(
appCodec, keys[hold.StoreKey], app.BankKeeper,
)
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39670,6 +39670,82 @@ paths:
format: boolean
tags:
- Query
'/provenance/metadata/v1/netassetvalues/{id}':
get:
summary: ScopeNetAssetValues returns net asset values for scope
operationId: ScopeNetAssetValues
responses:
'200':
description: A successful response.
schema:
type: object
properties:
net_asset_values:
type: array
items:
type: object
properties:
price:
title: price is the complete value of the asset's volume
type: object
properties:
denom:
type: string
amount:
type: string
description: >-
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the
custom method

signatures required by gogoproto.
volume:
type: string
format: uint64
title: >-
volume is the number of tokens of that the scope was
purchased for the price
updated_block_height:
type: string
format: uint64
title: updated_block_height is the block height of last update
title: NetAssetValue defines a scope's net asset value
title: net asset values for scope
description: >-
QueryNetAssetValuesRequest is the response type for the
Query/NetAssetValues method.
default:
description: An unexpected error response
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: id
description: scopeid metadata address
in: path
required: true
type: string
tags:
- Query
'/provenance/metadata/v1/ownership/{address}':
get:
summary: >-
Expand Down Expand Up @@ -85796,6 +85872,33 @@ definitions:
on or off chain) to define an input

parameter
provenance.metadata.v1.NetAssetValue:
type: object
properties:
price:
title: price is the complete value of the asset's volume
type: object
properties:
denom:
type: string
amount:
type: string
description: |-
Coin defines a token with a denomination and an amount.

NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
volume:
type: string
format: uint64
title: >-
volume is the number of tokens of that the scope was purchased for the
price
updated_block_height:
type: string
format: uint64
title: updated_block_height is the block height of last update
title: NetAssetValue defines a scope's net asset value
provenance.metadata.v1.OSAllLocatorsRequest:
type: object
properties:
Expand Down Expand Up @@ -86612,6 +86715,45 @@ definitions:
include_request is a flag for whether to include this request in
your result.
description: QueryParamsResponse is the response type for the Query/Params RPC method.
provenance.metadata.v1.QueryScopeNetAssetValuesResponse:
type: object
properties:
net_asset_values:
type: array
items:
type: object
properties:
price:
title: price is the complete value of the asset's volume
type: object
properties:
denom:
type: string
amount:
type: string
description: >-
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the custom
method

signatures required by gogoproto.
volume:
type: string
format: uint64
title: >-
volume is the number of tokens of that the scope was purchased
for the price
updated_block_height:
type: string
format: uint64
title: updated_block_height is the block height of last update
title: NetAssetValue defines a scope's net asset value
title: net asset values for scope
description: >-
QueryNetAssetValuesRequest is the response type for the
Query/NetAssetValues method.
provenance.metadata.v1.Record:
type: object
properties:
Expand Down Expand Up @@ -93518,6 +93660,11 @@ definitions:
description: >-
MsgAddContractSpecToScopeSpecResponse is the response type for the
Msg/AddContractSpecToScopeSpec RPC method.
provenance.metadata.v1.MsgAddNetAssetValuesResponse:
type: object
title: >-
MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue response
type
provenance.metadata.v1.MsgAddScopeDataAccessResponse:
type: object
title: >-
Expand Down
Loading
Loading