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

Scripts/derivaitves taiki miyagi #354

Merged
merged 42 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ce0daba
add test for class attribute and nft minter query
Sep 6, 2022
d52cb7c
add success case tests for query of classIdsByOwner and classIdsByName
Sep 8, 2022
215331d
enable data in geneis state to be exported
Dec 22, 2022
396221b
set data in init genesis method
Dec 22, 2022
ca972ca
err handle
Dec 23, 2022
816580a
modification of proto
Dec 23, 2022
6ebd6e8
add reward query impl
Dec 23, 2022
bfbfa2c
impl methods of incentiveUnitIdsByAddr and insert them in a method
Dec 23, 2022
06f7b55
modification proto type addition
taiki1frsh Dec 26, 2022
17b294d
add incentive-unit-ids-by-addr query
taiki1frsh Dec 26, 2022
8411230
unit tests for the methods of incentiveUnitIdsByAddr type
taiki1frsh Dec 26, 2022
d1ce18c
include test for incentiveUnitIdsByAddr part
taiki1frsh Dec 27, 2022
9376207
modification of genesis state in proto
taiki1frsh Dec 27, 2022
3a8cda5
export and init data in genesis state
taiki1frsh Dec 27, 2022
e2062f8
remove dust
taiki1frsh Dec 27, 2022
8e2d97e
add function to use in InitGenesis including validation
taiki1frsh Dec 28, 2022
02ad262
modify proto for genesis state
taiki1frsh Dec 28, 2022
1cd5179
modification of proto
taiki1frsh Dec 28, 2022
ecadd01
modification of proto
taiki1frsh Dec 28, 2022
b8411ce
feat: add settting for breakpoint on vscode
mkXultra Jan 5, 2023
1613af2
Merge pull request #318 from UnUniFi/feature/debug_vscode
mkXultra Jan 5, 2023
08eb544
Merge pull request #310 from UnUniFi/feat/issue307
taiki1frsh Jan 5, 2023
813af42
modify the way to asset []byte
taiki1frsh Jan 6, 2023
b01e8fc
modify the way of the []byte condition
taiki1frsh Jan 6, 2023
e994e5f
feat:add GetOwningClassIdLists
Senna46 Jan 10, 2023
53a35be
feat: add classAttribute test
Senna46 Jan 10, 2023
8e8cb5b
Merge pull request #312 from UnUniFi/feat/issue302
taiki1frsh Jan 11, 2023
999c38b
Merge pull request #313 from UnUniFi/feat/issue309
taiki1frsh Jan 11, 2023
aa2a991
Merge pull request #321 from UnUniFi/feat/issue320
taiki1frsh Jan 11, 2023
5a0a779
Merge pull request #322 from UnUniFi/feat/add-nftmint-test
Senna46 Jan 11, 2023
24a64ff
update swagger
taiki1frsh Jan 11, 2023
a0892a0
Merge pull request #323 from UnUniFi/feat/update-swagger
taiki1frsh Jan 11, 2023
8d967ec
Merge pull request #249 from UnUniFi/tests/nftmint-queries
taiki1frsh Feb 1, 2023
7f14445
enable params to be modified
taiki1frsh Feb 10, 2023
acccdd0
Merge pull request #350 from UnUniFi/deriv-issue348
taiki1frsh Feb 10, 2023
a9fc5f9
add default param set
taiki1frsh Feb 10, 2023
4c3b148
Merge branch 'newDevelop' of https://github.com/UnUniFi/chain into sc…
mkXultra Feb 10, 2023
8d1ad0f
Merge branch 'patch/deriv-349' of https://github.com/UnUniFi/chain in…
mkXultra Feb 10, 2023
acaa250
modify: support linux
mkXultra Feb 10, 2023
e0b4fe0
Merge branch 'scripts/derivaitves-taiki' of https://github.com/UnUniF…
mkXultra Feb 13, 2023
7ecfe12
modify: fix merge failed
mkXultra Feb 13, 2023
1bb465a
modify: support metada in debug mode
mkXultra Feb 13, 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
Empty file modified .vscode/extensions.json
100644 → 100755
Empty file.
33 changes: 33 additions & 0 deletions .vscode/go.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Place your uni_tmp_work workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"print clipborad for debugging": {
"scope": "go",
"prefix": [
"fmtl",
"log"
],
"body": [
"fmt.Println(\"$CLIPBOARD\");",
"fmt.Println($CLIPBOARD);",
],
"description": "print clipboard"
},
"print current number": {
"scope": "go",
"prefix": [
"ll",
"logLine",
"trace"
],
"body": [
"fmt.Println(\"$TM_FILENAME:$TM_LINE_NUMBER\");",
],
"description": "print line number"
}
}
49 changes: 49 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "build then Launch and auto throw Tx",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "./cmd/ununifid/main.go",
"args": [
"start",
"--home",
"./data/test-1"
],
"cwd": "${workspaceFolder}",
"preLaunchTask": "prepare tx",
},
{
"name": "just Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "./cmd/ununifid/main.go",
"args": [
"start",
"--home",
"./data/test-1"
],
"cwd": "${workspaceFolder}",
},
{
"name": "build then Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "./cmd/ununifid/main.go",
"args": [
"start",
"--home",
"./data/test-1"
],
"cwd": "${workspaceFolder}",
"preLaunchTask": "init config",
},
]
}
5 changes: 3 additions & 2 deletions .vscode/settings.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
}
},
"[go]": {
"editor.snippetSuggestions": "none",
"editor.snippetSuggestions": "top",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.suggest.snippetsPreventQuickSuggestions": true
},
"gopls": {
"local": "github.com/UnUniFi/chain"
Expand Down
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"cwd": "${workspaceFolder}",
"command": "make build -B",
"problemMatcher": [
"$go"
]
},
{
"label": "init config",
"type": "shell",
"cwd": "${workspaceFolder}",
"command": "scripts/setup/init.sh",
"problemMatcher": [
"$go"
],
"dependsOn": [
"build",
]
},
{
"label": "prepare tx",
"type": "shell",
"cwd": "${workspaceFolder}",
"command": "nohup scripts/commands/prepare.sh sleep ... & sleep 0.1",
"dependsOn": [
"init config",
],
},
]
}
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ func NewApp(
incentive.NewAppModule(appCodec, app.incentiveKeeper, app.AccountKeeper, app.BankKeeper, app.cdpKeeper),
ununifidist.NewAppModule(appCodec, app.ununifidistKeeper, app.AccountKeeper, app.BankKeeper),
pricefeed.NewAppModule(appCodec, app.pricefeedKeeper, app.AccountKeeper),
nftmint.NewAppModule(appCodec, app.NftmintKeeper, app.AccountKeeper),
nftmint.NewAppModule(appCodec, app.NftmintKeeper, app.NFTKeeper),
nftmarket.NewAppModule(appCodec, app.NftmarketKeeper, app.AccountKeeper, app.BankKeeper),
// wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
)
Expand Down
68 changes: 68 additions & 0 deletions docs/client/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4619,6 +4619,53 @@ paths:
type: string
tags:
- Query
/ununifi/ecosystem_incentive/incentive_unit_ids_by_addr/{address}:
get:
operationId: IncentiveUnitIdsByAddr
responses:
'200':
description: A successful response.
schema:
type: object
properties:
incentive_unit_ids_by_addr:
type: object
properties:
address:
type: string
incentive_unit_ids:
type: array
items:
type: string
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: address
in: path
required: true
type: string
tags:
- Query
/ununifi/ecosystem_incentive/params:
get:
summary: Parameters queries the parameters of the module.
Expand Down Expand Up @@ -10328,6 +10375,15 @@ definitions:
type: string
weight:
type: string
ununifi.ecosystemincentive.IncentiveUnitIdsByAddr:
type: object
properties:
address:
type: string
incentive_unit_ids:
type: array
items:
type: string
ununifi.ecosystemincentive.Params:
type: object
properties:
Expand Down Expand Up @@ -10401,6 +10457,18 @@ definitions:
method

