Skip to content

Commit

Permalink
Update Provenance to v1.13.1, support 403s, bump some dependencies (#93)
Browse files Browse the repository at this point in the history
* Update Provenance to v1.13.1

* Add support for returning HTTP 403 forbidden error from usecases

* Bump the versions of other important dependencies

* Ignore Vault token output file generated by the integration test setup
  • Loading branch information
rpatel-figure authored Feb 3, 2023
1 parent 3ad9fd0 commit be1a9f4
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 45 deletions.
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ object Versions {
const val Develop = "develop-+"

const val Kotlin = "1.6.21"
const val KotlinCoroutines = "1.6.2"
const val Protobuf = "3.20.1"
const val KotlinCoroutines = "1.6.4"
const val Protobuf = "3.21.12"
const val SpringBoot = "2.5.6"
const val KotlinLogging = "2.0.11"
const val Reactor = "3.4.9"
Expand All @@ -30,12 +30,12 @@ object Versions {
const val AssetModel = "0.1.16"
const val P8eScope = "0.6.2"
const val ProvenanceHdWallet = "0.1.15"
const val ProvenanceClient = "1.1.1"
const val ProvenanceClient = "1.3.0"
const val Unirest = "3.13.6"
const val KmsConnector = "0.3.1"
const val LoanPackage = "0.6.1"
const val Grpc = "1.45.0"
const val ProvenanceProto = "1.11.1"
const val Grpc = "1.51.3"
const val ProvenanceProto = "1.13.1"
const val Reflections = "0.9.10"
const val NexusPublishing = "1.1.0"
const val BouncyCastle = "1.70"
Expand Down
9 changes: 6 additions & 3 deletions service/docker/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@ services:
- ./object-store-2:/mnt/data

provenance:
image: provenanceio/provenance:v1.11.1
image: provenanceio/provenance:v1.13.1
container_name: provenance
command: bash -c "cp -rn /home/provenance_seed/* /home/provenance && /usr/bin/provenanced -t --home /home/provenance start"
command: bash -c "cp -rn /home/provenance_seed/* /provenance && /usr/bin/provenanced -t --home /provenance start"
networks:
- p8e-network
ports:
- "1317:1317"
- "9090:9090"
- "26657:26657"
environment:
- ID=dev
- PIO_HOME=/provenance
volumes:
- ./prov-init:/home/provenance_seed:ro
- provenance:/home/provenance
- provenance:/provenance

vault:
image: vault:latest
Expand Down
93 changes: 75 additions & 18 deletions service/docker/prov-init/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,71 +48,71 @@
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1qy2mqx5x22a400pgd5p6u7mq9shxzvh767jar0",
"pub_key": null,
"account_number": "0",
"account_number": "1",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1xr3wfqzlcz469wkex5c3ylaq8pq97crhsg57gd",
"pub_key": null,
"account_number": "0",
"account_number": "2",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1s2c62ke0mmwhqxguf7e2pt6e98yq38m4atwhwl",
"pub_key": null,
"account_number": "0",
"account_number": "3",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1mryqzguyelef5dae7k6l22tnls93cvrc60tjdc",
"pub_key": null,
"account_number": "0",
"account_number": "4",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp138jtpz5zxa6yc33s0fk2jy9vahqcuvvtwnrzge",
"pub_key": null,
"account_number": "0",
"account_number": "5",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1pz4tt4j802j2y3avs5mwy9uyyxtx7k5r8qlehw",
"pub_key": null,
"account_number": "0",
"account_number": "6",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1he6rfnxyx2ssqyknq4ayzf5j46dp29pqt6z708",
"pub_key": null,
"account_number": "0",
"account_number": "7",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1f99dgtxxjmgczjsuc48utq4lkk0uhx6eqfqju0",
"pub_key": null,
"account_number": "0",
"account_number": "8",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "tp1c87ujqlc7wvstate9qcfu7tglesy3m7tnfwfrm",
"pub_key": null,
"account_number": "0",
"account_number": "9",
"sequence": "0"
},
{
"@type": "/provenance.marker.v1.MarkerAccount",
"base_account": {
"address": "tp1pr93cqdh4kfnmrknhwa87a5qrwxw9k3dhkszp0",
"pub_key": null,
"account_number": "0",
"account_number": "10",
"sequence": "0"
},
"manager": "",
Expand All @@ -137,6 +137,9 @@
}
]
},
"authz": {
"authorization": []
},
"bank": {
"params": {
"send_enabled": [],
Expand Down Expand Up @@ -235,7 +238,8 @@
}
],
"supply": [],
"denom_metadata": []
"denom_metadata": [],
"send_enabled": []
},
"capability": {
"index": "1",
Expand Down Expand Up @@ -269,6 +273,9 @@
"evidence": {
"evidence": []
},
"feegrant": {
"allowances": []
},
"genutil": {
"gen_txs": [
{
Expand Down Expand Up @@ -326,7 +333,8 @@
"gas_limit": "200000",
"payer": "",
"granter": ""
}
},
"tip": null
},
"signatures": [
"yt2uHkBflyJO5tf5Js7iNLsF2CNbc6AKOgkqtdFxMN0D5nOeKjsie8j4ZsOYfbMfIJMbP+7gptd/U5qwjo4/aw=="
Expand Down Expand Up @@ -357,6 +365,16 @@
"veto_threshold": "0.334000000000000000"
}
},
"group": {
"group_seq": "0",
"groups": [],
"group_members": [],
"group_policy_seq": "0",
"group_policies": [],
"proposal_seq": "0",
"proposals": [],
"votes": []
},
"ibc": {
"client_genesis": {
"clients": [],
Expand All @@ -374,7 +392,10 @@
"connection_genesis": {
"connections": [],
"client_connection_paths": [],
"next_connection_sequence": "0"
"next_connection_sequence": "0",
"params": {
"max_expected_time_per_block": "30000000000"
}
},
"channel_genesis": {
"channels": [],
Expand All @@ -387,11 +408,30 @@
"next_channel_sequence": "0"
}
},
"interchainaccounts": {
"controller_genesis_state": {
"active_channels": [],
"interchain_accounts": [],
"ports": [],
"params": {
"controller_enabled": true
}
},
"host_genesis_state": {
"active_channels": [],
"interchain_accounts": [],
"port": "icahost",
"params": {
"host_enabled": true,
"allow_messages": []
}
}
},
"marker": {
"params": {
"max_total_supply": "100000000000",
"enable_governance": true,
"unrestricted_denom_regex": "[a-zA-Z][a-zA-Z0-9\\-\\.]{2,64}"
"unrestricted_denom_regex": "[a-zA-Z][a-zA-Z0-9\\-\\.]{7,83}"
},
"markers": []
},
Expand Down Expand Up @@ -422,6 +462,17 @@
"blocks_per_year": "6311520"
}
},
"msgfees": {
"params": {
"floor_gas_price": {
"denom": "nhash",
"amount": "1905"
},
"nhash_per_usd_mil": "25000000",
"conversion_fee_denom": "nhash"
},
"msg_fees": []
},
"name": {
"params": {
"max_segment_length": 32,
Expand Down Expand Up @@ -453,6 +504,12 @@
]
},
"params": null,
"reward": {
"reward_program_id": "1",
"reward_programs": [],
"claim_period_reward_distributions": [],
"reward_account_states": []
},
"slashing": {
"params": {
"signed_blocks_window": "100",
Expand All @@ -470,7 +527,8 @@
"max_validators": 100,
"max_entries": 7,
"historical_entries": 10000,
"bond_denom": "nhash"
"bond_denom": "nhash",
"min_commission_rate": "0.000000000000000000"
},
"last_total_power": "0",
"last_validator_powers": [],
Expand All @@ -494,10 +552,9 @@
"params": {
"code_upload_access": {
"permission": "Everybody",
"address": ""
"addresses": []
},
"instantiate_default_permission": "Everybody",
"max_wasm_code_size": "614400"
"instantiate_default_permission": "Everybody"
},
"codes": [],
"contracts": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.provenance.api.domain.usecase.common.errors

class ForbiddenError(message: String, cause: Throwable? = null) : Exception(message, cause)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.provenance.api.frameworks.web

import io.provenance.api.domain.usecase.common.errors.ForbiddenError
import io.provenance.api.domain.usecase.common.errors.NotFoundError
import io.provenance.api.domain.usecase.common.errors.ServerError
import io.provenance.api.frameworks.provenance.exceptions.ContractExecutionBatchException
Expand All @@ -21,6 +22,9 @@ object ErrorResponses {
private suspend fun badRequest(cause: Throwable) =
ServerResponse.status(HttpStatus.BAD_REQUEST).bodyValueAndAwait(cause.localizedMessage)

private suspend fun forbidden(cause: Throwable) =
ServerResponse.status(HttpStatus.FORBIDDEN).bodyValueAndAwait(cause.localizedMessage)

private suspend fun notFound(cause: Throwable) =
ServerResponse.status(HttpStatus.NOT_FOUND).bodyValueAndAwait(cause.localizedMessage)

Expand All @@ -35,6 +39,7 @@ object ErrorResponses {
return when (cause) {
is NotFoundError -> notFound(cause)
is IllegalArgumentException -> badRequest(cause)
is ForbiddenError -> forbidden(cause)
is ContractExecutionException -> badRequest(cause)
is ContractExecutionBatchException -> badRequest(cause)
is ServerError -> serverError(cause)
Expand Down
3 changes: 3 additions & 0 deletions service/src/test/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Integration Test Output
## Vault
vault/token.output
9 changes: 6 additions & 3 deletions service/src/test/resources/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ services:
- ./object-store:/mnt/data

provenance:
image: provenanceio/provenance:v1.8.0-rc9
command: bash -c "cp -rn /home/provenance_seed/* /home/provenance && /usr/bin/provenanced -t --home /home/provenance start"
image: provenanceio/provenance:v1.13.1
command: bash -c "cp -rn /home/provenance_seed/* /provenance && /usr/bin/provenanced -t --home /provenance start"
networks:
- p8e-network-test
ports:
- "1317:1317"
- "9090:9090"
- "26657:26657"
environment:
- ID=dev
- PIO_HOME=/provenance
volumes:
- ./prov-init:/home/provenance_seed:ro
- provenance:/home/provenance
- provenance:/provenance

vault:
image: vault:latest
Expand Down
Loading

0 comments on commit be1a9f4

Please sign in to comment.