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

Add Net Asset Value to Markers #1640

Merged
Merged
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
3f24366
add an initial proto object for marker nav
nullpointer0x00 Jul 27, 2023
2d08783
fix update time proto
nullpointer0x00 Aug 1, 2023
c2634e2
add missing method comments
nullpointer0x00 Aug 1, 2023
cbcb223
add net asset value key as 0x04
nullpointer0x00 Aug 1, 2023
e238295
update keys for adding multiple navs, add iterator for navs, add miss…
nullpointer0x00 Aug 1, 2023
2612426
add spec entry
nullpointer0x00 Aug 1, 2023
4bf4e60
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
nullpointer0x00 Aug 1, 2023
815ccb9
spec modification
nullpointer0x00 Aug 1, 2023
0f43d8b
add change log entry
nullpointer0x00 Aug 2, 2023
bec8248
add marker nav to add marker msg
nullpointer0x00 Aug 2, 2023
123f7fb
change marker nav to non-nullable array, add constructor param, updat…
nullpointer0x00 Aug 2, 2023
d07cfe3
add marker nav validate method and test
nullpointer0x00 Aug 2, 2023
b7e2707
add constructor, add constructor test to make sure values are set, ad…
nullpointer0x00 Aug 2, 2023
f29b116
add marker nav validation in validate basic on add marker msg
nullpointer0x00 Aug 2, 2023
37d1a89
add msg server test file, move add deny list test from keeper_test to…
nullpointer0x00 Aug 3, 2023
39afe2b
move TestUpdateForcedTransfer to msg_server_test from keeper_test
nullpointer0x00 Aug 3, 2023
9ca3ad1
add add/delete net asset value endpoints
nullpointer0x00 Aug 3, 2023
bd5f5f3
refactor MarkerNetAssetValue to NetAssetValue, add new msgs to codec,…
nullpointer0x00 Aug 3, 2023
e8491fd
add validate basic impls for add/delete net asset value
nullpointer0x00 Aug 3, 2023
afd3938
refactor naming of proto property
nullpointer0x00 Aug 3, 2023
1a09579
update validate basics for nav msgs, add tests for nav msgs
nullpointer0x00 Aug 3, 2023
819be27
add start of impl for add/delete nav endpoints
nullpointer0x00 Aug 3, 2023
33e86fb
add impl to set net asset value to keystore in AddNetAssetValue endpoint
nullpointer0x00 Aug 3, 2023
2e53030
add impl to delete net asset value from keystore in DeleteNetAssetVal…
nullpointer0x00 Aug 3, 2023
06ed285
add events to msg server
nullpointer0x00 Aug 4, 2023
0ad7b47
add check for value denom before setting nav, add msg server test for…
nullpointer0x00 Aug 4, 2023
0a7a90c
add delete nav msg server test
nullpointer0x00 Aug 4, 2023
ca283ab
only allow update time to be block time and set by chain
nullpointer0x00 Aug 7, 2023
739c0fe
fix constructor, update tests
nullpointer0x00 Aug 8, 2023
2305b24
remove invalid tests
nullpointer0x00 Aug 8, 2023
24ae2f4
add navs to addfinalizeactivate tx, add navs to param signature
nullpointer0x00 Aug 8, 2023
1a59112
add navs to constructor, add validation basic checks for add finalize…
nullpointer0x00 Aug 8, 2023
d471e6d
fix some tests
nullpointer0x00 Aug 8, 2023
b2a37d3
fixed all tests
nullpointer0x00 Aug 8, 2023
c233245
create shared method for adding navs
nullpointer0x00 Aug 8, 2023
f0ec62b
fix bank send tests
nullpointer0x00 Aug 8, 2023
0c17faf
fix marker handler tests
nullpointer0x00 Aug 8, 2023
b22e287
fix more tests
nullpointer0x00 Aug 8, 2023
9214440
Refactor proto for design change
nullpointer0x00 Aug 9, 2023
b5b2d18
more refactoring cleanup
nullpointer0x00 Aug 9, 2023
9a90318
refactor and builds now
nullpointer0x00 Aug 9, 2023
987ab4a
merge main
nullpointer0x00 Aug 10, 2023
ad7ff5c
update nav validate for new pattern
nullpointer0x00 Aug 10, 2023
339d59e
fix remaining tests
nullpointer0x00 Aug 10, 2023
f53b44a
add cli flags, update constructor, fix tests
nullpointer0x00 Aug 10, 2023
4764415
update wasm encoding with new create marker values
nullpointer0x00 Aug 10, 2023
295d4c9
merge main
nullpointer0x00 Aug 11, 2023
2442958
merge main
nullpointer0x00 Aug 15, 2023
672b645
fix change log
nullpointer0x00 Aug 15, 2023
1bc933b
fix generated statik.go file
nullpointer0x00 Aug 15, 2023
21f6aa8
add const for usd cents denom
nullpointer0x00 Aug 15, 2023
3acd082
allow nav to be updated by gov or signer with any type of access perm…
nullpointer0x00 Aug 15, 2023
868229e
add net asset value query protos
nullpointer0x00 Aug 15, 2023
9dab583
remove outdated test
nullpointer0x00 Aug 15, 2023
378880a
add impl for navs query
nullpointer0x00 Aug 15, 2023
4e0a65f
add net asset values query command
nullpointer0x00 Aug 15, 2023
e23db7b
update spec
nullpointer0x00 Aug 15, 2023
265b530
fix broken test
nullpointer0x00 Aug 15, 2023
abd27f7
remove todo
nullpointer0x00 Aug 15, 2023
41740d8
remove RemoveNetAssetValue method
nullpointer0x00 Aug 15, 2023
0e1646b
move finalize test, add test case of no net asset value
nullpointer0x00 Aug 15, 2023
b0edf46
add test for checking add nav permissions
nullpointer0x00 Aug 15, 2023
50e19e8
add validate basic test for update height being set
nullpointer0x00 Aug 15, 2023
6bc7328
remove scar tissue code
nullpointer0x00 Aug 15, 2023
1c57dbd
fix proto-lint
nullpointer0x00 Aug 15, 2023
6d34194
add nav event
nullpointer0x00 Aug 16, 2023
e7d7946
add nav event emit
nullpointer0x00 Aug 16, 2023
52b6483
add refactored name
nullpointer0x00 Aug 16, 2023
dc80f8f
add rolling average method
nullpointer0x00 Aug 16, 2023
6e91cd2
add module name for source, check that total volume is not 0
nullpointer0x00 Aug 16, 2023
e6e92b0
emit nav at before averaging
nullpointer0x00 Aug 16, 2023
572640a
check that volume does not exceed supply
nullpointer0x00 Aug 16, 2023
98b040f
rename proto from value to price per token
nullpointer0x00 Aug 16, 2023
d677fd0
add genesis init and export
nullpointer0x00 Aug 16, 2023
2e019a6
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
nullpointer0x00 Aug 17, 2023
9087b07
remove type
nullpointer0x00 Aug 17, 2023
08ada35
add query test
nullpointer0x00 Aug 17, 2023
327cc97
add tests for volume and usd cents flag
nullpointer0x00 Aug 17, 2023
052da54
add method comments, make rolling average public
nullpointer0x00 Aug 17, 2023
410eaaf
fix appending logic in genesis export
nullpointer0x00 Aug 17, 2023
76fa8cf
add event spec
nullpointer0x00 Aug 17, 2023
4dbc457
rename event attribute
nullpointer0x00 Aug 17, 2023
e85d1e3
fix spec formatting
nullpointer0x00 Aug 17, 2023
8a2fbba
remove net asset value on destroyed marker
nullpointer0x00 Aug 17, 2023
be70b8d
refactor and fix lint
nullpointer0x00 Aug 17, 2023
0159d31
merge main
nullpointer0x00 Aug 18, 2023
c50fd1c
update test with nav
nullpointer0x00 Aug 18, 2023
fa57436
rename msg server endpoint, update test
nullpointer0x00 Aug 18, 2023
eda96c4
moving add marker test
nullpointer0x00 Aug 18, 2023
7afb78d
completely move test and test for events
nullpointer0x00 Aug 18, 2023
dbf71fd
add command for adding navs
nullpointer0x00 Aug 18, 2023
a79517a
add command to new cmd tx
nullpointer0x00 Aug 18, 2023
2507057
update parsing of net asset values, add tests
nullpointer0x00 Aug 18, 2023
eb99085
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
nullpointer0x00 Aug 22, 2023
4c572f7
update cli tests
nullpointer0x00 Aug 22, 2023
9c28904
add rolling average test
nullpointer0x00 Aug 22, 2023
2b244b0
update spec for net asset value
nullpointer0x00 Aug 22, 2023
b3ef235
add spec for add/updating net asset value
nullpointer0x00 Aug 22, 2023
03bae17
merge main
nullpointer0x00 Aug 22, 2023
ffd7d5e
should be administor not module as source
nullpointer0x00 Aug 22, 2023
82870e7
merge main, fix statik.go
nullpointer0x00 Aug 28, 2023
70d3a16
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
iramiller Aug 28, 2023
9227bfb
rename price_per_token to price
nullpointer0x00 Aug 29, 2023
649122f
remove rolling average, fix test
nullpointer0x00 Aug 29, 2023
624d29a
fix typo
nullpointer0x00 Aug 30, 2023
7429bc3
update documentation
nullpointer0x00 Aug 30, 2023
e54de96
update volume doc again
nullpointer0x00 Aug 30, 2023
d3c9da6
rename comment
nullpointer0x00 Aug 31, 2023
a16398a
rename method
nullpointer0x00 Aug 31, 2023
47d83e4
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
nullpointer0x00 Aug 31, 2023
ab4bc28
merge main
nullpointer0x00 Aug 31, 2023
119588b
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
nullpointer0x00 Aug 31, 2023
2d23b89
Merge branch 'main' into nullpointer0x00/1470-add-share-pricing-to-ma…
nullpointer0x00 Sep 5, 2023
bdb13b5
merge main, fix conflict
nullpointer0x00 Sep 6, 2023
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
@@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features