signatures required by gogoproto.
ununifi.ecosystemincentive.QueryIncentiveUnitIdsByAddrResponse:
type: object
properties:
incentive_unit_ids_by_addr:
type: object
properties:
address:
type: string
incentive_unit_ids:
type: array
items:
type: string
ununifi.ecosystemincentive.QueryIncentiveUnitResponse:
type: object
properties:
Expand Down
11 changes: 5 additions & 6 deletions proto/derivatives/derivatives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ message Pool {
(gogoproto.nullable) = false
];
repeated Asset accepted_assets = 6 [
(gogoproto.moretags) = "yaml:\"accepted_assets\"",
(gogoproto.nullable) = false
(gogoproto.moretags) = "yaml:\"accepted_assets\""
];
}

Expand Down Expand Up @@ -154,8 +153,7 @@ message PerpetualFuturesParams {
(gogoproto.nullable) = false
];
repeated Market markets = 4 [
(gogoproto.moretags) = "yaml:\"markets\"",
(gogoproto.nullable) = false
(gogoproto.moretags) = "yaml:\"markets\""
];
}

Expand All @@ -181,10 +179,11 @@ message PerpetualOptionsParams {
(gogoproto.nullable) = false
];
repeated Market markets = 5 [
(gogoproto.moretags) = "yaml:\"markets\"",
(gogoproto.nullable) = false
(gogoproto.moretags) = "yaml:\"markets\""
];
}
// (gogoproto.nullable) = false


