From c5c170a671f229710276022a04ab72b26b50485d Mon Sep 17 00:00:00 2001 From: worryFree56 Date: Thu, 17 Mar 2022 14:35:18 +0800 Subject: [PATCH 1/2] update plug to uplugcn --- docs/endpoints/legacy-rest.md | 6 +++--- docs/zh/endpoints/legacy-rest.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/endpoints/legacy-rest.md b/docs/endpoints/legacy-rest.md index aa1f4ccd8..3cfdfc10b 100644 --- a/docs/endpoints/legacy-rest.md +++ b/docs/endpoints/legacy-rest.md @@ -359,7 +359,7 @@ Denom uses `plug` which affects fields: The same code as integrating with Plug Chain Hub mainnet, call `POST` `/txs` to send a transaction, as the example below: ```bash -curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"tx\": {\"msg\":[{\"type\":\"cosmos-sdk/MsgSend\",\"value\":{\"from_address\":\"gx1rkgdpj6fyyyu7pnhmc3v7gw9uls4mnajvzdwkt\",\"to_address\":\"gx1q6t5439f0rkvkzl38m0f43e0kpv3mx7x2shlq8\",\"amount\":[{\"denom\":\"plug\",\"amount\":\"1000000\"}]}}],\"fee\":{\"amount\":[{\"denom\":\"plug\",\"amount\":\"30000\"}],\"gas\":\"200000\"},\"signatures\":[{\"pub_key\":{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"AxGagdsRTKni/h1+vCFzTpNltwoiU7SwIR2dg6Jl5a//\"},\"signature\":\"Pu8yiRVO8oB2YDDHyB047dXNArbVImasmKBrm8Kr+6B08y8QQ7YG1eVgHi5OIYYclccCf3Ju/BQ78qsMWMniNQ==\"}],\"memo\":\"Sent gx Plug Chain Hub client\"}, \"mode\": \"block\"}" +curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"tx\": {\"msg\":[{\"type\":\"cosmos-sdk/MsgSend\",\"value\":{\"from_address\":\"gx1rkgdpj6fyyyu7pnhmc3v7gw9uls4mnajvzdwkt\",\"to_address\":\"gx1q6t5439f0rkvkzl38m0f43e0kpv3mx7x2shlq8\",\"amount\":[{\"denom\":\"uplugcn\",\"amount\":\"1000000\"}]}}],\"fee\":{\"amount\":[{\"denom\":\"uplugcn\",\"amount\":\"30000\"}],\"gas\":\"200000\"},\"signatures\":[{\"pub_key\":{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"AxGagdsRTKni/h1+vCFzTpNltwoiU7SwIR2dg6Jl5a//\"},\"signature\":\"Pu8yiRVO8oB2YDDHyB047dXNArbVImasmKBrm8Kr+6B08y8QQ7YG1eVgHi5OIYYclccCf3Ju/BQ78qsMWMniNQ==\"}],\"memo\":\"Sent gx Plug Chain Hub client\"}, \"mode\": \"block\"}" ``` ## Breaking Changes in Querying Transactions @@ -380,7 +380,7 @@ curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Conte "height": "5", "txhash": "E663768B616B1ACD2912E47C36FEBC7DB0E0974D6DB3823D4C656E0EAB8C679D", "data": "0A060A0473656E64", - "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"gx1w976a5jrhsj06dqmrh2x9qxzel74qtcmapklxc\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"amount\",\"value\":\"1000000plug\"}]}]}]", + "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"gx1w976a5jrhsj06dqmrh2x9qxzel74qtcmapklxc\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"amount\",\"value\":\"1000000uplugcn\"}]}]}]", "logs": [ { "events": [ @@ -414,7 +414,7 @@ curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Conte }, { "key": "amount", - "value": "1000000plug" + "value": "1000000uplugcn" } ] } diff --git a/docs/zh/endpoints/legacy-rest.md b/docs/zh/endpoints/legacy-rest.md index 8c0559c22..baf5a1dcd 100644 --- a/docs/zh/endpoints/legacy-rest.md +++ b/docs/zh/endpoints/legacy-rest.md @@ -360,7 +360,7 @@ Denom 替换为 `plug` ,这会影响到以下字段: 与 Plug Chain Hub 主网集成的代码相同,调用`POST` `/txs` 发送交易,示例如下: ```bash -curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"tx\": {\"msg\":[{\"type\":\"cosmos-sdk/MsgSend\",\"value\":{\"from_address\":\"gx1rkgdpj6fyyyu7pnhmc3v7gw9uls4mnajvzdwkt\",\"to_address\":\"gx1q6t5439f0rkvkzl38m0f43e0kpv3mx7x2shlq8\",\"amount\":[{\"denom\":\"plug\",\"amount\":\"1000000\"}]}}],\"fee\":{\"amount\":[{\"denom\":\"plug\",\"amount\":\"30000\"}],\"gas\":\"200000\"},\"signatures\":[{\"pub_key\":{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"AxGagdsRTKni/h1+vCFzTpNltwoiU7SwIR2dg6Jl5a//\"},\"signature\":\"Pu8yiRVO8oB2YDDHyB047dXNArbVImasmKBrm8Kr+6B08y8QQ7YG1eVgHi5OIYYclccCf3Ju/BQ78qsMWMniNQ==\"}],\"memo\":\"Sent gx Plug Chain Hub client\"}, \"mode\": \"block\"}" +curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"tx\": {\"msg\":[{\"type\":\"cosmos-sdk/MsgSend\",\"value\":{\"from_address\":\"gx1rkgdpj6fyyyu7pnhmc3v7gw9uls4mnajvzdwkt\",\"to_address\":\"gx1q6t5439f0rkvkzl38m0f43e0kpv3mx7x2shlq8\",\"amount\":[{\"denom\":\"uplugcn\",\"amount\":\"1000000\"}]}}],\"fee\":{\"amount\":[{\"denom\":\"uplugcn\",\"amount\":\"30000\"}],\"gas\":\"200000\"},\"signatures\":[{\"pub_key\":{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"AxGagdsRTKni/h1+vCFzTpNltwoiU7SwIR2dg6Jl5a//\"},\"signature\":\"Pu8yiRVO8oB2YDDHyB047dXNArbVImasmKBrm8Kr+6B08y8QQ7YG1eVgHi5OIYYclccCf3Ju/BQ78qsMWMniNQ==\"}],\"memo\":\"Sent gx Plug Chain Hub client\"}, \"mode\": \"block\"}" ``` ## 查询交易的不兼容更新 @@ -381,7 +381,7 @@ curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Conte "height": "5", "txhash": "E663768B616B1ACD2912E47C36FEBC7DB0E0974D6DB3823D4C656E0EAB8C679D", "data": "0A060A0473656E64", - "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"gx1w976a5jrhsj06dqmrh2x9qxzel74qtcmapklxc\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"amount\",\"value\":\"1000000plug\"}]}]}]", + "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"gx1w976a5jrhsj06dqmrh2x9qxzel74qtcmapklxc\"},{\"key\":\"sender\",\"value\":\"gx18awn3k70u05tlcul8w2qnl64g002uj4kjn93rn\"},{\"key\":\"amount\",\"value\":\"1000000uplugcn\"}]}]}]", "logs": [ { "events": [ @@ -415,7 +415,7 @@ curl -X POST "http://localhost:1317/txs" -H "accept: application/json" -H "Conte }, { "key": "amount", - "value": "1000000plug" + "value": "1000000uplugcn" } ] } From 7486c69be9318b886f87e5a8d04a0a624d564edd Mon Sep 17 00:00:00 2001 From: worryFree56 Date: Thu, 17 Mar 2022 14:38:25 +0800 Subject: [PATCH 2/2] update swagger doc --- client/static/openapi.yml | 58 +++++++++++++++++------------------ scripts/protoc-swagger-gen.sh | 4 +-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/client/static/openapi.yml b/client/static/openapi.yml index 639a24ab3..a62720c05 100644 --- a/client/static/openapi.yml +++ b/client/static/openapi.yml @@ -4236,7 +4236,7 @@ paths: type: string description: >- denom represents the string name of the given - denom unit (e.g plug). + denom unit (e.g uplugcn). exponent: type: integer format: int64 @@ -4249,10 +4249,10 @@ paths: 1 denom = 1^exponent base_denom - (e.g. with a base_denom of plug, one can create a - DenomUnit of 'plug' with + (e.g. with a base_denom of uplugcn, one can create a + DenomUnit of 'plugcn' with - exponent = 6, thus: 1 plug = 10^6 plug). + exponent = 6, thus: 1 plugcn = 10^6 uplugcn). aliases: type: array items: @@ -4424,7 +4424,7 @@ paths: type: string description: >- denom represents the string name of the given denom - unit (e.g plug). + unit (e.g uplugcn). exponent: type: integer format: int64 @@ -4437,10 +4437,10 @@ paths: 1 denom = 1^exponent base_denom - (e.g. with a base_denom of plug, one can create a - DenomUnit of 'plug' with + (e.g. with a base_denom of uplugcn, one can create a + DenomUnit of 'plugcn' with - exponent = 6, thus: 1 plug = 10^6 plug). + exponent = 6, thus: 1 plugcn = 10^6 uplugcn). aliases: type: array items: @@ -8265,7 +8265,7 @@ paths: title: minimum inflation rate goal_bonded: type: string - title: goal of percent bonded plugs + title: goal of percent bonded plugcns blocks_per_year: type: string format: uint64 @@ -15848,7 +15848,7 @@ paths: type: array format: sdk.Coins example: - - denom: plug + - denom: uplugcn amount: '100000000' items: type: object @@ -19497,7 +19497,7 @@ definitions: properties: denom: type: string - description: denom represents the string name of the given denom unit (e.g plug). + description: denom represents the string name of the given denom unit (e.g uplugcn). exponent: type: integer format: int64 @@ -19508,10 +19508,10 @@ definitions: 1 denom = 1^exponent base_denom - (e.g. with a base_denom of plug, one can create a DenomUnit of 'plug' + (e.g. with a base_denom of uplugcn, one can create a DenomUnit of 'plugcn' with - exponent = 6, thus: 1 plug = 10^6 plug). + exponent = 6, thus: 1 plugcn = 10^6 uplugcn). aliases: type: array items: @@ -19534,7 +19534,7 @@ definitions: type: string description: >- denom represents the string name of the given denom unit (e.g - plug). + uplugcn). exponent: type: integer format: int64 @@ -19546,10 +19546,10 @@ definitions: 1 denom = 1^exponent base_denom - (e.g. with a base_denom of plug, one can create a DenomUnit of - 'plug' with + (e.g. with a base_denom of uplugcn, one can create a DenomUnit of + 'plugcn' with - exponent = 6, thus: 1 plug = 10^6 plug). + exponent = 6, thus: 1 plugcn = 10^6 uplugcn). aliases: type: array items: @@ -19682,7 +19682,7 @@ definitions: type: string description: >- denom represents the string name of the given denom unit - (e.g plug). + (e.g uplugcn). exponent: type: integer format: int64 @@ -19694,10 +19694,10 @@ definitions: 1 denom = 1^exponent base_denom - (e.g. with a base_denom of plug, one can create a DenomUnit - of 'plug' with + (e.g. with a base_denom of uplugcn, one can create a DenomUnit + of 'plugcn' with - exponent = 6, thus: 1 plug = 10^6 plug). + exponent = 6, thus: 1 plugcn = 10^6 uplugcn). aliases: type: array items: @@ -19758,7 +19758,7 @@ definitions: type: string description: >- denom represents the string name of the given denom unit - (e.g plug). + (e.g uplugcn). exponent: type: integer format: int64 @@ -19770,10 +19770,10 @@ definitions: 1 denom = 1^exponent base_denom - (e.g. with a base_denom of plug, one can create a - DenomUnit of 'plug' with + (e.g. with a base_denom of uplugcn, one can create a + DenomUnit of 'plugcn' with - exponent = 6, thus: 1 plug = 10^6 plug). + exponent = 6, thus: 1 plugcn = 10^6 uplugcn). aliases: type: array items: @@ -21564,7 +21564,7 @@ definitions: title: minimum inflation rate goal_bonded: type: string - title: goal of percent bonded plugs + title: goal of percent bonded plugcns blocks_per_year: type: string format: uint64 @@ -21611,7 +21611,7 @@ definitions: title: minimum inflation rate goal_bonded: type: string - title: goal of percent bonded plugs + title: goal of percent bonded plugcns blocks_per_year: type: string format: uint64 @@ -26045,7 +26045,7 @@ definitions: type: array format: sdk.Coins example: - - denom: plug + - denom: uplugcn amount: '100000000' items: type: object @@ -26418,7 +26418,7 @@ definitions: type: array format: sdk.Coins example: - - denom: plug + - denom: uplugcn amount: '100000000' items: type: object diff --git a/scripts/protoc-swagger-gen.sh b/scripts/protoc-swagger-gen.sh index 7d421bc8e..3c49a89a0 100755 --- a/scripts/protoc-swagger-gen.sh +++ b/scripts/protoc-swagger-gen.sh @@ -49,8 +49,8 @@ sed -r -i '' 's/cosmosvalconspub1[a-z,0-9]+/gxvalconspub1zcjduepqwhwqn4h5v6mqa7k sed -i '' 's/Gaia/Plug Chain Hub/g' ./client/static/openapi.yml sed -i '' 's/gaia/plugchaind/g' ./client/static/openapi.yml sed -i '' 's/cosmoshub/plugchainhub/g' ./client/static/openapi.yml -sed -i '' 's/uatom/plug/g' ./client/static/openapi.yml -sed -i '' 's/atom/plug/g' ./client/static/openapi.yml +sed -i '' 's/uatom/uplugcn/g' ./client/static/openapi.yml +sed -i '' 's/atom/plugcn/g' ./client/static/openapi.yml tendermintURL=https://github.com/tendermint/liquidity/blob/develop onpURL=https://github.com/oracleNetworkProtocol/liquidity/tree/main