* Allow marker's transfer authority to prevent transfer of restricted coin with deny list on send [#1518](https://github.com/provenance-io/provenance/issues/1518).
* Add net asset value to markers [#1328](https://github.com/provenance-io/provenance/issues/1328).
* Add ICQHost and Oracle module to allow cross chain oracle queries [#1497](https://github.com/provenance-io/provenance/issues/1497).
* New `GetByAddr` metadata query [#1443](https://github.com/provenance-io/provenance/issues/1443).
* Add Trigger module queries to stargate whitelist for smart contracts [#1636](https://github.com/provenance-io/provenance/issues/1636)
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

314 changes: 314 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
@@ -36148,6 +36148,249 @@ paths:
format: boolean
tags:
- Query
'/provenance/marker/v1/netassetvalues/{id}':
get:
summary: NetAssetValues returns net asset values for marker
operationId: NetAssetValues
responses:
'200':
description: A successful response.
schema:
type: object
properties:
net_asset_values:
type: array
items:
type: object
properties:
price:
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.
title: price is the complete value of the asset's volume
volume:
type: string
format: uint64
title: >-
volume is the number of tokens of the marker that were
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 marker's net asset value
title: net asset values for marker denom
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
description: >-
A URL/resource name that uniquely identifies the type of
the serialized

protocol buffer message. This string must contain at
least

one "/" character. The last segment of the URL's path
must represent

the fully qualified name of the type (as in

`path/google.protobuf.Duration`). The name should be in
a canonical form

(e.g., leading "." is not accepted).


In practice, teams usually precompile into the binary
all types that they

expect it to use in the context of Any. However, for
URLs which use the

scheme `http`, `https`, or no scheme, one can optionally
set up a type

server that maps type URLs to message definitions as
follows:


* If no scheme is provided, `https` is assumed.

* An HTTP GET on the URL must yield a
[google.protobuf.Type][]
value in binary format, or produce an error.
* Applications are allowed to cache lookup results based
on the
URL, or have them precompiled into a binary to avoid any
lookup. Therefore, binary compatibility needs to be preserved
on changes to types. (Use versioned type names to manage
breaking changes.)

Note: this functionality is not currently available in
the official

protobuf release, and it is not used for type URLs
beginning with

type.googleapis.com.


Schemes other than `http`, `https` (or the empty scheme)
might be

used with implementation specific semantics.
value:
type: string
format: byte
description: >-
Must be a valid serialized protocol buffer of the above
specified type.
description: >-
`Any` contains an arbitrary serialized protocol buffer
message along with a

URL that describes the type of the serialized message.


Protobuf library provides support to pack/unpack Any values
in the form

of utility functions or additional generated methods of the
Any type.


Example 1: Pack and unpack a message in C++.

Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
...
}

Example 2: Pack and unpack a message in Java.

Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
foo = any.unpack(Foo.class);
}

Example 3: Pack and unpack a message in Python.

foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
any.Unpack(foo)
...

Example 4: Pack and unpack a message in Go

foo := &pb.Foo{...}
any, err := ptypes.MarshalAny(foo)
...
foo := &pb.Foo{}
if err := ptypes.UnmarshalAny(any, foo); err != nil {
...
}

The pack methods provided by protobuf library will by
default use

'type.googleapis.com/full.type.name' as the type URL and the
unpack

methods only use the fully qualified type name after the
last '/'

in the type URL, for example "foo.bar.com/x/y.z" will yield
type

name "y.z".



JSON

====

The JSON representation of an `Any` value uses the regular

representation of the deserialized, embedded message, with
an

additional field `@type` which contains the type URL.
Example:

package google.profile;
message Person {
string first_name = 1;
string last_name = 2;
}

{
"@type": "type.googleapis.com/google.profile.Person",
"firstName": <string>,
"lastName": <string>
}

If the embedded message type is well-known and has a custom
JSON

representation, that representation will be embedded adding
a field

`value` which holds the custom JSON in addition to the
`@type`

field. Example (for message [google.protobuf.Duration][]):

{
"@type": "type.googleapis.com/google.protobuf.Duration",
"value": "1.212s"
}
parameters:
- name: id
description: address or denom for the marker
in: path
required: true
type: string
tags:
- Query
/provenance/marker/v1/params:
get:
summary: Params queries the parameters of x/bank module.
@@ -83043,6 +83286,33 @@ definitions:
- MARKER_STATUS_CANCELLED: MARKER_STATUS_CANCELLED - Marker has been cancelled, pending destroy
- MARKER_STATUS_DESTROYED: MARKER_STATUS_DESTROYED - Marker supply has all been recalled, marker is considered destroyed and no further
actions allowed.
provenance.marker.v1.NetAssetValue:
type: object
properties:
price:
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.
title: price is the complete value of the asset's volume
volume:
type: string
format: uint64
title: >-
volume is the number of tokens of the marker that were 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 marker's net asset value
provenance.marker.v1.Params:
type: object
properties:
@@ -83631,6 +83901,45 @@ definitions:
"value": "1.212s"
}
description: QueryMarkerResponse is the response type for the Query/Marker method.
provenance.marker.v1.QueryNetAssetValuesResponse:
type: object
properties:
net_asset_values:
type: array
items:
type: object
properties:
price:
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.
title: price is the complete value of the asset's volume
volume:
type: string
format: uint64
title: >-
volume is the number of tokens of the marker that were 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 marker's net asset value
title: net asset values for marker denom
description: >-
QueryNetAssetValuesRequest is the response type for the
Query/NetAssetValues method.
provenance.marker.v1.QueryParamsResponse:
type: object
properties:
@@ -83789,6 +84098,11 @@ definitions:
provenance.marker.v1.MsgAddMarkerResponse:
type: object
title: MsgAddMarkerResponse defines the Msg/AddMarker response type
provenance.marker.v1.MsgAddNetAssetValuesResponse:
type: object
title: >-
MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue response
type
provenance.marker.v1.MsgBurnResponse:
type: object
title: MsgBurnResponse defines the Msg/Burn response type
Loading