message Params {
Pool pool = 1 [
Expand Down
9 changes: 9 additions & 0 deletions proto/ecosystem-incentive/ecosystem_incentive.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ message RewardStore {
(gogoproto.nullable) = false
];
}

message IncentiveUnitIdsByAddr {
string address = 1 [
(gogoproto.moretags) = "yaml:\"address\"",
(gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress",
(gogoproto.nullable) = false
];
repeated string incentive_unit_ids = 2 [ (gogoproto.moretags) = "yaml:\"incentive_unit_ids\"" ];
}
8 changes: 2 additions & 6 deletions proto/ecosystem-incentive/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ message EventRegister {

message EventWithdrawAllRewards {
string sender = 1 [
(gogoproto.moretags) = "yaml:\"sender\"",
(gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress",
(gogoproto.nullable) = false
(gogoproto.moretags) = "yaml:\"sender\""
];
repeated cosmos.base.v1beta1.Coin all_withdrawn_rewards = 2 [
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
Expand All @@ -30,9 +28,7 @@ message EventWithdrawAllRewards {

message EventWithdrawReward {
string sender = 1 [
(gogoproto.moretags) = "yaml:\"sender\"",
(gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress",
(gogoproto.nullable) = false
(gogoproto.moretags) = "yaml:\"sender\""
];
cosmos.base.v1beta1.Coin withdrawn_reward = 2 [
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin",
Expand Down
17 changes: 17 additions & 0 deletions proto/ecosystem-incentive/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ service Query {
rpc RecordedIncentiveUnitId(QueryRecordedIncentiveUnitIdRequest) returns (QueryRecordedIncentiveUnitIdResponse) {
option (google.api.http).get = "/ununifi/ecosystem_incentive/recorded_incentive_unit_id/{class_id}/{nft_id}";
}

rpc IncentiveUnitIdsByAddr(QueryIncentiveUnitIdsByAddrRequest) returns (QueryIncentiveUnitIdsByAddrResponse) {
option (google.api.http).get = "/ununifi/ecosystem_incentive/incentive_unit_ids_by_addr/{address}";
}
}

message QueryParamsRequest {}
Expand Down Expand Up @@ -84,3 +88,16 @@ message QueryRecordedIncentiveUnitIdRequest {
message QueryRecordedIncentiveUnitIdResponse {
string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ];
}

message QueryIncentiveUnitIdsByAddrRequest {
string address = 1 [
(gogoproto.moretags) = "yaml:\"address\""
];
}

message QueryIncentiveUnitIdsByAddrResponse {
IncentiveUnitIdsByAddr incentive_unit_ids_by_addr = 1 [
(gogoproto.moretags) = "yaml:\"incentive_unit_ids_by_addr\"",
(gogoproto.nullable) = false
];
}
2 changes: 1 addition & 1 deletion proto/nftmint/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ message GenesisState {
(gogoproto.moretags) = "yaml:\"params\"",
(gogoproto.nullable) = false
];
repeated ClassAttributes class_attributes_list = 2 [ (gogoproto.moretags) = "yaml:\"class_attributes_list\"" ];
}

3 changes: 2 additions & 1 deletion scripts/commands/derivatives/setup_pricefeed.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

SCRIPT_DIR=$(cd $(dirname $0); pwd)
mkdir pricefeed
cd pricefeed
curl -O https://raw.githubusercontent.com/ununifi/utils/main/projects/pricefeed/docker-compose.yml
cp ../.env.pricefeed .env
cp $SCRIPT_DIR/.env.pricefeed .env

docker-compose up -d
Loading