Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34b8a0706d | |||
| 275417c186 | |||
| 40a92e07d6 | |||
| e83a12bd91 | |||
| 381162554e | |||
| 7a740c06fd | |||
| e65285ac7b | |||
| 715a3bd687 | |||
| 858f1ac13c | |||
| 3ee1328626 | |||
| 36ac825b43 | |||
| 165f189115 | |||
| b5fcfbe2fe | |||
| 7a38f1f469 | |||
| 5faca46235 | |||
| d780ac55b1 | |||
| c5f7d066b0 | |||
| 8cc90be8c6 | |||
| aae96e7537 | |||
| 39b521bc1f | |||
| 7339695ce8 | |||
| 0e1c9853aa | |||
| 76b9c669d7 | |||
| 553cfd098b | |||
| 40e1243f3c | |||
| 50d2ca0a12 | |||
| 32d9baaf02 | |||
| 0179f7648c | |||
| 45c04d63e2 | |||
| 0f8ac1506b | |||
| efdf27d1e9 |
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
outputs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
||||
version: ${{ steps.release-info.outputs.version }}
|
||||
filename: ${{ steps.release-info.outputs.filename }}
|
||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
ref=${{ github.ref_name }}
|
||||
semver="${ref##nym-connect-}" && semver="${semver##v}"
|
||||
echo "version=${semver}" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-connect_${semver}_x64.dmg " >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-connect_${version}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
|
||||
echo "file_hash=${{ hashFiles('nym-connect/desktop/target/release/bundle/dmg/nym-connect_*_x64.dmg') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-release-data:
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
outputs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
||||
version: ${{ steps.release-info.outputs.version }}
|
||||
filename: ${{ steps.release-info.outputs.filename }}
|
||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||
@@ -85,9 +85,8 @@ jobs:
|
||||
ref=${{ github.ref_name }}
|
||||
semver="${ref##nym-connect-}" && semver="${semver##v}"
|
||||
echo "version=${semver}" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-connect_${semver}_amd64.AppImage" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-connect_${version}_amd64.AppImage" >> "$GITHUB_OUTPUT"
|
||||
echo "file_hash=${{ hashFiles('nym-connect/desktop/target/release/bundle/appimage/nym-connect_*_amd64.AppImage') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-release-data:
|
||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
||||
uses: ./.github/workflows/push-release-data.yml
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
outputs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
||||
version: ${{ steps.release-info.outputs.version }}
|
||||
filename: ${{ steps.release-info.outputs.filename }}
|
||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
ref=${{ github.ref_name }}
|
||||
semver="${ref##nym-connect-}" && semver="${semver##v}"
|
||||
echo "version=${semver}" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-connect_${semver}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-connect_${version}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
|
||||
echo "file_hash=${{ hashFiles('nym-connect/desktop/target/release/bundle/msi/nym-connect_*_x64_en-US.msi') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-release-data:
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
outputs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
||||
version: ${{ steps.release-info.outputs.version }}
|
||||
filename: ${{ steps.release-info.outputs.filename }}
|
||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
ref=${{ github.ref_name }}
|
||||
semver="${ref##nym-wallet-}" && semver="${semver##v}"
|
||||
echo "version=${semver}" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-wallet_${semver}_x64.dmg" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-wallet_${version}_x64.dmg" >> "$GITHUB_OUTPUT"
|
||||
echo "file_hash=${{ hashFiles('nym-wallet/target/release/bundle/dmg/nym-wallet_*_x64.dmg') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-release-data:
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
outputs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
||||
version: ${{ steps.release-info.outputs.version }}
|
||||
filename: ${{ steps.release-info.outputs.filename }}
|
||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
ref=${{ github.ref_name }}
|
||||
semver="${ref##nym-wallet-}" && semver="${semver##v}"
|
||||
echo "version=${semver}" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-wallet_${semver}_amd64.AppImage" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-wallet_${version}_amd64.AppImage" >> "$GITHUB_OUTPUT"
|
||||
echo "file_hash=${{ hashFiles('nym-wallet/target/release/bundle/appimage/nym-wallet_*_amd64.AppImage') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-release-data:
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
outputs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
||||
version: ${{ steps.release-info.outputs.version }}
|
||||
filename: ${{ steps.release-info.outputs.filename }}
|
||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
ref=${{ github.ref_name }}
|
||||
semver="${ref##nym-wallet-}" && semver="${semver##v}"
|
||||
echo "version=${semver}" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-wallet_${semver}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
|
||||
echo "filename=nym-wallet_${version}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
|
||||
echo "file_hash=${{ hashFiles('nym-wallet/target/release/bundle/msi/nym-wallet_*_x64_en-US.msi') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-release-data:
|
||||
|
||||
Generated
+157
-297
@@ -359,12 +359,6 @@ version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
|
||||
|
||||
[[package]]
|
||||
name = "base16ct"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.1"
|
||||
@@ -406,13 +400,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bip32"
|
||||
version = "0.5.1"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164"
|
||||
checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b"
|
||||
dependencies = [
|
||||
"bs58 0.5.0",
|
||||
"bs58",
|
||||
"hmac 0.12.1",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"once_cell",
|
||||
"pbkdf2",
|
||||
"rand_core 0.6.4",
|
||||
@@ -478,7 +472,7 @@ version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -492,7 +486,7 @@ dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"constant_time_eq",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -546,14 +540,8 @@ name = "bs58"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
||||
|
||||
[[package]]
|
||||
name = "bs58"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896"
|
||||
dependencies = [
|
||||
"sha2 0.10.6",
|
||||
"sha2 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -579,9 +567,6 @@ name = "bytes"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cast"
|
||||
@@ -859,8 +844,8 @@ version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"prost-types",
|
||||
"prost 0.11.9",
|
||||
"prost-types 0.11.9",
|
||||
"tonic",
|
||||
"tracing-core",
|
||||
]
|
||||
@@ -877,7 +862,7 @@ dependencies = [
|
||||
"futures",
|
||||
"hdrhistogram",
|
||||
"humantime 2.1.0",
|
||||
"prost-types",
|
||||
"prost-types 0.11.9",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thread_local",
|
||||
@@ -937,27 +922,29 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
||||
|
||||
[[package]]
|
||||
name = "cosmos-sdk-proto"
|
||||
version = "0.19.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c"
|
||||
checksum = "8bb61f3d2224c90ea78e1fa7444787761a549170c46b6b0ed09b93f9b7e4076a"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"prost-types",
|
||||
"prost 0.10.4",
|
||||
"prost-types 0.10.1",
|
||||
"tendermint-proto",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cosmrs"
|
||||
version = "0.14.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6"
|
||||
checksum = "20d5890dac07a62337e5841adb8f2074a66a962a098a48df9460f64d483beaf4"
|
||||
dependencies = [
|
||||
"bip32",
|
||||
"cosmos-sdk-proto",
|
||||
"ecdsa 0.16.8",
|
||||
"ecdsa",
|
||||
"eyre",
|
||||
"getrandom 0.2.10",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"prost 0.10.4",
|
||||
"prost-types 0.10.1",
|
||||
"rand_core 0.6.4",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -973,9 +960,9 @@ version = "1.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75836a10cb9654c54e77ee56da94d592923092a10b369cdb0dbd56acefc16340"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-zebra",
|
||||
"k256 0.11.6",
|
||||
"k256",
|
||||
"rand_core 0.6.4",
|
||||
"thiserror",
|
||||
]
|
||||
@@ -1221,18 +1208,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15"
|
||||
dependencies = [
|
||||
"generic-array 0.14.7",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
@@ -1355,19 +1330,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek-ng"
|
||||
version = "4.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"digest 0.9.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle-ng",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cw-controllers"
|
||||
version = "1.0.1"
|
||||
@@ -1531,16 +1493,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "der"
|
||||
version = "0.7.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "2.2.0"
|
||||
@@ -1605,12 +1557,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.4",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
@@ -1686,24 +1637,10 @@ version = "0.14.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"elliptic-curve 0.12.3",
|
||||
"rfc6979 0.3.1",
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ecdsa"
|
||||
version = "0.16.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"digest 0.10.7",
|
||||
"elliptic-curve 0.13.5",
|
||||
"rfc6979 0.4.0",
|
||||
"signature 2.1.0",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"elliptic-curve",
|
||||
"rfc6979",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1713,30 +1650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "2.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963"
|
||||
dependencies = [
|
||||
"pkcs8 0.10.2",
|
||||
"signature 2.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519-consensus"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b"
|
||||
dependencies = [
|
||||
"curve25519-dalek-ng",
|
||||
"hex",
|
||||
"rand_core 0.6.4",
|
||||
"sha2 0.9.9",
|
||||
"zeroize",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1746,7 +1660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519 1.5.3",
|
||||
"ed25519",
|
||||
"rand 0.7.3",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
@@ -1781,35 +1695,16 @@ version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"crypto-bigint 0.4.9",
|
||||
"der 0.6.1",
|
||||
"digest 0.10.7",
|
||||
"base16ct",
|
||||
"crypto-bigint",
|
||||
"der",
|
||||
"digest 0.10.6",
|
||||
"ff 0.12.1",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.12.1",
|
||||
"pkcs8 0.9.0",
|
||||
"pkcs8",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.3.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "elliptic-curve"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"crypto-bigint 0.5.2",
|
||||
"digest 0.10.7",
|
||||
"ff 0.13.0",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.13.0",
|
||||
"pkcs8 0.10.2",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.7.3",
|
||||
"sec1",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -2005,16 +1900,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
||||
dependencies = [
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "figment"
|
||||
version = "0.10.8"
|
||||
@@ -2410,17 +2295,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
|
||||
dependencies = [
|
||||
"ff 0.13.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.3.19"
|
||||
@@ -2644,7 +2518,7 @@ version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3101,23 +2975,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"ecdsa 0.14.8",
|
||||
"elliptic-curve 0.12.3",
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"sha2 0.10.6",
|
||||
"sha3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "k256"
|
||||
version = "0.13.1"
|
||||
name = "keccak"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc"
|
||||
checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"ecdsa 0.16.8",
|
||||
"elliptic-curve 0.13.5",
|
||||
"once_cell",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3157,7 +3027,7 @@ name = "ledger"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bip32",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"ledger-transport",
|
||||
"ledger-transport-hid",
|
||||
"thiserror",
|
||||
@@ -3535,7 +3405,7 @@ dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"bip39",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cfg-if",
|
||||
"clap 4.2.7",
|
||||
"console-subscriber",
|
||||
@@ -3602,7 +3472,7 @@ dependencies = [
|
||||
name = "nym-api-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmrs",
|
||||
"cosmwasm-std",
|
||||
"getset",
|
||||
@@ -3657,7 +3527,7 @@ dependencies = [
|
||||
"anyhow",
|
||||
"cosmrs",
|
||||
"eyre",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"nym-cli-commands",
|
||||
"nym-validator-client",
|
||||
"serde",
|
||||
@@ -3672,7 +3542,7 @@ dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.13.1",
|
||||
"bip39",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"clap 4.2.7",
|
||||
"clap_complete",
|
||||
"clap_complete_fig",
|
||||
@@ -3695,7 +3565,7 @@ version = "1.0.0"
|
||||
dependencies = [
|
||||
"base64 0.13.1",
|
||||
"bip39",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cfg-if",
|
||||
"clap 4.2.7",
|
||||
"comfy-table",
|
||||
@@ -3704,7 +3574,7 @@ dependencies = [
|
||||
"cw-utils",
|
||||
"handlebars",
|
||||
"humantime-serde",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"log",
|
||||
"nym-bin-common",
|
||||
"nym-coconut-bandwidth-contract-common",
|
||||
@@ -3827,7 +3697,7 @@ name = "nym-coconut"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bls12_381 0.6.0",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"criterion",
|
||||
"digest 0.9.0",
|
||||
"doc-comment",
|
||||
@@ -3871,7 +3741,7 @@ dependencies = [
|
||||
name = "nym-coconut-interface"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"getset",
|
||||
"nym-coconut",
|
||||
"serde",
|
||||
@@ -3895,7 +3765,7 @@ dependencies = [
|
||||
name = "nym-contracts-common"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"schemars",
|
||||
"serde",
|
||||
@@ -3954,10 +3824,10 @@ version = "0.4.0"
|
||||
dependencies = [
|
||||
"aes 0.8.2",
|
||||
"blake3",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cipher 0.4.4",
|
||||
"ctr 0.9.2",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-dalek",
|
||||
"generic-array 0.14.7",
|
||||
"hkdf 0.12.3",
|
||||
@@ -3980,7 +3850,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"bls12_381 0.6.0",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"criterion",
|
||||
"ff 0.11.1",
|
||||
"group 0.11.0",
|
||||
@@ -4013,7 +3883,7 @@ dependencies = [
|
||||
"async-trait",
|
||||
"atty",
|
||||
"bip39",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"clap 4.2.7",
|
||||
"colored",
|
||||
"dashmap 4.0.2",
|
||||
@@ -4090,7 +3960,7 @@ dependencies = [
|
||||
name = "nym-gateway-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"futures",
|
||||
"generic-array 0.14.7",
|
||||
"log",
|
||||
@@ -4143,7 +4013,7 @@ dependencies = [
|
||||
name = "nym-mixnet-contract-common"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"humantime-serde",
|
||||
"log",
|
||||
@@ -4163,7 +4033,7 @@ name = "nym-mixnode"
|
||||
version = "1.1.24"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cfg-if",
|
||||
"clap 4.2.7",
|
||||
"colored",
|
||||
@@ -4281,7 +4151,7 @@ dependencies = [
|
||||
"anyhow",
|
||||
"async-file-watcher",
|
||||
"async-trait",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"clap 4.2.7",
|
||||
"dirs 4.0.0",
|
||||
"futures",
|
||||
@@ -4645,7 +4515,7 @@ dependencies = [
|
||||
name = "nym-sphinx-anonymous-replies"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"nym-crypto",
|
||||
"nym-sphinx-addressing",
|
||||
"nym-sphinx-params",
|
||||
@@ -4784,7 +4654,7 @@ name = "nym-topology"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"log",
|
||||
"nym-bin-common",
|
||||
"nym-crypto",
|
||||
@@ -4854,12 +4724,11 @@ dependencies = [
|
||||
"nym-vesting-contract",
|
||||
"nym-vesting-contract-common",
|
||||
"openssl",
|
||||
"prost",
|
||||
"prost 0.10.4",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.9.9",
|
||||
"tendermint-rpc",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"ts-rs",
|
||||
@@ -5215,12 +5084,11 @@ checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
||||
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"hmac 0.12.1",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5372,18 +5240,8 @@ version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"spki 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5544,6 +5402,16 @@ dependencies = [
|
||||
"yansi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive 0.10.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.11.9"
|
||||
@@ -5551,7 +5419,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
"prost-derive 0.11.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5567,13 +5448,23 @@ dependencies = [
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost 0.10.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.11.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"prost 0.11.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5975,21 +5866,11 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb"
|
||||
dependencies = [
|
||||
"crypto-bigint 0.4.9",
|
||||
"crypto-bigint",
|
||||
"hmac 0.12.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfc6979"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
||||
dependencies = [
|
||||
"hmac 0.12.1",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.16.20"
|
||||
@@ -6011,7 +5892,18 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ripemd160"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251"
|
||||
dependencies = [
|
||||
"block-buffer 0.9.0",
|
||||
"digest 0.9.0",
|
||||
"opaque-debug 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6341,24 +6233,10 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"der 0.6.1",
|
||||
"base16ct",
|
||||
"der",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.9.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sec1"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"der 0.7.7",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.10.2",
|
||||
"pkcs8",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -6558,7 +6436,7 @@ checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6569,7 +6447,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6593,7 +6471,17 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha3"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
|
||||
dependencies = [
|
||||
"digest 0.10.6",
|
||||
"keccak",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6641,17 +6529,7 @@ version = "1.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
@@ -6722,7 +6600,7 @@ dependencies = [
|
||||
"aes 0.7.5",
|
||||
"arrayref",
|
||||
"blake2 0.8.1",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"byteorder",
|
||||
"chacha",
|
||||
"curve25519-dalek",
|
||||
@@ -6759,17 +6637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.6.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spki"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.7.7",
|
||||
"der",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7069,12 +6937,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle-ng"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
@@ -7139,28 +7001,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0"
|
||||
checksum = "a199518e0366ba0aeb0d0e0a59dbd99ea0bdc14280f414ecc758c9228a454ad8"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"digest 0.10.7",
|
||||
"ed25519 2.2.1",
|
||||
"ed25519-consensus",
|
||||
"ed25519",
|
||||
"ed25519-dalek",
|
||||
"flex-error",
|
||||
"futures",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"ripemd",
|
||||
"prost 0.10.4",
|
||||
"prost-types 0.10.1",
|
||||
"ripemd160",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"sha2 0.9.9",
|
||||
"signature",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint-proto",
|
||||
@@ -7170,9 +7032,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-config"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372"
|
||||
checksum = "c6d8f6a64ae3b59ea3c73efad727271ee085b544b817d7f46901817ca6bb1773"
|
||||
dependencies = [
|
||||
"flex-error",
|
||||
"serde",
|
||||
@@ -7184,16 +7046,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-proto"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d"
|
||||
checksum = "1b303d6387aaea38cea7ef924476d1f798573044e7b4f6ddd1166ac5184b2281"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flex-error",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"prost 0.10.4",
|
||||
"prost-types 0.10.1",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"subtle-encoding",
|
||||
@@ -7202,9 +7064,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-rpc"
|
||||
version = "0.32.0"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd2cc789170db5a35d4e0bb2490035c03ef96df08f119bee25fd8dab5a09aa25"
|
||||
checksum = "3036f0b65baa11e767dabd22a0663e842b595b0a1903f149b7b8b1e09b2b443d"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
@@ -7217,11 +7079,9 @@ dependencies = [
|
||||
"hyper-rustls",
|
||||
"peg",
|
||||
"pin-project",
|
||||
"semver 1.0.17",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint",
|
||||
"tendermint-config",
|
||||
@@ -7578,7 +7438,7 @@ dependencies = [
|
||||
"hyper-timeout",
|
||||
"percent-encoding",
|
||||
"pin-project",
|
||||
"prost",
|
||||
"prost 0.11.9",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tower",
|
||||
|
||||
+2
-4
@@ -121,9 +121,7 @@ cosmwasm-derive = "=1.2.5"
|
||||
cosmwasm-schema = "=1.2.5"
|
||||
cosmwasm-std = "=1.2.5"
|
||||
cosmwasm-storage = "=1.2.5"
|
||||
cosmrs = "=0.14.0"
|
||||
# same version as used by cosmrs
|
||||
tendermint-rpc = "=0.32"
|
||||
cosmrs = "=0.8.0"
|
||||
cw-utils = "=1.0.1"
|
||||
cw-storage-plus = "=1.0.1"
|
||||
cw2 = { version = "=1.0.1" }
|
||||
@@ -133,7 +131,7 @@ cw4 = { version = "=1.0.1" }
|
||||
cw-controllers = { version = "=1.0.1" }
|
||||
dotenvy = "0.15.6"
|
||||
generic-array = "0.14.7"
|
||||
k256 = "0.13"
|
||||
k256 = "0.11"
|
||||
getrandom = "0.2.10"
|
||||
lazy_static = "1.4.0"
|
||||
log = "0.4"
|
||||
|
||||
@@ -21,5 +21,5 @@ nym-credential-storage = { path = "../../common/credential-storage" }
|
||||
nym-bin-common = { path = "../../common/bin-common"}
|
||||
nym-network-defaults = { path = "../../common/network-defaults" }
|
||||
nym-pemstore = { path = "../../common/pemstore" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] }
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ nym-sphinx = { path = "../../common/nymsphinx" }
|
||||
nym-pemstore = { path = "../../common/pemstore" }
|
||||
nym-task = { path = "../../common/task" }
|
||||
nym-topology = { path = "../../common/topology" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client", features = ["http-client"] }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] }
|
||||
nym-client-websocket-requests = { path = "websocket-requests" }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
Generated
+109
-281
@@ -217,12 +217,6 @@ version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
|
||||
|
||||
[[package]]
|
||||
name = "base16ct"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.1"
|
||||
@@ -243,13 +237,13 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
|
||||
|
||||
[[package]]
|
||||
name = "bip32"
|
||||
version = "0.5.1"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164"
|
||||
checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b"
|
||||
dependencies = [
|
||||
"bs58 0.5.0",
|
||||
"bs58",
|
||||
"hmac 0.12.1",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"once_cell",
|
||||
"pbkdf2",
|
||||
"rand_core 0.6.4",
|
||||
@@ -315,7 +309,7 @@ version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -329,7 +323,7 @@ dependencies = [
|
||||
"cc",
|
||||
"cfg-if 1.0.0",
|
||||
"constant_time_eq",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -383,14 +377,8 @@ name = "bs58"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
||||
|
||||
[[package]]
|
||||
name = "bs58"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896"
|
||||
dependencies = [
|
||||
"sha2 0.10.6",
|
||||
"sha2 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -416,9 +404,6 @@ name = "bytes"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
@@ -613,9 +598,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
||||
|
||||
[[package]]
|
||||
name = "cosmos-sdk-proto"
|
||||
version = "0.19.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c"
|
||||
checksum = "8bb61f3d2224c90ea78e1fa7444787761a549170c46b6b0ed09b93f9b7e4076a"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"prost-types",
|
||||
@@ -624,16 +609,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cosmrs"
|
||||
version = "0.14.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6"
|
||||
checksum = "20d5890dac07a62337e5841adb8f2074a66a962a098a48df9460f64d483beaf4"
|
||||
dependencies = [
|
||||
"bip32",
|
||||
"cosmos-sdk-proto",
|
||||
"ecdsa 0.16.8",
|
||||
"ecdsa",
|
||||
"eyre",
|
||||
"getrandom 0.2.10",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"rand_core 0.6.4",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -649,9 +636,9 @@ version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d076a08ec01ed23c4396aca98ec73a38fa1fee5f310465add52b4108181c7a8"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-zebra",
|
||||
"k256 0.11.6",
|
||||
"k256",
|
||||
"rand_core 0.6.4",
|
||||
"thiserror",
|
||||
]
|
||||
@@ -828,18 +815,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15"
|
||||
dependencies = [
|
||||
"generic-array 0.14.7",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
@@ -912,19 +887,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek-ng"
|
||||
version = "4.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"digest 0.9.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle-ng",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cw-controllers"
|
||||
version = "1.0.1"
|
||||
@@ -1043,16 +1005,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "der"
|
||||
version = "0.7.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "2.2.0"
|
||||
@@ -1084,12 +1036,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.4",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
@@ -1159,24 +1110,10 @@ version = "0.14.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"elliptic-curve 0.12.3",
|
||||
"rfc6979 0.3.1",
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ecdsa"
|
||||
version = "0.16.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"digest 0.10.7",
|
||||
"elliptic-curve 0.13.5",
|
||||
"rfc6979 0.4.0",
|
||||
"signature 2.1.0",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"elliptic-curve",
|
||||
"rfc6979",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1186,30 +1123,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "2.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963"
|
||||
dependencies = [
|
||||
"pkcs8 0.10.2",
|
||||
"signature 2.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519-consensus"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b"
|
||||
dependencies = [
|
||||
"curve25519-dalek-ng",
|
||||
"hex",
|
||||
"rand_core 0.6.4",
|
||||
"sha2 0.9.9",
|
||||
"zeroize",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1219,7 +1133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519 1.5.3",
|
||||
"ed25519",
|
||||
"rand 0.7.3",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
@@ -1254,35 +1168,16 @@ version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"crypto-bigint 0.4.9",
|
||||
"der 0.6.1",
|
||||
"digest 0.10.7",
|
||||
"base16ct",
|
||||
"crypto-bigint",
|
||||
"der",
|
||||
"digest 0.10.6",
|
||||
"ff 0.12.1",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.12.1",
|
||||
"pkcs8 0.9.0",
|
||||
"pkcs8",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.3.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "elliptic-curve"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"crypto-bigint 0.5.2",
|
||||
"digest 0.10.7",
|
||||
"ff 0.13.0",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.13.0",
|
||||
"pkcs8 0.10.2",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.7.3",
|
||||
"sec1",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -1405,16 +1300,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
||||
dependencies = [
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.26"
|
||||
@@ -1718,17 +1603,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
|
||||
dependencies = [
|
||||
"ff 0.13.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.3.19"
|
||||
@@ -1912,7 +1786,7 @@ version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2188,23 +2062,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"ecdsa 0.14.8",
|
||||
"elliptic-curve 0.12.3",
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"sha2 0.10.6",
|
||||
"sha3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "k256"
|
||||
version = "0.13.1"
|
||||
name = "keccak"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc"
|
||||
checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"ecdsa 0.16.8",
|
||||
"elliptic-curve 0.13.5",
|
||||
"once_cell",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2420,7 +2290,7 @@ dependencies = [
|
||||
name = "nym-api-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmrs",
|
||||
"cosmwasm-std",
|
||||
"getset",
|
||||
@@ -2512,7 +2382,7 @@ version = "1.1.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"console_error_panic_hook",
|
||||
"futures",
|
||||
"js-sys",
|
||||
@@ -2550,7 +2420,7 @@ name = "nym-coconut"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bls12_381 0.6.0",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"digest 0.9.0",
|
||||
"ff 0.11.1",
|
||||
"getrandom 0.2.10",
|
||||
@@ -2591,7 +2461,7 @@ dependencies = [
|
||||
name = "nym-coconut-interface"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"getset",
|
||||
"nym-coconut",
|
||||
"serde",
|
||||
@@ -2615,7 +2485,7 @@ dependencies = [
|
||||
name = "nym-contracts-common"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"schemars",
|
||||
"serde",
|
||||
@@ -2652,10 +2522,10 @@ version = "0.4.0"
|
||||
dependencies = [
|
||||
"aes 0.8.2",
|
||||
"blake3",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cipher 0.4.4",
|
||||
"ctr 0.9.2",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-dalek",
|
||||
"generic-array 0.14.7",
|
||||
"hkdf 0.12.3",
|
||||
@@ -2677,7 +2547,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"bls12_381 0.6.0",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"ff 0.11.1",
|
||||
"group 0.11.0",
|
||||
"lazy_static",
|
||||
@@ -2727,7 +2597,7 @@ dependencies = [
|
||||
name = "nym-gateway-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"futures",
|
||||
"generic-array 0.14.7",
|
||||
"log",
|
||||
@@ -2759,7 +2629,7 @@ dependencies = [
|
||||
name = "nym-mixnet-contract-common"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"humantime-serde",
|
||||
"log",
|
||||
@@ -2936,7 +2806,7 @@ dependencies = [
|
||||
name = "nym-sphinx-anonymous-replies"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"nym-crypto",
|
||||
"nym-sphinx-addressing",
|
||||
"nym-sphinx-params",
|
||||
@@ -3060,7 +2930,7 @@ name = "nym-topology"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"log",
|
||||
"nym-bin-common",
|
||||
"nym-crypto",
|
||||
@@ -3109,7 +2979,6 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.9.9",
|
||||
"tendermint-rpc",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"url",
|
||||
@@ -3298,12 +3167,11 @@ checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
||||
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"hmac 0.12.1",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3432,18 +3300,8 @@ version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"spki 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3526,9 +3384,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.11.9"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd"
|
||||
checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
@@ -3536,9 +3394,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.11.9"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4"
|
||||
checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools",
|
||||
@@ -3549,10 +3407,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.11.9"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13"
|
||||
checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost",
|
||||
]
|
||||
|
||||
@@ -3775,21 +3634,11 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb"
|
||||
dependencies = [
|
||||
"crypto-bigint 0.4.9",
|
||||
"crypto-bigint",
|
||||
"hmac 0.12.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfc6979"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
||||
dependencies = [
|
||||
"hmac 0.12.1",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.16.20"
|
||||
@@ -3811,7 +3660,18 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ripemd160"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251"
|
||||
dependencies = [
|
||||
"block-buffer 0.9.0",
|
||||
"digest 0.9.0",
|
||||
"opaque-debug 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3976,24 +3836,10 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"der 0.6.1",
|
||||
"base16ct",
|
||||
"der",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.9.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sec1"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"der 0.7.7",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.10.2",
|
||||
"pkcs8",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -4178,7 +4024,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4202,7 +4048,17 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha3"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
|
||||
dependencies = [
|
||||
"digest 0.10.6",
|
||||
"keccak",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4220,17 +4076,7 @@ version = "1.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
@@ -4268,7 +4114,7 @@ dependencies = [
|
||||
"aes 0.7.5",
|
||||
"arrayref",
|
||||
"blake2 0.8.1",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"byteorder",
|
||||
"chacha",
|
||||
"curve25519-dalek",
|
||||
@@ -4305,17 +4151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.6.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spki"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.7.7",
|
||||
"der",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4554,12 +4390,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle-ng"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
@@ -4603,28 +4433,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0"
|
||||
checksum = "a199518e0366ba0aeb0d0e0a59dbd99ea0bdc14280f414ecc758c9228a454ad8"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"digest 0.10.7",
|
||||
"ed25519 2.2.1",
|
||||
"ed25519-consensus",
|
||||
"ed25519",
|
||||
"ed25519-dalek",
|
||||
"flex-error",
|
||||
"futures",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"ripemd",
|
||||
"ripemd160",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"sha2 0.9.9",
|
||||
"signature",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint-proto",
|
||||
@@ -4634,9 +4464,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-config"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372"
|
||||
checksum = "c6d8f6a64ae3b59ea3c73efad727271ee085b544b817d7f46901817ca6bb1773"
|
||||
dependencies = [
|
||||
"flex-error",
|
||||
"serde",
|
||||
@@ -4648,9 +4478,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-proto"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d"
|
||||
checksum = "1b303d6387aaea38cea7ef924476d1f798573044e7b4f6ddd1166ac5184b2281"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flex-error",
|
||||
@@ -4666,9 +4496,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-rpc"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d119d83a130537fc4a98c3c9eb6899ebe857fea4860400a61675bfb5f0b35129"
|
||||
checksum = "3036f0b65baa11e767dabd22a0663e842b595b0a1903f149b7b8b1e09b2b443d"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
@@ -4681,11 +4511,9 @@ dependencies = [
|
||||
"hyper-rustls",
|
||||
"peg",
|
||||
"pin-project",
|
||||
"semver 1.0.17",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint",
|
||||
"tendermint-config",
|
||||
|
||||
@@ -18,6 +18,7 @@ nym-crypto = { path = "../crypto", features = ["rand", "asymmetric", "symmetric"
|
||||
nym-network-defaults = { path = "../network-defaults" }
|
||||
nym-validator-client = { path = "../client-libs/validator-client", default-features = false }
|
||||
|
||||
|
||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.nym-validator-client]
|
||||
path = "../client-libs/validator-client"
|
||||
features = ["signing"]
|
||||
features = ["nyxd-client"]
|
||||
|
||||
@@ -10,8 +10,8 @@ use nym_crypto::asymmetric::{encryption, identity};
|
||||
use nym_network_defaults::VOUCHER_INFO;
|
||||
use nym_validator_client::nyxd::traits::CoconutBandwidthSigningClient;
|
||||
use nym_validator_client::nyxd::traits::DkgQueryClient;
|
||||
use nym_validator_client::nyxd::tx::Hash;
|
||||
use nym_validator_client::nyxd::Coin;
|
||||
use nym_validator_client::nyxd::Hash;
|
||||
use nym_validator_client::CoconutApiClient;
|
||||
use rand::rngs::OsRng;
|
||||
use state::{KeyPair, State};
|
||||
|
||||
@@ -45,7 +45,7 @@ nym-network-defaults = { path = "../network-defaults" }
|
||||
|
||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.nym-validator-client]
|
||||
path = "../client-libs/validator-client"
|
||||
features = ["signing", "http-client"]
|
||||
features = ["nyxd-client"]
|
||||
|
||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio-stream]
|
||||
version = "0.1.11"
|
||||
|
||||
@@ -38,7 +38,6 @@ use wasm_utils::websocket::JSWebsocket;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
type WsConn = JSWebsocket;
|
||||
|
||||
const CONCURRENT_GATEWAYS_MEASURED: usize = 20;
|
||||
const MEASUREMENTS: usize = 3;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
@@ -159,29 +158,23 @@ pub(super) async fn choose_gateway_by_latency<R: Rng>(
|
||||
rng: &mut R,
|
||||
gateways: &[gateway::Node],
|
||||
) -> Result<gateway::Node, ClientCoreError> {
|
||||
info!(
|
||||
"choosing gateway by latency, pinging {} gateways ...",
|
||||
gateways.len()
|
||||
);
|
||||
info!("choosing gateway by latency...");
|
||||
|
||||
let gateways_with_latency = Arc::new(tokio::sync::Mutex::new(Vec::new()));
|
||||
futures::stream::iter(gateways)
|
||||
.for_each_concurrent(CONCURRENT_GATEWAYS_MEASURED, |gateway| async {
|
||||
let id = *gateway.identity();
|
||||
trace!("measuring latency to {id}...");
|
||||
match measure_latency(gateway).await {
|
||||
Ok(with_latency) => {
|
||||
debug!("{id}: {:?}", with_latency.latency);
|
||||
gateways_with_latency.lock().await.push(with_latency);
|
||||
}
|
||||
Err(err) => {
|
||||
warn!("failed to measure {id}: {err}");
|
||||
}
|
||||
};
|
||||
})
|
||||
.await;
|
||||
let mut gateways_with_latency = Vec::new();
|
||||
for gateway in gateways {
|
||||
let id = *gateway.identity();
|
||||
trace!("measuring latency to {id}...");
|
||||
let with_latency = match measure_latency(gateway).await {
|
||||
Ok(res) => res,
|
||||
Err(err) => {
|
||||
warn!("failed to measure {id}: {err}");
|
||||
continue;
|
||||
}
|
||||
};
|
||||
debug!("{id}: {:?}", with_latency.latency);
|
||||
gateways_with_latency.push(with_latency)
|
||||
}
|
||||
|
||||
let gateways_with_latency = gateways_with_latency.lock().await;
|
||||
let chosen = gateways_with_latency
|
||||
.choose_weighted(rng, |item| 1. / item.latency.as_secs_f32())
|
||||
.expect("invalid selection weight!");
|
||||
|
||||
@@ -35,30 +35,27 @@ nym-coconut-interface = { path = "../../coconut-interface" }
|
||||
nym-network-defaults = { path = "../../network-defaults" }
|
||||
nym-api-requests = { path = "../../../nym-api/nym-api-requests" }
|
||||
|
||||
async-trait = { workspace = true }
|
||||
# required for nyxd-client
|
||||
# at some point it might be possible to make it wasm-compatible
|
||||
# perhaps after https://github.com/cosmos/cosmos-rust/pull/97 is resolved (and tendermint-rs is updated)
|
||||
async-trait = { workspace = true, optional = true }
|
||||
bip39 = { workspace = true, features = ["rand"], optional = true }
|
||||
nym-config = { path = "../../config" }
|
||||
cosmrs = { workspace = true, features = ["bip32", "cosmwasm"] }
|
||||
#cosmrs = { workspace = true, features = ["bip32", "rpc", "cosmwasm"], optional = true }
|
||||
nym-config = { path = "../../config", optional = true }
|
||||
cosmrs = { workspace = true, features = ["rpc", "bip32", "cosmwasm"], optional = true }
|
||||
# note that this has the same version as used by cosmrs
|
||||
|
||||
# import it just for the `Client` trait
|
||||
tendermint-rpc = { workspace = true }
|
||||
|
||||
eyre = { version = "0.6", optional = true }
|
||||
cw3 = { workspace = true }
|
||||
cw4 = { workspace = true }
|
||||
prost = { version = "0.11", default-features = false }
|
||||
flate2 = { version = "1.0.20" }
|
||||
sha2 = { version = "0.9.5" }
|
||||
itertools = { version = "0.10" }
|
||||
cw3 = { workspace = true, optional = true }
|
||||
cw4 = { workspace = true, optional = true }
|
||||
prost = { version = "0.10", default-features = false, optional = true }
|
||||
flate2 = { version = "1.0.20", optional = true }
|
||||
sha2 = { version = "0.9.5", optional = true }
|
||||
itertools = { version = "0.10", optional = true }
|
||||
zeroize = { version = "1.5.7", optional = true, features = ["zeroize_derive"] }
|
||||
cosmwasm-std = { workspace = true }
|
||||
cosmwasm-std = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bip39 = { workspace = true }
|
||||
#cosmrs = { workspace = true, features = ["rpc", "bip32"] }
|
||||
cosmrs = { workspace = true, features = ["bip32"] }
|
||||
cosmrs = { workspace = true, features = ["rpc", "bip32"] }
|
||||
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
|
||||
ts-rs = "6.1.2"
|
||||
|
||||
@@ -67,23 +64,35 @@ name = "offline_signing"
|
||||
# it should only really require the "signing" feature,
|
||||
# but that would require another round of refactoring to make it possible
|
||||
# (traits would need to be moved around and refactored themselves)
|
||||
required-features = ["http-client", "signing"]
|
||||
required-features = ["nyxd-client"]
|
||||
|
||||
[[example]]
|
||||
name = "query_service_provider_directory"
|
||||
# TODO: validate the requirements
|
||||
required-features = ["http-client", "signing"]
|
||||
required-features = ["nyxd-client"]
|
||||
|
||||
[[example]]
|
||||
name = "query_name_service"
|
||||
# TODO: validate the requirements
|
||||
required-features = ["http-client", "signing"]
|
||||
required-features = ["nyxd-client"]
|
||||
|
||||
[features]
|
||||
http-client = ["cosmrs/rpc", "openssl"]
|
||||
nyxd-client = [
|
||||
"async-trait",
|
||||
"cosmrs",
|
||||
"cosmwasm-std",
|
||||
"cw3",
|
||||
"cw4",
|
||||
"flate2",
|
||||
"itertools",
|
||||
"openssl",
|
||||
"prost",
|
||||
"sha2",
|
||||
"signing"
|
||||
]
|
||||
signing = [
|
||||
"bip39",
|
||||
"cosmrs",
|
||||
"eyre",
|
||||
"nym-config",
|
||||
"zeroize"
|
||||
]
|
||||
generate-ts = []
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use cosmrs::bank::MsgSend;
|
||||
use cosmrs::rpc::HttpClient;
|
||||
use cosmrs::rpc::{self, HttpClient};
|
||||
use cosmrs::tx::Msg;
|
||||
use cosmrs::{tx, AccountId, Coin, Denom};
|
||||
use nym_validator_client::nyxd::CosmWasmClient;
|
||||
@@ -54,7 +54,7 @@ async fn main() {
|
||||
denom,
|
||||
amount: 2500u32.into(),
|
||||
},
|
||||
100000u32,
|
||||
100000,
|
||||
);
|
||||
|
||||
let tx_raw = tx_signer
|
||||
@@ -70,7 +70,7 @@ async fn main() {
|
||||
.unwrap();
|
||||
|
||||
// broadcast the tx
|
||||
let res = tendermint_rpc::client::Client::broadcast_tx_commit(&broadcaster, tx_bytes)
|
||||
let res = rpc::Client::broadcast_tx_commit(&broadcaster, tx_bytes.into())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
||||
@@ -16,35 +16,37 @@ pub use nym_mixnet_contract_common::{
|
||||
};
|
||||
use url::Url;
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use crate::nyxd::traits::{DkgQueryClient, MixnetQueryClient};
|
||||
#[cfg(feature = "http-client")]
|
||||
use crate::nyxd::QueryNyxdClient;
|
||||
use crate::nyxd::{self, CosmWasmClient, NyxdClient};
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use crate::nyxd::{self, CosmWasmClient, NyxdClient, QueryNyxdClient, SigningNyxdClient};
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use crate::signing::direct_wallet::DirectSecp256k1HdWallet;
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use nym_api_requests::models::MixNodeBondAnnotated;
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use nym_coconut_dkg_common::{types::EpochId, verification_key::ContractVKShare};
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use nym_coconut_interface::Base58;
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use nym_mixnet_contract_common::{
|
||||
families::{Family, FamilyHead},
|
||||
mixnode::MixNodeBond,
|
||||
pending_events::{PendingEpochEvent, PendingIntervalEvent},
|
||||
Delegation, RewardedSetNodeStatus, UnbondedMixnode,
|
||||
};
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use nym_network_defaults::NymNetworkDetails;
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
use std::str::FromStr;
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
use crate::nyxd::SigningNyxdClient;
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
use crate::signing::direct_wallet::DirectSecp256k1HdWallet;
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
#[must_use]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Config {
|
||||
api_url: Url,
|
||||
nyxd_url: Url,
|
||||
|
||||
// TODO: until refactored, this is a dead field under some features
|
||||
#[allow(dead_code)]
|
||||
nyxd_config: nyxd::Config,
|
||||
|
||||
mixnode_page_limit: Option<u32>,
|
||||
@@ -53,6 +55,7 @@ pub struct Config {
|
||||
rewarded_set_page_limit: Option<u32>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
impl Config {
|
||||
pub fn try_from_nym_network_details(
|
||||
details: &NymNetworkDetails,
|
||||
@@ -116,6 +119,7 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
pub struct Client<C> {
|
||||
mixnode_page_limit: Option<u32>,
|
||||
gateway_page_limit: Option<u32>,
|
||||
@@ -127,7 +131,7 @@ pub struct Client<C> {
|
||||
pub nyxd: NyxdClient<C>,
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
impl Client<SigningNyxdClient<DirectSecp256k1HdWallet>> {
|
||||
pub fn new_signing(
|
||||
config: Config,
|
||||
@@ -161,7 +165,7 @@ impl Client<SigningNyxdClient<DirectSecp256k1HdWallet>> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
impl Client<QueryNyxdClient> {
|
||||
pub fn new_query(config: Config) -> Result<Client<QueryNyxdClient>, ValidatorClientError> {
|
||||
let nym_api_client = nym_api::Client::new(config.api_url.clone());
|
||||
@@ -185,6 +189,7 @@ impl Client<QueryNyxdClient> {
|
||||
}
|
||||
|
||||
// nyxd wrappers
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
impl<C> Client<C> {
|
||||
// use case: somebody initialised client without a contract in order to upload and initialise one
|
||||
// and now they want to actually use it without making new client
|
||||
@@ -567,6 +572,7 @@ impl<C> Client<C> {
|
||||
}
|
||||
|
||||
// validator-api wrappers
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
impl<C> Client<C> {
|
||||
pub fn change_nym_api(&mut self, new_endpoint: Url) {
|
||||
self.nym_api.change_url(new_endpoint)
|
||||
@@ -629,9 +635,11 @@ pub struct CoconutApiClient {
|
||||
pub api_client: NymApiClient,
|
||||
pub verification_key: VerificationKey,
|
||||
pub node_id: NodeIndex,
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
pub cosmos_address: cosmrs::AccountId,
|
||||
}
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
impl CoconutApiClient {
|
||||
pub async fn all_coconut_api_clients<C>(
|
||||
client: &C,
|
||||
|
||||
@@ -120,7 +120,7 @@ async fn test_nyxd_connection(
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(Err(NyxdError::TendermintErrorRpc(e))) => {
|
||||
Ok(Err(NyxdError::TendermintError(e))) => {
|
||||
// If we get a tendermint-rpc error, we classify the node as not contactable
|
||||
log::warn!("Checking: nyxd url: {url}: {}: {}", "failed".red(), e);
|
||||
false
|
||||
|
||||
@@ -15,6 +15,7 @@ pub enum ValidatorClientError {
|
||||
#[error("One of the provided URLs was malformed - {0}")]
|
||||
MalformedUrlProvided(#[from] url::ParseError),
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
#[error("nyxd request failed - {0}")]
|
||||
NyxdError(#[from] crate::nyxd::error::NyxdError),
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pub mod client;
|
||||
#[cfg(feature = "http-client")]
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
pub mod connection_tester;
|
||||
pub mod error;
|
||||
pub mod nym_api;
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
pub mod nyxd;
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
@@ -15,4 +16,5 @@ pub use crate::error::ValidatorClientError;
|
||||
pub use client::NymApiClient;
|
||||
pub use nym_api_requests::*;
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
pub use client::{Client, CoconutApiClient, Config};
|
||||
|
||||
@@ -52,6 +52,7 @@ impl<'a> Div<GasPrice> for &'a Coin {
|
||||
} else {
|
||||
implicit_gas_limit.u128() as u64
|
||||
}
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,32 +191,32 @@ mod tests {
|
||||
let amount = Coin::new(3938, "unym");
|
||||
let gas_price = "0.025unym".parse().unwrap();
|
||||
let res = amount / gas_price;
|
||||
assert_eq!(157520, res);
|
||||
assert_eq!(157520, res.value());
|
||||
|
||||
let amount = Coin::new(1234567890, "unym");
|
||||
let gas_price = "0.025unym".parse().unwrap();
|
||||
let res = amount / gas_price;
|
||||
assert_eq!(49382715600, res);
|
||||
assert_eq!(49382715600, res.value());
|
||||
|
||||
let amount = Coin::new(1, "unym");
|
||||
let gas_price = "0.025unym".parse().unwrap();
|
||||
let res = amount / gas_price;
|
||||
assert_eq!(40, res);
|
||||
assert_eq!(40, res.value());
|
||||
|
||||
let amount = Coin::new(150_000_000, "unym");
|
||||
let gas_price = "0.001234unym".parse().unwrap();
|
||||
let res = amount / gas_price;
|
||||
assert_eq!(121555915721, res);
|
||||
assert_eq!(121555915721, res.value());
|
||||
|
||||
let amount = Coin::new(150_000_000, "unym");
|
||||
let gas_price = "1unym".parse().unwrap();
|
||||
let res = amount / gas_price;
|
||||
assert_eq!(150_000_000, res);
|
||||
assert_eq!(150_000_000, res.value());
|
||||
|
||||
let amount = Coin::new(150_000_000, "unym");
|
||||
let gas_price = "1234.56unym".parse().unwrap();
|
||||
let res = amount / gas_price;
|
||||
assert_eq!(121500, res);
|
||||
assert_eq!(121500, res.value());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use crate::nyxd;
|
||||
use crate::nyxd::coin::Coin;
|
||||
use crate::nyxd::cosmwasm_client::helpers::{create_pagination, next_page_key};
|
||||
use crate::nyxd::cosmwasm_client::types::{
|
||||
Account, CodeDetails, Contract, ContractCodeId, SequenceResponse, SimulateResponse,
|
||||
Account, Code, CodeDetails, Contract, ContractCodeHistoryEntry, ContractCodeId,
|
||||
SequenceResponse, SimulateResponse,
|
||||
};
|
||||
use crate::nyxd::error::NyxdError;
|
||||
use crate::nyxd::TendermintClient;
|
||||
use async_trait::async_trait;
|
||||
use cosmrs::cosmwasm::{CodeInfoResponse, ContractCodeHistoryEntry};
|
||||
use cosmrs::proto::cosmos::auth::v1beta1::{QueryAccountRequest, QueryAccountResponse};
|
||||
use cosmrs::proto::cosmos::bank::v1beta1::{
|
||||
QueryAllBalancesRequest, QueryAllBalancesResponse, QueryBalanceRequest, QueryBalanceResponse,
|
||||
@@ -19,28 +18,22 @@ use cosmrs::proto::cosmos::bank::v1beta1::{
|
||||
use cosmrs::proto::cosmos::tx::v1beta1::{
|
||||
SimulateRequest, SimulateResponse as ProtoSimulateResponse,
|
||||
};
|
||||
use cosmrs::proto::cosmwasm::wasm::v1::{
|
||||
QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse,
|
||||
QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractInfoRequest,
|
||||
QueryContractInfoResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse,
|
||||
QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest,
|
||||
QuerySmartContractStateResponse,
|
||||
};
|
||||
use cosmrs::tendermint::{block, chain, Hash};
|
||||
use cosmrs::{AccountId, Coin as CosmosCoin, Tx};
|
||||
use cosmrs::proto::cosmwasm::wasm::v1::*;
|
||||
use cosmrs::rpc::endpoint::block::Response as BlockResponse;
|
||||
use cosmrs::rpc::endpoint::broadcast;
|
||||
use cosmrs::rpc::endpoint::tx::Response as TxResponse;
|
||||
use cosmrs::rpc::query::Query;
|
||||
use cosmrs::rpc::{self, HttpClient, Order};
|
||||
use cosmrs::tendermint::abci::Transaction;
|
||||
use cosmrs::tendermint::{abci, block, chain};
|
||||
use cosmrs::{tx, AccountId, Coin as CosmosCoin, Tx};
|
||||
use prost::Message;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::convert::TryFrom;
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
use std::time::Duration;
|
||||
use tendermint_rpc::{
|
||||
endpoint::{block::Response as BlockResponse, broadcast, tx::Response as TxResponse},
|
||||
query::Query,
|
||||
Order,
|
||||
};
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
#[async_trait]
|
||||
impl CosmWasmClient for cosmrs::rpc::HttpClient {
|
||||
impl CosmWasmClient for HttpClient {
|
||||
fn broadcast_polling_rate(&self) -> Duration {
|
||||
Duration::from_secs(4)
|
||||
}
|
||||
@@ -51,7 +44,7 @@ impl CosmWasmClient for cosmrs::rpc::HttpClient {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait CosmWasmClient: TendermintClient {
|
||||
pub trait CosmWasmClient: rpc::Client {
|
||||
// this should probably get redesigned, but I'm leaving those like that temporarily to fix
|
||||
// the underlying issue more quickly
|
||||
fn broadcast_polling_rate(&self) -> Duration;
|
||||
@@ -62,7 +55,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
// require proof?
|
||||
async fn make_abci_query<Req, Res>(
|
||||
&self,
|
||||
path: Option<String>,
|
||||
path: Option<abci::Path>,
|
||||
req: Req,
|
||||
) -> Result<Res, NyxdError>
|
||||
where
|
||||
@@ -88,7 +81,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
|
||||
// TODO: the return type should probably be changed to a non-proto, type-safe Account alternative
|
||||
async fn get_account(&self, address: &AccountId) -> Result<Option<Account>, NyxdError> {
|
||||
let path = Some("/cosmos.auth.v1beta1.Query/Account".to_owned());
|
||||
let path = Some("/cosmos.auth.v1beta1.Query/Account".parse().unwrap());
|
||||
|
||||
let req = QueryAccountRequest {
|
||||
address: address.to_string(),
|
||||
@@ -126,7 +119,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
address: &AccountId,
|
||||
search_denom: String,
|
||||
) -> Result<Option<Coin>, NyxdError> {
|
||||
let path = Some("/cosmos.bank.v1beta1.Query/Balance".to_owned());
|
||||
let path = Some("/cosmos.bank.v1beta1.Query/Balance".parse().unwrap());
|
||||
|
||||
let req = QueryBalanceRequest {
|
||||
address: address.to_string(),
|
||||
@@ -144,7 +137,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
|
||||
async fn get_all_balances(&self, address: &AccountId) -> Result<Vec<Coin>, NyxdError> {
|
||||
let path = Some("/cosmos.bank.v1beta1.Query/AllBalances".to_owned());
|
||||
let path = Some("/cosmos.bank.v1beta1.Query/AllBalances".parse().unwrap());
|
||||
|
||||
let mut raw_balances = Vec::new();
|
||||
let mut pagination = None;
|
||||
@@ -175,7 +168,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
|
||||
async fn get_total_supply(&self) -> Result<Vec<Coin>, NyxdError> {
|
||||
let path = Some("/cosmos.bank.v1beta1.Query/TotalSupply".to_owned());
|
||||
let path = Some("/cosmos.bank.v1beta1.Query/TotalSupply".parse().unwrap());
|
||||
|
||||
let mut supply = Vec::new();
|
||||
let mut pagination = None;
|
||||
@@ -202,7 +195,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
.map_err(|_| NyxdError::SerializationError("Coins".to_owned()))
|
||||
}
|
||||
|
||||
async fn get_tx(&self, id: Hash) -> Result<TxResponse, NyxdError> {
|
||||
async fn get_tx(&self, id: tx::Hash) -> Result<TxResponse, NyxdError> {
|
||||
Ok(self.tx(id, false).await?)
|
||||
}
|
||||
|
||||
@@ -238,36 +231,30 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
|
||||
/// Broadcast a transaction, returning immediately.
|
||||
async fn broadcast_tx_async<T>(&self, tx: T) -> Result<broadcast::tx_async::Response, NyxdError>
|
||||
where
|
||||
T: Into<Vec<u8>> + Send,
|
||||
{
|
||||
Ok(tendermint_rpc::client::Client::broadcast_tx_async(self, tx).await?)
|
||||
async fn broadcast_tx_async(
|
||||
&self,
|
||||
tx: Transaction,
|
||||
) -> Result<broadcast::tx_async::Response, NyxdError> {
|
||||
Ok(rpc::Client::broadcast_tx_async(self, tx).await?)
|
||||
}
|
||||
|
||||
/// Broadcast a transaction, returning the response from `CheckTx`.
|
||||
async fn broadcast_tx_sync<T>(&self, tx: T) -> Result<broadcast::tx_sync::Response, NyxdError>
|
||||
where
|
||||
T: Into<Vec<u8>> + Send,
|
||||
{
|
||||
Ok(tendermint_rpc::client::Client::broadcast_tx_sync(self, tx).await?)
|
||||
async fn broadcast_tx_sync(
|
||||
&self,
|
||||
tx: Transaction,
|
||||
) -> Result<broadcast::tx_sync::Response, NyxdError> {
|
||||
Ok(rpc::Client::broadcast_tx_sync(self, tx).await?)
|
||||
}
|
||||
|
||||
/// Broadcast a transaction, returning the response from `DeliverTx`.
|
||||
async fn broadcast_tx_commit<T>(
|
||||
async fn broadcast_tx_commit(
|
||||
&self,
|
||||
tx: T,
|
||||
) -> Result<broadcast::tx_commit::Response, NyxdError>
|
||||
where
|
||||
T: Into<Vec<u8>> + Send,
|
||||
{
|
||||
Ok(tendermint_rpc::client::Client::broadcast_tx_commit(self, tx).await?)
|
||||
tx: Transaction,
|
||||
) -> Result<broadcast::tx_commit::Response, NyxdError> {
|
||||
Ok(rpc::Client::broadcast_tx_commit(self, tx).await?)
|
||||
}
|
||||
|
||||
async fn broadcast_tx<T>(&self, tx: T) -> Result<TxResponse, NyxdError>
|
||||
where
|
||||
T: Into<Vec<u8>> + Send,
|
||||
{
|
||||
async fn broadcast_tx(&self, tx: Transaction) -> Result<TxResponse, NyxdError> {
|
||||
let broadcasted = CosmWasmClient::broadcast_tx_sync(self, tx).await?;
|
||||
|
||||
if broadcasted.code.is_err() {
|
||||
@@ -303,8 +290,8 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_codes(&self) -> Result<Vec<CodeInfoResponse>, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/Codes".to_owned());
|
||||
async fn get_codes(&self) -> Result<Vec<Code>, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/Codes".parse().unwrap());
|
||||
|
||||
let mut raw_codes = Vec::new();
|
||||
let mut pagination = None;
|
||||
@@ -324,14 +311,14 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
}
|
||||
|
||||
Ok(raw_codes
|
||||
raw_codes
|
||||
.into_iter()
|
||||
.map(TryFrom::try_from)
|
||||
.collect::<Result<_, _>>()?)
|
||||
.collect::<Result<_, _>>()
|
||||
}
|
||||
|
||||
async fn get_code_details(&self, code_id: ContractCodeId) -> Result<CodeDetails, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/Code".to_owned());
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/Code".parse().unwrap());
|
||||
|
||||
let req = QueryCodeRequest { code_id };
|
||||
|
||||
@@ -346,7 +333,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
}
|
||||
async fn get_contracts(&self, code_id: ContractCodeId) -> Result<Vec<AccountId>, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/ContractsByCode".to_owned());
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/ContractsByCode".parse().unwrap());
|
||||
|
||||
let mut raw_contracts = Vec::new();
|
||||
let mut pagination = None;
|
||||
@@ -377,7 +364,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
|
||||
async fn get_contract(&self, address: &AccountId) -> Result<Contract, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/ContractInfo".to_owned());
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/ContractInfo".parse().unwrap());
|
||||
|
||||
let req = QueryContractInfoRequest {
|
||||
address: address.to_string(),
|
||||
@@ -402,7 +389,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
&self,
|
||||
address: &AccountId,
|
||||
) -> Result<Vec<ContractCodeHistoryEntry>, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/ContractHistory".to_owned());
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/ContractHistory".parse().unwrap());
|
||||
|
||||
let mut raw_entries = Vec::new();
|
||||
let mut pagination = None;
|
||||
@@ -425,10 +412,10 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
}
|
||||
}
|
||||
|
||||
Ok(raw_entries
|
||||
raw_entries
|
||||
.into_iter()
|
||||
.map(TryFrom::try_from)
|
||||
.collect::<Result<_, _>>()?)
|
||||
.collect::<Result<_, _>>()
|
||||
}
|
||||
|
||||
async fn query_contract_raw(
|
||||
@@ -436,7 +423,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
address: &AccountId,
|
||||
query_data: Vec<u8>,
|
||||
) -> Result<Vec<u8>, NyxdError> {
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/RawContractState".to_owned());
|
||||
let path = Some("/cosmwasm.wasm.v1.Query/RawContractState".parse().unwrap());
|
||||
|
||||
let req = QueryRawContractStateRequest {
|
||||
address: address.to_string(),
|
||||
@@ -492,7 +479,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
tx: Option<Tx>,
|
||||
tx_bytes: Vec<u8>,
|
||||
) -> Result<SimulateResponse, NyxdError> {
|
||||
let path = Some("/cosmos.tx.v1beta1.Service/Simulate".to_owned());
|
||||
let path = Some("/cosmos.tx.v1beta1.Service/Simulate".parse().unwrap());
|
||||
|
||||
let req = SimulateRequest {
|
||||
tx: tx.map(Into::into),
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
|
||||
use crate::nyxd::error::NyxdError;
|
||||
use cosmrs::proto::cosmos::base::query::v1beta1::{PageRequest, PageResponse};
|
||||
use tendermint_rpc::endpoint::broadcast;
|
||||
use cosmrs::proto::cosmos::base::v1beta1::Coin as ProtoCoin;
|
||||
use cosmrs::rpc::endpoint::broadcast;
|
||||
use cosmrs::Coin;
|
||||
use flate2::write::GzEncoder;
|
||||
use flate2::Compression;
|
||||
use std::io::Write;
|
||||
|
||||
pub(crate) trait CheckResponse: Sized {
|
||||
fn check_response(self) -> Result<Self, NyxdError>;
|
||||
@@ -16,7 +21,7 @@ impl CheckResponse for broadcast::tx_commit::Response {
|
||||
hash: self.hash,
|
||||
height: Some(self.height),
|
||||
code: self.check_tx.code.value(),
|
||||
raw_log: self.check_tx.log,
|
||||
raw_log: self.check_tx.log.value().to_owned(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,7 +30,7 @@ impl CheckResponse for broadcast::tx_commit::Response {
|
||||
hash: self.hash,
|
||||
height: Some(self.height),
|
||||
code: self.deliver_tx.code.value(),
|
||||
raw_log: self.deliver_tx.log,
|
||||
raw_log: self.deliver_tx.log.value().to_owned(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -40,7 +45,7 @@ impl CheckResponse for crate::nyxd::TxResponse {
|
||||
hash: self.hash,
|
||||
height: Some(self.height),
|
||||
code: self.tx_result.code.value(),
|
||||
raw_log: self.tx_result.log,
|
||||
raw_log: self.tx_result.log.value().to_owned(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,12 +53,7 @@ impl CheckResponse for crate::nyxd::TxResponse {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
pub(crate) fn compress_wasm_code(code: &[u8]) -> Result<Vec<u8>, NyxdError> {
|
||||
use flate2::write::GzEncoder;
|
||||
use flate2::Compression;
|
||||
use std::io::Write;
|
||||
|
||||
// using compression level 9, same as cosmjs, that optimises for size
|
||||
let mut encoder = GzEncoder::new(Vec::new(), Compression::best());
|
||||
encoder
|
||||
@@ -83,3 +83,14 @@ pub(crate) fn next_page_key(pagination_info: Option<PageResponse>) -> Option<Vec
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
pub(crate) fn parse_proto_coin_vec(value: Vec<ProtoCoin>) -> Result<Vec<Coin>, NyxdError> {
|
||||
value
|
||||
.into_iter()
|
||||
.map(|proto_coin| {
|
||||
Coin::try_from(&proto_coin).map_err(|_| NyxdError::MalformedCoin {
|
||||
coin_representation: format!("{:?}", proto_coin),
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use crate::nyxd::error::NyxdError;
|
||||
use cosmrs::tendermint::abci;
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -48,7 +49,7 @@ fn parse_raw_str_logs(raw: &str) -> Result<Vec<Log>, NyxdError> {
|
||||
Ok(logs)
|
||||
}
|
||||
|
||||
pub fn parse_raw_logs(raw: String) -> Result<Vec<Log>, NyxdError> {
|
||||
pub fn parse_raw_logs(raw: abci::Log) -> Result<Vec<Log>, NyxdError> {
|
||||
parse_raw_str_logs(raw.as_ref())
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
use crate::nyxd::error::NyxdError;
|
||||
#[cfg(feature = "http-client")]
|
||||
use crate::nyxd::GasPrice;
|
||||
use cosmrs::rpc::{Error as TendermintRpcError, HttpClient, HttpClientUrl};
|
||||
#[cfg(feature = "http-client")]
|
||||
use std::convert::TryInto;
|
||||
|
||||
pub mod client;
|
||||
mod helpers;
|
||||
pub mod logs;
|
||||
pub mod signing_client;
|
||||
pub mod types;
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
pub mod signing_client;
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
pub fn connect<U>(endpoint: U) -> Result<HttpClient, NyxdError>
|
||||
where
|
||||
U: TryInto<HttpClientUrl, Error = TendermintRpcError>,
|
||||
@@ -24,11 +19,10 @@ where
|
||||
Ok(HttpClient::new(endpoint)?)
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
pub fn connect_with_signer<S, U: Clone>(
|
||||
endpoint: U,
|
||||
signer: S,
|
||||
gas_price: crate::nyxd::GasPrice,
|
||||
gas_price: GasPrice,
|
||||
) -> Result<signing_client::Client<S>, NyxdError>
|
||||
where
|
||||
U: TryInto<HttpClientUrl, Error = TendermintRpcError>,
|
||||
|
||||
@@ -9,37 +9,29 @@ use crate::nyxd::error::NyxdError;
|
||||
use crate::nyxd::fee::{Fee, DEFAULT_SIMULATED_GAS_MULTIPLIER};
|
||||
use crate::nyxd::{Coin, GasAdjustable, GasPrice, TxResponse};
|
||||
use crate::signing::signer::OfflineSigner;
|
||||
use crate::signing::tx_signer::TxSigner;
|
||||
use crate::signing::SignerData;
|
||||
use async_trait::async_trait;
|
||||
use cosmrs::abci::GasInfo;
|
||||
use cosmrs::bank::MsgSend;
|
||||
use cosmrs::distribution::MsgWithdrawDelegatorReward;
|
||||
use cosmrs::feegrant::{
|
||||
AllowedMsgAllowance, BasicAllowance, MsgGrantAllowance, MsgRevokeAllowance,
|
||||
};
|
||||
use cosmrs::proto::cosmos::tx::signing::v1beta1::SignMode;
|
||||
use cosmrs::rpc::endpoint::broadcast;
|
||||
use cosmrs::rpc::{Error as TendermintRpcError, HttpClient, HttpClientUrl, SimpleRequest};
|
||||
use cosmrs::staking::{MsgDelegate, MsgUndelegate};
|
||||
use cosmrs::tx::{self, Msg};
|
||||
use cosmrs::{cosmwasm, AccountId, Any, Tx};
|
||||
use cosmrs::tx::{self, Msg, Raw};
|
||||
use cosmrs::{cosmwasm, rpc, AccountId, Any, Tx};
|
||||
use log::debug;
|
||||
use serde::Serialize;
|
||||
use sha2::Digest;
|
||||
use sha2::Sha256;
|
||||
use std::convert::TryInto;
|
||||
use std::time::{Duration, SystemTime};
|
||||
use tendermint_rpc::endpoint::broadcast;
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
use crate::signing::tx_signer::TxSigner;
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
use tendermint_rpc::{Error as TendermintRpcError, SimpleRequest};
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
use cosmrs::rpc::{HttpClient, HttpClientUrl};
|
||||
|
||||
pub const DEFAULT_BROADCAST_POLLING_RATE: Duration = Duration::from_secs(4);
|
||||
pub const DEFAULT_BROADCAST_TIMEOUT: Duration = Duration::from_secs(60);
|
||||
const DEFAULT_BROADCAST_POLLING_RATE: Duration = Duration::from_secs(4);
|
||||
const DEFAULT_BROADCAST_TIMEOUT: Duration = Duration::from_secs(60);
|
||||
|
||||
fn empty_fee() -> tx::Fee {
|
||||
tx::Fee {
|
||||
@@ -131,10 +123,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.check_response()?;
|
||||
|
||||
let logs = parse_raw_logs(tx_res.tx_result.log)?;
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
// TODO: should those strings be extracted into some constants?
|
||||
// the reason I think unwrap here is fine is that if the transaction succeeded and those
|
||||
@@ -195,10 +184,8 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.check_response()?;
|
||||
|
||||
let logs = parse_raw_logs(tx_res.tx_result.log)?;
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
// TODO: should those strings be extracted into some constants?
|
||||
// the reason I think unwrap here is fine is that if the transaction succeeded and those
|
||||
// fields do not exist or address is malformed, there's no way we can recover, we're probably connected
|
||||
@@ -225,7 +212,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
fee: Fee,
|
||||
memo: impl Into<String> + Send + 'static,
|
||||
) -> Result<ChangeAdminResult, NyxdError> {
|
||||
let change_admin_msg = sealed::cosmwasm::MsgUpdateAdmin {
|
||||
let change_admin_msg = cosmwasm::MsgUpdateAdmin {
|
||||
sender: sender_address.clone(),
|
||||
new_admin: new_admin.clone(),
|
||||
contract: contract_address.clone(),
|
||||
@@ -238,10 +225,8 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.await?
|
||||
.check_response()?;
|
||||
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
Ok(ChangeAdminResult {
|
||||
logs: parse_raw_logs(tx_res.tx_result.log)?,
|
||||
transaction_hash: tx_res.hash,
|
||||
@@ -256,7 +241,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
fee: Fee,
|
||||
memo: impl Into<String> + Send + 'static,
|
||||
) -> Result<ChangeAdminResult, NyxdError> {
|
||||
let change_admin_msg = sealed::cosmwasm::MsgClearAdmin {
|
||||
let change_admin_msg = cosmwasm::MsgClearAdmin {
|
||||
sender: sender_address.clone(),
|
||||
contract: contract_address.clone(),
|
||||
}
|
||||
@@ -268,10 +253,8 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.await?
|
||||
.check_response()?;
|
||||
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
Ok(ChangeAdminResult {
|
||||
logs: parse_raw_logs(tx_res.tx_result.log)?,
|
||||
transaction_hash: tx_res.hash,
|
||||
@@ -305,10 +288,8 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.await?
|
||||
.check_response()?;
|
||||
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
Ok(MigrateResult {
|
||||
logs: parse_raw_logs(tx_res.tx_result.log)?,
|
||||
transaction_hash: tx_res.hash,
|
||||
@@ -342,13 +323,11 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.await?
|
||||
.check_response()?;
|
||||
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
Ok(ExecuteResult {
|
||||
logs: parse_raw_logs(tx_res.tx_result.log)?,
|
||||
data: tx_res.tx_result.data.into(),
|
||||
data: tx_res.tx_result.data,
|
||||
transaction_hash: tx_res.hash,
|
||||
gas_info,
|
||||
})
|
||||
@@ -385,13 +364,11 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.await?
|
||||
.check_response()?;
|
||||
|
||||
let gas_info = GasInfo {
|
||||
gas_wanted: tx_res.tx_result.gas_wanted.try_into().unwrap_or_default(),
|
||||
gas_used: tx_res.tx_result.gas_used.try_into().unwrap_or_default(),
|
||||
};
|
||||
let gas_info = GasInfo::new(tx_res.tx_result.gas_wanted, tx_res.tx_result.gas_used);
|
||||
|
||||
Ok(ExecuteResult {
|
||||
logs: parse_raw_logs(tx_res.tx_result.log)?,
|
||||
data: tx_res.tx_result.data.into(),
|
||||
data: tx_res.tx_result.data,
|
||||
transaction_hash: tx_res.hash,
|
||||
gas_info,
|
||||
})
|
||||
@@ -625,7 +602,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.to_bytes()
|
||||
.map_err(|_| NyxdError::SerializationError("Tx".to_owned()))?;
|
||||
|
||||
CosmWasmClient::broadcast_tx_async(self, tx_bytes).await
|
||||
CosmWasmClient::broadcast_tx_async(self, tx_bytes.into()).await
|
||||
}
|
||||
|
||||
/// Broadcast a transaction, returning the response from `CheckTx`.
|
||||
@@ -645,7 +622,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.to_bytes()
|
||||
.map_err(|_| NyxdError::SerializationError("Tx".to_owned()))?;
|
||||
|
||||
CosmWasmClient::broadcast_tx_sync(self, tx_bytes).await
|
||||
CosmWasmClient::broadcast_tx_sync(self, tx_bytes.into()).await
|
||||
}
|
||||
|
||||
/// Broadcast a transaction, returning the response from `DeliverTx`.
|
||||
@@ -666,7 +643,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.to_bytes()
|
||||
.map_err(|_| NyxdError::SerializationError("Tx".to_owned()))?;
|
||||
|
||||
CosmWasmClient::broadcast_tx_commit(self, tx_bytes).await
|
||||
CosmWasmClient::broadcast_tx_commit(self, tx_bytes.into()).await
|
||||
}
|
||||
|
||||
/// Broadcast a transaction to the network and monitors its inclusion in a block.
|
||||
@@ -687,7 +664,7 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
.to_bytes()
|
||||
.map_err(|_| NyxdError::SerializationError("Tx".to_owned()))?;
|
||||
|
||||
self.broadcast_tx(tx_bytes).await
|
||||
self.broadcast_tx(tx_bytes.into()).await
|
||||
}
|
||||
|
||||
async fn sign(
|
||||
@@ -732,7 +709,6 @@ pub trait SigningCosmWasmClient: CosmWasmClient {
|
||||
) -> Result<tx::Raw, NyxdError>;
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
#[derive(Debug)]
|
||||
pub struct Client<S> {
|
||||
// TODO: somehow nicely hide this guy if we decide to use our client in offline mode,
|
||||
@@ -746,7 +722,6 @@ pub struct Client<S> {
|
||||
broadcast_timeout: Duration,
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
impl<S> Client<S> {
|
||||
pub fn connect_with_signer<U: Clone>(
|
||||
endpoint: U,
|
||||
@@ -795,13 +770,12 @@ impl<S> Client<S> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
#[async_trait]
|
||||
impl<S> tendermint_rpc::client::Client for Client<S>
|
||||
impl<S> rpc::Client for Client<S>
|
||||
where
|
||||
S: Send + Sync,
|
||||
{
|
||||
async fn perform<R>(&self, request: R) -> Result<R::Output, tendermint_rpc::Error>
|
||||
async fn perform<R>(&self, request: R) -> Result<R::Response, rpc::Error>
|
||||
where
|
||||
R: SimpleRequest,
|
||||
{
|
||||
@@ -809,7 +783,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
#[async_trait]
|
||||
impl<S> CosmWasmClient for Client<S>
|
||||
where
|
||||
@@ -824,7 +797,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
#[async_trait]
|
||||
impl<S> SigningCosmWasmClient for Client<S>
|
||||
where
|
||||
@@ -848,7 +820,7 @@ where
|
||||
fee: tx::Fee,
|
||||
memo: impl Into<String> + Send + 'static,
|
||||
signer_data: SignerData,
|
||||
) -> Result<tx::Raw, NyxdError> {
|
||||
) -> Result<Raw, NyxdError> {
|
||||
Ok(self
|
||||
.tx_signer
|
||||
.sign_amino(signer_address, messages, fee, memo, signer_data)?)
|
||||
@@ -861,173 +833,9 @@ where
|
||||
fee: tx::Fee,
|
||||
memo: impl Into<String> + Send + 'static,
|
||||
signer_data: SignerData,
|
||||
) -> Result<tx::Raw, NyxdError> {
|
||||
) -> Result<Raw, NyxdError> {
|
||||
Ok(self
|
||||
.tx_signer
|
||||
.sign_direct(signer_address, messages, fee, memo, signer_data)?)
|
||||
}
|
||||
}
|
||||
|
||||
// a temporary bypass until https://github.com/cosmos/cosmos-rust/pull/419 is merged
|
||||
mod sealed {
|
||||
pub mod cosmwasm {
|
||||
use cosmrs::{proto, tx::Msg, AccountId, ErrorReport, Result};
|
||||
|
||||
/// MsgUpdateAdmin sets a new admin for a smart contract
|
||||
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
|
||||
pub struct MsgUpdateAdmin {
|
||||
/// Sender is the that actor that signed the messages
|
||||
pub sender: AccountId,
|
||||
|
||||
/// NewAdmin address to be set
|
||||
pub new_admin: AccountId,
|
||||
|
||||
/// Contract is the address of the smart contract
|
||||
pub contract: AccountId,
|
||||
}
|
||||
|
||||
impl Msg for MsgUpdateAdmin {
|
||||
type Proto = proto::cosmwasm::wasm::v1::MsgUpdateAdmin;
|
||||
}
|
||||
|
||||
impl TryFrom<proto::cosmwasm::wasm::v1::MsgUpdateAdmin> for MsgUpdateAdmin {
|
||||
type Error = ErrorReport;
|
||||
|
||||
fn try_from(
|
||||
proto: proto::cosmwasm::wasm::v1::MsgUpdateAdmin,
|
||||
) -> Result<MsgUpdateAdmin> {
|
||||
MsgUpdateAdmin::try_from(&proto)
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&proto::cosmwasm::wasm::v1::MsgUpdateAdmin> for MsgUpdateAdmin {
|
||||
type Error = ErrorReport;
|
||||
|
||||
fn try_from(
|
||||
proto: &proto::cosmwasm::wasm::v1::MsgUpdateAdmin,
|
||||
) -> Result<MsgUpdateAdmin> {
|
||||
Ok(MsgUpdateAdmin {
|
||||
sender: proto.sender.parse()?,
|
||||
new_admin: proto.new_admin.parse()?,
|
||||
contract: proto.contract.parse()?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MsgUpdateAdmin> for proto::cosmwasm::wasm::v1::MsgUpdateAdmin {
|
||||
fn from(msg: MsgUpdateAdmin) -> proto::cosmwasm::wasm::v1::MsgUpdateAdmin {
|
||||
proto::cosmwasm::wasm::v1::MsgUpdateAdmin::from(&msg)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&MsgUpdateAdmin> for proto::cosmwasm::wasm::v1::MsgUpdateAdmin {
|
||||
fn from(msg: &MsgUpdateAdmin) -> proto::cosmwasm::wasm::v1::MsgUpdateAdmin {
|
||||
proto::cosmwasm::wasm::v1::MsgUpdateAdmin {
|
||||
sender: msg.sender.to_string(),
|
||||
new_admin: msg.new_admin.to_string(),
|
||||
contract: msg.contract.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// MsgUpdateAdminResponse returns empty data
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord)]
|
||||
pub struct MsgUpdateAdminResponse {}
|
||||
|
||||
impl Msg for MsgUpdateAdminResponse {
|
||||
type Proto = proto::cosmwasm::wasm::v1::MsgUpdateAdminResponse;
|
||||
}
|
||||
|
||||
impl TryFrom<proto::cosmwasm::wasm::v1::MsgUpdateAdminResponse> for MsgUpdateAdminResponse {
|
||||
type Error = ErrorReport;
|
||||
|
||||
fn try_from(
|
||||
_proto: proto::cosmwasm::wasm::v1::MsgUpdateAdminResponse,
|
||||
) -> Result<MsgUpdateAdminResponse> {
|
||||
Ok(MsgUpdateAdminResponse {})
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MsgUpdateAdminResponse> for proto::cosmwasm::wasm::v1::MsgUpdateAdminResponse {
|
||||
fn from(
|
||||
_msg: MsgUpdateAdminResponse,
|
||||
) -> proto::cosmwasm::wasm::v1::MsgUpdateAdminResponse {
|
||||
proto::cosmwasm::wasm::v1::MsgUpdateAdminResponse {}
|
||||
}
|
||||
}
|
||||
|
||||
/// MsgClearAdmin removes any admin stored for a smart contract
|
||||
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
|
||||
pub struct MsgClearAdmin {
|
||||
/// Sender is the that actor that signed the messages
|
||||
pub sender: AccountId,
|
||||
|
||||
/// Contract is the address of the smart contract
|
||||
pub contract: AccountId,
|
||||
}
|
||||
|
||||
impl Msg for MsgClearAdmin {
|
||||
type Proto = proto::cosmwasm::wasm::v1::MsgClearAdmin;
|
||||
}
|
||||
|
||||
impl TryFrom<proto::cosmwasm::wasm::v1::MsgClearAdmin> for MsgClearAdmin {
|
||||
type Error = ErrorReport;
|
||||
|
||||
fn try_from(proto: proto::cosmwasm::wasm::v1::MsgClearAdmin) -> Result<MsgClearAdmin> {
|
||||
MsgClearAdmin::try_from(&proto)
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&proto::cosmwasm::wasm::v1::MsgClearAdmin> for MsgClearAdmin {
|
||||
type Error = ErrorReport;
|
||||
|
||||
fn try_from(proto: &proto::cosmwasm::wasm::v1::MsgClearAdmin) -> Result<MsgClearAdmin> {
|
||||
Ok(MsgClearAdmin {
|
||||
sender: proto.sender.parse()?,
|
||||
contract: proto.contract.parse()?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MsgClearAdmin> for proto::cosmwasm::wasm::v1::MsgClearAdmin {
|
||||
fn from(msg: MsgClearAdmin) -> proto::cosmwasm::wasm::v1::MsgClearAdmin {
|
||||
proto::cosmwasm::wasm::v1::MsgClearAdmin::from(&msg)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&MsgClearAdmin> for proto::cosmwasm::wasm::v1::MsgClearAdmin {
|
||||
fn from(msg: &MsgClearAdmin) -> proto::cosmwasm::wasm::v1::MsgClearAdmin {
|
||||
proto::cosmwasm::wasm::v1::MsgClearAdmin {
|
||||
sender: msg.sender.to_string(),
|
||||
contract: msg.contract.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// MsgClearAdminResponse returns empty data
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord)]
|
||||
pub struct MsgClearAdminResponse {}
|
||||
|
||||
impl Msg for MsgClearAdminResponse {
|
||||
type Proto = proto::cosmwasm::wasm::v1::MsgClearAdminResponse;
|
||||
}
|
||||
|
||||
impl TryFrom<proto::cosmwasm::wasm::v1::MsgClearAdminResponse> for MsgClearAdminResponse {
|
||||
type Error = ErrorReport;
|
||||
|
||||
fn try_from(
|
||||
_proto: proto::cosmwasm::wasm::v1::MsgClearAdminResponse,
|
||||
) -> Result<MsgClearAdminResponse> {
|
||||
Ok(MsgClearAdminResponse {})
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MsgClearAdminResponse> for proto::cosmwasm::wasm::v1::MsgClearAdminResponse {
|
||||
fn from(
|
||||
_msg: MsgClearAdminResponse,
|
||||
) -> proto::cosmwasm::wasm::v1::MsgClearAdminResponse {
|
||||
proto::cosmwasm::wasm::v1::MsgClearAdminResponse {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,35 +3,36 @@
|
||||
|
||||
// TODO: There's a significant argument to pull those out of the package and make a PR on https://github.com/cosmos/cosmos-rust/
|
||||
|
||||
use crate::nyxd::cosmwasm_client::helpers::parse_proto_coin_vec;
|
||||
use crate::nyxd::cosmwasm_client::logs::Log;
|
||||
use crate::nyxd::error::NyxdError;
|
||||
use cosmrs::auth::{BaseAccount, ModuleAccount};
|
||||
use cosmrs::cosmwasm::{CodeInfoResponse, ContractInfo};
|
||||
use cosmrs::crypto::PublicKey;
|
||||
use cosmrs::proto::cosmos::auth::v1beta1::{
|
||||
BaseAccount as ProtoBaseAccount, ModuleAccount as ProtoModuleAccount,
|
||||
};
|
||||
use cosmrs::proto::cosmos::base::abci::v1beta1::Result as ProtoAbciResult;
|
||||
use cosmrs::proto::cosmos::base::abci::v1beta1::{
|
||||
GasInfo as ProtoGasInfo, Result as ProtoAbciResult,
|
||||
};
|
||||
use cosmrs::proto::cosmos::tx::v1beta1::SimulateResponse as ProtoSimulateResponse;
|
||||
use cosmrs::proto::cosmos::vesting::v1beta1::{
|
||||
BaseVestingAccount as ProtoBaseVestingAccount,
|
||||
ContinuousVestingAccount as ProtoContinuousVestingAccount,
|
||||
DelayedVestingAccount as ProtoDelayedVestingAccount,
|
||||
DelayedVestingAccount as ProtoDelayedVestingAccount, Period as ProtoPeriod,
|
||||
PeriodicVestingAccount as ProtoPeriodicVestingAccount,
|
||||
PermanentLockedAccount as ProtoPermanentLockedAccount,
|
||||
};
|
||||
use cosmrs::tendermint::{abci, Hash};
|
||||
use cosmrs::tx::{AccountNumber, SequenceNumber};
|
||||
use cosmrs::vesting::{
|
||||
BaseVestingAccount, ContinuousVestingAccount, DelayedVestingAccount, PeriodicVestingAccount,
|
||||
PermanentLockedAccount,
|
||||
use cosmrs::proto::cosmwasm::wasm::v1::{
|
||||
CodeInfoResponse, ContractCodeHistoryEntry as ProtoContractCodeHistoryEntry,
|
||||
ContractCodeHistoryOperationType, ContractInfo as ProtoContractInfo,
|
||||
};
|
||||
use cosmrs::{AccountId, Any, Coin as CosmosCoin};
|
||||
use cosmrs::tendermint::abci;
|
||||
use cosmrs::tendermint::abci::Data;
|
||||
use cosmrs::tx::{AccountNumber, Gas, SequenceNumber};
|
||||
use cosmrs::{tx, AccountId, Any, Coin as CosmosCoin};
|
||||
use prost::Message;
|
||||
use serde::Serialize;
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
|
||||
pub use cosmrs::abci::GasInfo;
|
||||
|
||||
pub type ContractCodeId = u64;
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -43,6 +44,215 @@ pub struct SequenceResponse {
|
||||
pub sequence: SequenceNumber,
|
||||
}
|
||||
|
||||
/// BaseAccount defines a base account type. It contains all the necessary fields
|
||||
/// for basic account functionality. Any custom account type should extend this
|
||||
/// type for additional functionality (e.g. vesting).
|
||||
#[derive(Debug)]
|
||||
pub struct BaseAccount {
|
||||
/// Bech32 account address
|
||||
pub address: AccountId,
|
||||
pub pubkey: Option<PublicKey>,
|
||||
pub account_number: AccountNumber,
|
||||
pub sequence: SequenceNumber,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoBaseAccount> for BaseAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoBaseAccount) -> Result<Self, Self::Error> {
|
||||
let address: AccountId = value
|
||||
.address
|
||||
.parse()
|
||||
.map_err(|_| NyxdError::MalformedAccountAddress(value.address.clone()))?;
|
||||
|
||||
let pubkey = value
|
||||
.pub_key
|
||||
.map(PublicKey::try_from)
|
||||
.transpose()
|
||||
.map_err(|_| NyxdError::InvalidPublicKey(address.clone()))?;
|
||||
|
||||
Ok(BaseAccount {
|
||||
address,
|
||||
pubkey,
|
||||
account_number: value.account_number,
|
||||
sequence: value.sequence,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// ModuleAccount defines an account for modules that holds coins on a pool.
|
||||
#[derive(Debug)]
|
||||
pub struct ModuleAccount {
|
||||
pub base_account: Option<BaseAccount>,
|
||||
pub name: String,
|
||||
pub permissions: Vec<String>,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoModuleAccount> for ModuleAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoModuleAccount) -> Result<Self, Self::Error> {
|
||||
let base_account = value.base_account.map(TryFrom::try_from).transpose()?;
|
||||
|
||||
Ok(ModuleAccount {
|
||||
base_account,
|
||||
name: value.name,
|
||||
permissions: value.permissions,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// BaseVestingAccount implements the VestingAccount interface. It contains all
|
||||
/// the necessary fields needed for any vesting account implementation.
|
||||
#[derive(Debug)]
|
||||
pub struct BaseVestingAccount {
|
||||
pub base_account: Option<BaseAccount>,
|
||||
pub original_vesting: Vec<CosmosCoin>,
|
||||
pub delegated_free: Vec<CosmosCoin>,
|
||||
pub delegated_vesting: Vec<CosmosCoin>,
|
||||
pub end_time: i64,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoBaseVestingAccount> for BaseVestingAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoBaseVestingAccount) -> Result<Self, Self::Error> {
|
||||
let base_account = value.base_account.map(TryFrom::try_from).transpose()?;
|
||||
|
||||
let original_vesting = parse_proto_coin_vec(value.original_vesting)?;
|
||||
let delegated_free = parse_proto_coin_vec(value.delegated_free)?;
|
||||
let delegated_vesting = parse_proto_coin_vec(value.delegated_vesting)?;
|
||||
|
||||
Ok(BaseVestingAccount {
|
||||
base_account,
|
||||
original_vesting,
|
||||
delegated_free,
|
||||
delegated_vesting,
|
||||
end_time: value.end_time,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// ContinuousVestingAccount implements the VestingAccount interface. It
|
||||
/// continuously vests by unlocking coins linearly with respect to time.
|
||||
#[derive(Debug)]
|
||||
pub struct ContinuousVestingAccount {
|
||||
pub base_vesting_account: Option<BaseVestingAccount>,
|
||||
pub start_time: i64,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoContinuousVestingAccount> for ContinuousVestingAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoContinuousVestingAccount) -> Result<Self, Self::Error> {
|
||||
let base_vesting_account = value
|
||||
.base_vesting_account
|
||||
.map(TryFrom::try_from)
|
||||
.transpose()?;
|
||||
|
||||
Ok(ContinuousVestingAccount {
|
||||
base_vesting_account,
|
||||
start_time: value.start_time,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// DelayedVestingAccount implements the VestingAccount interface. It vests all
|
||||
/// coins after a specific time, but non prior. In other words, it keeps them
|
||||
/// locked until a specified time.
|
||||
#[derive(Debug)]
|
||||
pub struct DelayedVestingAccount {
|
||||
pub base_vesting_account: Option<BaseVestingAccount>,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoDelayedVestingAccount> for DelayedVestingAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoDelayedVestingAccount) -> Result<Self, Self::Error> {
|
||||
let base_vesting_account = value
|
||||
.base_vesting_account
|
||||
.map(TryFrom::try_from)
|
||||
.transpose()?;
|
||||
|
||||
Ok(DelayedVestingAccount {
|
||||
base_vesting_account,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Period defines a length of time and amount of coins that will vest.
|
||||
#[derive(Debug)]
|
||||
pub struct Period {
|
||||
pub length: i64,
|
||||
pub amount: Vec<CosmosCoin>,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoPeriod> for Period {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoPeriod) -> Result<Self, Self::Error> {
|
||||
Ok(Period {
|
||||
length: value.length,
|
||||
amount: parse_proto_coin_vec(value.amount)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// PeriodicVestingAccount implements the VestingAccount interface. It
|
||||
/// periodically vests by unlocking coins during each specified period.
|
||||
#[derive(Debug)]
|
||||
pub struct PeriodicVestingAccount {
|
||||
pub base_vesting_account: Option<BaseVestingAccount>,
|
||||
pub start_time: i64,
|
||||
pub vesting_periods: Vec<Period>,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoPeriodicVestingAccount> for PeriodicVestingAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoPeriodicVestingAccount) -> Result<Self, Self::Error> {
|
||||
let base_vesting_account = value
|
||||
.base_vesting_account
|
||||
.map(TryFrom::try_from)
|
||||
.transpose()?;
|
||||
|
||||
let vesting_periods = value
|
||||
.vesting_periods
|
||||
.into_iter()
|
||||
.map(TryFrom::try_from)
|
||||
.collect::<Result<_, _>>()?;
|
||||
|
||||
Ok(PeriodicVestingAccount {
|
||||
base_vesting_account,
|
||||
start_time: value.start_time,
|
||||
vesting_periods,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// PermanentLockedAccount implements the VestingAccount interface. It does
|
||||
/// not ever release coins, locking them indefinitely. Coins in this account can
|
||||
/// still be used for delegating and for governance votes even while locked.
|
||||
#[derive(Debug)]
|
||||
pub struct PermanentLockedAccount {
|
||||
pub base_vesting_account: Option<BaseVestingAccount>,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoPermanentLockedAccount> for PermanentLockedAccount {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoPermanentLockedAccount) -> Result<Self, Self::Error> {
|
||||
let base_vesting_account = value
|
||||
.base_vesting_account
|
||||
.map(TryFrom::try_from)
|
||||
.transpose()?;
|
||||
|
||||
Ok(PermanentLockedAccount {
|
||||
base_vesting_account,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Account {
|
||||
Base(BaseAccount),
|
||||
@@ -125,32 +335,183 @@ impl TryFrom<Any> for Account {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Code {
|
||||
pub code_id: ContractCodeId,
|
||||
|
||||
/// Bech32 account address
|
||||
pub creator: AccountId,
|
||||
|
||||
/// sha256 hash of the code stored
|
||||
pub data_hash: Vec<u8>,
|
||||
}
|
||||
|
||||
impl TryFrom<CodeInfoResponse> for Code {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: CodeInfoResponse) -> Result<Self, Self::Error> {
|
||||
let CodeInfoResponse {
|
||||
code_id,
|
||||
creator,
|
||||
data_hash,
|
||||
} = value;
|
||||
|
||||
let creator = creator
|
||||
.parse()
|
||||
.map_err(|_| NyxdError::MalformedAccountAddress(creator))?;
|
||||
|
||||
Ok(Code {
|
||||
code_id,
|
||||
creator,
|
||||
data_hash,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CodeDetails {
|
||||
pub code_info: CodeInfoResponse,
|
||||
pub code_info: Code,
|
||||
|
||||
/// The original wasm bytes
|
||||
pub data: Vec<u8>,
|
||||
}
|
||||
|
||||
impl CodeDetails {
|
||||
pub fn new(code_info: CodeInfoResponse, data: Vec<u8>) -> Self {
|
||||
pub fn new(code_info: Code, data: Vec<u8>) -> Self {
|
||||
CodeDetails { code_info, data }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct ContractInfo {
|
||||
code_id: ContractCodeId,
|
||||
creator: AccountId,
|
||||
admin: Option<AccountId>,
|
||||
label: String,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoContractInfo> for ContractInfo {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoContractInfo) -> Result<Self, Self::Error> {
|
||||
let ProtoContractInfo {
|
||||
code_id,
|
||||
creator,
|
||||
admin,
|
||||
label,
|
||||
..
|
||||
} = value;
|
||||
|
||||
let admin = if admin.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(
|
||||
admin
|
||||
.parse()
|
||||
.map_err(|_| NyxdError::MalformedAccountAddress(admin))?,
|
||||
)
|
||||
};
|
||||
|
||||
Ok(ContractInfo {
|
||||
code_id,
|
||||
creator: creator
|
||||
.parse()
|
||||
.map_err(|_| NyxdError::MalformedAccountAddress(creator))?,
|
||||
admin,
|
||||
label,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Contract {
|
||||
pub address: AccountId,
|
||||
|
||||
pub contract_info: ContractInfo,
|
||||
pub code_id: ContractCodeId,
|
||||
|
||||
/// Bech32 account address
|
||||
pub creator: AccountId,
|
||||
|
||||
/// Bech32-encoded admin address
|
||||
pub admin: Option<AccountId>,
|
||||
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl Contract {
|
||||
pub(crate) fn new(address: AccountId, contract_info: ContractInfo) -> Self {
|
||||
Contract {
|
||||
address,
|
||||
contract_info,
|
||||
code_id: contract_info.code_id,
|
||||
creator: contract_info.creator,
|
||||
admin: contract_info.admin,
|
||||
label: contract_info.label,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum ContractCodeHistoryEntryOperation {
|
||||
Init,
|
||||
Genesis,
|
||||
Migrate,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ContractCodeHistoryEntry {
|
||||
/// The source of this history entry
|
||||
pub operation: ContractCodeHistoryEntryOperation,
|
||||
pub code_id: ContractCodeId,
|
||||
pub msg_json: String,
|
||||
}
|
||||
|
||||
impl TryFrom<ProtoContractCodeHistoryEntry> for ContractCodeHistoryEntry {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoContractCodeHistoryEntry) -> Result<Self, Self::Error> {
|
||||
let operation = match ContractCodeHistoryOperationType::from_i32(value.operation)
|
||||
.ok_or(NyxdError::InvalidContractHistoryOperation)?
|
||||
{
|
||||
ContractCodeHistoryOperationType::Unspecified => {
|
||||
return Err(NyxdError::InvalidContractHistoryOperation)
|
||||
}
|
||||
ContractCodeHistoryOperationType::Init => ContractCodeHistoryEntryOperation::Init,
|
||||
ContractCodeHistoryOperationType::Genesis => ContractCodeHistoryEntryOperation::Genesis,
|
||||
ContractCodeHistoryOperationType::Migrate => ContractCodeHistoryEntryOperation::Migrate,
|
||||
};
|
||||
|
||||
Ok(ContractCodeHistoryEntry {
|
||||
operation,
|
||||
code_id: value.code_id,
|
||||
msg_json: String::from_utf8(value.msg)
|
||||
.map_err(|_| NyxdError::DeserializationError("Contract history msg".to_owned()))?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize)]
|
||||
pub struct GasInfo {
|
||||
/// GasWanted is the maximum units of work we allow this tx to perform.
|
||||
pub gas_wanted: Gas,
|
||||
|
||||
/// GasUsed is the amount of gas actually consumed.
|
||||
pub gas_used: Gas,
|
||||
}
|
||||
|
||||
impl From<ProtoGasInfo> for GasInfo {
|
||||
fn from(value: ProtoGasInfo) -> Self {
|
||||
GasInfo {
|
||||
gas_wanted: value.gas_wanted.into(),
|
||||
gas_used: value.gas_used.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GasInfo {
|
||||
pub fn new(gas_wanted: Gas, gas_used: Gas) -> Self {
|
||||
GasInfo {
|
||||
gas_wanted,
|
||||
gas_used,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,15 +535,31 @@ impl TryFrom<ProtoAbciResult> for AbciResult {
|
||||
type Error = NyxdError;
|
||||
|
||||
fn try_from(value: ProtoAbciResult) -> Result<Self, Self::Error> {
|
||||
let events = value
|
||||
.events
|
||||
.into_iter()
|
||||
.map(TryInto::try_into)
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let mut events = Vec::with_capacity(value.events.len());
|
||||
|
||||
for proto_event in value.events.into_iter() {
|
||||
let type_str = proto_event.r#type;
|
||||
|
||||
let mut attributes = Vec::with_capacity(proto_event.attributes.len());
|
||||
for proto_attribute in proto_event.attributes.into_iter() {
|
||||
let stringified_ked = String::from_utf8(proto_attribute.key)
|
||||
.map_err(|_| NyxdError::DeserializationError("EventAttributeKey".to_owned()))?;
|
||||
let stringified_value = String::from_utf8(proto_attribute.value)
|
||||
.map_err(|_| NyxdError::DeserializationError("EventAttributeKey".to_owned()))?;
|
||||
|
||||
attributes.push(abci::tag::Tag {
|
||||
key: stringified_ked.parse().unwrap(),
|
||||
value: stringified_value.parse().unwrap(),
|
||||
})
|
||||
}
|
||||
|
||||
events.push(abci::Event {
|
||||
type_str,
|
||||
attributes,
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
Ok(AbciResult {
|
||||
// TODO: make sure this actually works since technically we're converting from 0.37 protobuf definition as opposed to 0.34...
|
||||
data: value.data,
|
||||
log: value.log,
|
||||
events,
|
||||
@@ -201,10 +578,7 @@ impl TryFrom<ProtoSimulateResponse> for SimulateResponse {
|
||||
|
||||
fn try_from(value: ProtoSimulateResponse) -> Result<Self, Self::Error> {
|
||||
Ok(SimulateResponse {
|
||||
gas_info: value
|
||||
.gas_info
|
||||
.map(|gas_info| gas_info.try_into())
|
||||
.transpose()?,
|
||||
gas_info: value.gas_info.map(|gas_info| gas_info.into()),
|
||||
result: value.result.map(|result| result.try_into()).transpose()?,
|
||||
})
|
||||
}
|
||||
@@ -234,7 +608,7 @@ pub struct UploadResult {
|
||||
pub logs: Vec<Log>,
|
||||
|
||||
/// Transaction hash (might be used as transaction ID)
|
||||
pub transaction_hash: Hash,
|
||||
pub transaction_hash: tx::Hash,
|
||||
|
||||
pub gas_info: GasInfo,
|
||||
}
|
||||
@@ -271,7 +645,7 @@ pub struct InstantiateResult {
|
||||
pub logs: Vec<Log>,
|
||||
|
||||
/// Transaction hash (might be used as transaction ID)
|
||||
pub transaction_hash: Hash,
|
||||
pub transaction_hash: tx::Hash,
|
||||
|
||||
pub gas_info: GasInfo,
|
||||
}
|
||||
@@ -281,7 +655,7 @@ pub struct ChangeAdminResult {
|
||||
pub logs: Vec<Log>,
|
||||
|
||||
/// Transaction hash (might be used as transaction ID)
|
||||
pub transaction_hash: Hash,
|
||||
pub transaction_hash: tx::Hash,
|
||||
|
||||
pub gas_info: GasInfo,
|
||||
}
|
||||
@@ -291,7 +665,7 @@ pub struct MigrateResult {
|
||||
pub logs: Vec<Log>,
|
||||
|
||||
/// Transaction hash (might be used as transaction ID)
|
||||
pub transaction_hash: Hash,
|
||||
pub transaction_hash: tx::Hash,
|
||||
|
||||
pub gas_info: GasInfo,
|
||||
}
|
||||
@@ -300,10 +674,10 @@ pub struct MigrateResult {
|
||||
pub struct ExecuteResult {
|
||||
pub logs: Vec<Log>,
|
||||
|
||||
pub data: Vec<u8>,
|
||||
pub data: Data,
|
||||
|
||||
/// Transaction hash (might be used as transaction ID)
|
||||
pub transaction_hash: Hash,
|
||||
pub transaction_hash: tx::Hash,
|
||||
|
||||
pub gas_info: GasInfo,
|
||||
}
|
||||
|
||||
@@ -2,39 +2,34 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use crate::nyxd::cosmwasm_client::types::ContractCodeId;
|
||||
use cosmrs::tendermint::Hash;
|
||||
use cosmrs::{
|
||||
tendermint::{abci::Code as AbciCode, block},
|
||||
AccountId,
|
||||
rpc::endpoint::abci_query::AbciQuery,
|
||||
tendermint::{
|
||||
abci::{self, Code as AbciCode},
|
||||
block,
|
||||
},
|
||||
tx, AccountId,
|
||||
};
|
||||
use std::{io, time::Duration};
|
||||
use tendermint_rpc::endpoint::abci_query::AbciQuery;
|
||||
use thiserror::Error;
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
use crate::signing::direct_wallet::DirectSecp256k1HdWalletError;
|
||||
|
||||
pub use cosmrs::tendermint::error::Error as TendermintError;
|
||||
pub use tendermint_rpc::{
|
||||
pub use cosmrs::rpc::{
|
||||
error::{Error as TendermintRpcError, ErrorDetail as TendermintRpcErrorDetail},
|
||||
response_error::{Code, ResponseError},
|
||||
};
|
||||
use std::{io, time::Duration};
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum NyxdError {
|
||||
#[error("No contract address is available to perform the call: {0}")]
|
||||
NoContractAddressAvailable(String),
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
#[error(transparent)]
|
||||
WalletError(#[from] DirectSecp256k1HdWalletError),
|
||||
|
||||
#[error("There was an issue on the cosmrs side: {0}")]
|
||||
#[error("There was an issue on the cosmrs side - {0}")]
|
||||
CosmrsError(#[from] cosmrs::Error),
|
||||
|
||||
#[error("There was an issue on the cosmrs side: {0}")]
|
||||
CosmrsErrorReport(#[from] cosmrs::ErrorReport),
|
||||
|
||||
#[error("Failed to derive account address")]
|
||||
AccountDerivationError,
|
||||
|
||||
@@ -48,10 +43,7 @@ pub enum NyxdError {
|
||||
InvalidTxHash(String),
|
||||
|
||||
#[error("Tendermint RPC request failed - {0}")]
|
||||
TendermintErrorRpc(#[from] TendermintRpcError),
|
||||
|
||||
#[error("tendermint library failure: {0}")]
|
||||
TendermintError(#[from] TendermintError),
|
||||
TendermintError(#[from] TendermintRpcError),
|
||||
|
||||
#[error("Failed when attempting to serialize data ({0})")]
|
||||
SerializationError(String),
|
||||
@@ -99,7 +91,7 @@ pub enum NyxdError {
|
||||
"Error when broadcasting tx {hash} at height {height:?}. Error occurred during CheckTx phase. Code: {code}; Raw log: {raw_log}"
|
||||
)]
|
||||
BroadcastTxErrorCheckTx {
|
||||
hash: Hash,
|
||||
hash: tx::Hash,
|
||||
height: Option<block::Height>,
|
||||
code: u32,
|
||||
raw_log: String,
|
||||
@@ -109,7 +101,7 @@ pub enum NyxdError {
|
||||
"Error when broadcasting tx {hash} at height {height:?}. Error occurred during DeliverTx phase. Code: {code}; Raw log: {raw_log}"
|
||||
)]
|
||||
BroadcastTxErrorDeliverTx {
|
||||
hash: Hash,
|
||||
hash: tx::Hash,
|
||||
height: Option<block::Height>,
|
||||
code: u32,
|
||||
raw_log: String,
|
||||
@@ -124,7 +116,7 @@ pub enum NyxdError {
|
||||
#[error("Abci query failed with code {code} - {log}")]
|
||||
AbciError {
|
||||
code: u32,
|
||||
log: String,
|
||||
log: abci::Log,
|
||||
pretty_log: Option<String>,
|
||||
},
|
||||
|
||||
@@ -138,7 +130,7 @@ pub enum NyxdError {
|
||||
NoBaseAccountInformationAvailable,
|
||||
|
||||
#[error("Transaction with ID {hash} has been submitted but not yet found on the chain. You might want to check for it later. There was a total wait of {} seconds", .timeout.as_secs())]
|
||||
BroadcastTimeout { hash: Hash, timeout: Duration },
|
||||
BroadcastTimeout { hash: tx::Hash, timeout: Duration },
|
||||
|
||||
#[error("Cosmwasm std error: {0}")]
|
||||
CosmwasmStdError(#[from] cosmwasm_std::StdError),
|
||||
@@ -156,7 +148,7 @@ pub fn parse_abci_query_result(query_result: AbciQuery) -> Result<AbciQuery, Nyx
|
||||
match query_result.code {
|
||||
AbciCode::Ok => Ok(query_result),
|
||||
AbciCode::Err(code) => Err(NyxdError::AbciError {
|
||||
code: code.into(),
|
||||
code,
|
||||
log: query_result.log.clone(),
|
||||
pretty_log: try_parse_abci_log(&query_result.log),
|
||||
}),
|
||||
@@ -165,8 +157,11 @@ pub fn parse_abci_query_result(query_result: AbciQuery) -> Result<AbciQuery, Nyx
|
||||
|
||||
// Some of the error strings returned by the query are a bit too technical to present to the
|
||||
// enduser. So we special case some commonly encountered errors.
|
||||
fn try_parse_abci_log(log: &str) -> Option<String> {
|
||||
if log.contains("Maximum amount of locked coins has already been pledged") {
|
||||
fn try_parse_abci_log(log: &abci::Log) -> Option<String> {
|
||||
if log
|
||||
.value()
|
||||
.contains("Maximum amount of locked coins has already been pledged")
|
||||
{
|
||||
Some("Maximum amount of locked tokens has already been used. You can only use up to 10% of your locked tokens for bonding and delegating.".to_string())
|
||||
} else {
|
||||
None
|
||||
@@ -176,7 +171,7 @@ fn try_parse_abci_log(log: &str) -> Option<String> {
|
||||
impl NyxdError {
|
||||
pub fn is_tendermint_response_timeout(&self) -> bool {
|
||||
match &self {
|
||||
NyxdError::TendermintErrorRpc(TendermintRpcError(
|
||||
NyxdError::TendermintError(TendermintRpcError(
|
||||
TendermintRpcErrorDetail::Response(err),
|
||||
_,
|
||||
)) => {
|
||||
@@ -203,7 +198,7 @@ impl NyxdError {
|
||||
|
||||
pub fn is_tendermint_response_duplicate(&self) -> bool {
|
||||
match &self {
|
||||
NyxdError::TendermintErrorRpc(TendermintRpcError(
|
||||
NyxdError::TendermintError(TendermintRpcError(
|
||||
TendermintRpcErrorDetail::Response(err),
|
||||
_,
|
||||
)) => {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use crate::nyxd::error::NyxdError;
|
||||
use cosmrs::tx::Gas;
|
||||
use cosmrs::Coin;
|
||||
use cosmrs::Gas;
|
||||
use cosmwasm_std::{Decimal, Fraction, Uint128};
|
||||
use nym_config::defaults;
|
||||
use std::ops::Mul;
|
||||
@@ -25,7 +25,7 @@ impl<'a> Mul<Gas> for &'a GasPrice {
|
||||
type Output = Coin;
|
||||
|
||||
fn mul(self, gas_limit: Gas) -> Self::Output {
|
||||
let limit_uint128 = Uint128::from(gas_limit);
|
||||
let limit_uint128 = Uint128::from(gas_limit.value());
|
||||
let mut amount = self.amount * limit_uint128;
|
||||
|
||||
let gas_price_numerator = self.amount.numerator();
|
||||
@@ -122,7 +122,7 @@ mod tests {
|
||||
fn gas_limit_multiplication() {
|
||||
// real world example that caused an issue when the result was rounded down
|
||||
let gas_price: GasPrice = "0.025upunk".parse().unwrap();
|
||||
let gas_limit: Gas = 157500u64;
|
||||
let gas_limit: Gas = 157500u64.into();
|
||||
|
||||
let fee = &gas_price * gas_limit;
|
||||
// the failing behaviour was result value of 3937
|
||||
|
||||
@@ -116,8 +116,8 @@ impl GasAdjustable for Gas {
|
||||
if adjustment == 1.0 {
|
||||
*self
|
||||
} else {
|
||||
let adjusted = (*self as f32 * adjustment).ceil();
|
||||
adjusted as u64
|
||||
let adjusted = (self.value() as f32 * adjustment).ceil();
|
||||
(adjusted as u64).into()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,9 +125,9 @@ impl GasAdjustable for Gas {
|
||||
// a workaround to provide serde implementation for tx::Fee. We don't want to ever expose any of those
|
||||
// types to the public and ideally they will get replaced by proper implementation inside comrs
|
||||
mod sealed {
|
||||
use cosmrs::tx::{self};
|
||||
use cosmrs::tx::{self, Gas};
|
||||
use cosmrs::Coin as CosmosCoin;
|
||||
use cosmrs::{AccountId, Denom as CosmosDenom};
|
||||
use cosmrs::{Coin as CosmosCoin, Gas};
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
|
||||
@@ -1,67 +1,51 @@
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use crate::nyxd::cosmwasm_client::types::Account;
|
||||
use crate::nyxd::cosmwasm_client::signing_client;
|
||||
use crate::nyxd::cosmwasm_client::types::{
|
||||
Account, ChangeAdminResult, ContractCodeId, ExecuteResult, InstantiateOptions,
|
||||
InstantiateResult, MigrateResult, SequenceResponse, SimulateResponse, UploadResult,
|
||||
};
|
||||
use crate::nyxd::error::NyxdError;
|
||||
use crate::nyxd::fee::DEFAULT_SIMULATED_GAS_MULTIPLIER;
|
||||
use crate::signing::direct_wallet::DirectSecp256k1HdWallet;
|
||||
use crate::signing::signer::OfflineSigner;
|
||||
use cosmrs::cosmwasm;
|
||||
use cosmrs::rpc::endpoint::block::Response as BlockResponse;
|
||||
use cosmrs::rpc::query::Query;
|
||||
use cosmrs::rpc::Error as TendermintRpcError;
|
||||
use cosmrs::rpc::HttpClientUrl;
|
||||
use cosmrs::tx::Msg;
|
||||
use log::{debug, trace};
|
||||
use nym_network_defaults::{ChainDetails, NymNetworkDetails};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tendermint_rpc::{endpoint::block::Response as BlockResponse, query::Query};
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
use tendermint_rpc::Error as TendermintRpcError;
|
||||
use std::convert::TryInto;
|
||||
use std::time::SystemTime;
|
||||
|
||||
pub use crate::nyxd::cosmwasm_client::client::CosmWasmClient;
|
||||
pub use crate::nyxd::cosmwasm_client::signing_client::SigningCosmWasmClient;
|
||||
pub use crate::nyxd::fee::Fee;
|
||||
pub use coin::Coin;
|
||||
pub use cosmrs::bank::MsgSend;
|
||||
pub use cosmrs::tendermint::abci::{response::DeliverTx, Event, EventAttribute};
|
||||
pub use cosmrs::rpc::endpoint::tx::Response as TxResponse;
|
||||
pub use cosmrs::rpc::endpoint::validators::Response as ValidatorResponse;
|
||||
pub use cosmrs::rpc::HttpClient as QueryNyxdClient;
|
||||
pub use cosmrs::rpc::Paging;
|
||||
pub use cosmrs::tendermint::abci::responses::{DeliverTx, Event};
|
||||
pub use cosmrs::tendermint::abci::tag::Tag;
|
||||
pub use cosmrs::tendermint::block::Height;
|
||||
pub use cosmrs::tendermint::hash::{self, Algorithm, Hash};
|
||||
pub use cosmrs::tendermint::hash;
|
||||
pub use cosmrs::tendermint::validator::Info as TendermintValidatorInfo;
|
||||
pub use cosmrs::tendermint::Time as TendermintTime;
|
||||
pub use cosmrs::tx::{self};
|
||||
pub use cosmrs::tx::{self, Gas};
|
||||
pub use cosmrs::Coin as CosmosCoin;
|
||||
pub use cosmrs::Gas;
|
||||
pub use cosmrs::{bip32, AccountId, Denom};
|
||||
use cosmwasm_std::Addr;
|
||||
pub use cosmwasm_std::Coin as CosmWasmCoin;
|
||||
pub use fee::{gas_price::GasPrice, GasAdjustable, GasAdjustment};
|
||||
pub use tendermint_rpc::{client::Client as TendermintClient, Request, Response, SimpleRequest};
|
||||
pub use tendermint_rpc::{
|
||||
endpoint::{tx::Response as TxResponse, validators::Response as ValidatorResponse},
|
||||
Paging,
|
||||
};
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
pub use cosmrs::rpc::{HttpClient as QueryNyxdClient, HttpClientUrl};
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
use crate::nyxd::cosmwasm_client::signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
use crate::nyxd::cosmwasm_client::types::{
|
||||
ChangeAdminResult, ContractCodeId, ExecuteResult, InstantiateOptions, InstantiateResult,
|
||||
MigrateResult, SequenceResponse, SimulateResponse, UploadResult,
|
||||
};
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
use crate::signing::direct_wallet::DirectSecp256k1HdWallet;
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
use crate::signing::signer::OfflineSigner;
|
||||
#[cfg(feature = "signing")]
|
||||
use cosmrs::cosmwasm;
|
||||
#[cfg(feature = "signing")]
|
||||
use cosmrs::tx::Msg;
|
||||
#[cfg(feature = "signing")]
|
||||
use cosmwasm_std::Addr;
|
||||
#[cfg(feature = "signing")]
|
||||
use std::time::SystemTime;
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
pub use crate::nyxd::cosmwasm_client::signing_client::SigningCosmWasmClient;
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
pub use signing_client::Client as SigningNyxdClient;
|
||||
pub use traits::{VestingQueryClient, VestingSigningClient};
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
pub type DirectSigningNyxdClient = SigningNyxdClient<DirectSecp256k1HdWallet>;
|
||||
|
||||
pub mod coin;
|
||||
@@ -168,13 +152,10 @@ impl Config {
|
||||
pub struct NyxdClient<C> {
|
||||
client: C,
|
||||
config: Config,
|
||||
// TODO: refactor because that field is only really used for signing
|
||||
#[allow(dead_code)]
|
||||
client_address: Option<Vec<AccountId>>,
|
||||
simulated_gas_multiplier: f32,
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
impl NyxdClient<QueryNyxdClient> {
|
||||
pub fn connect<U>(config: Config, endpoint: U) -> Result<NyxdClient<QueryNyxdClient>, NyxdError>
|
||||
where
|
||||
@@ -184,12 +165,11 @@ impl NyxdClient<QueryNyxdClient> {
|
||||
client: QueryNyxdClient::new(endpoint)?,
|
||||
config,
|
||||
client_address: None,
|
||||
simulated_gas_multiplier: crate::nyxd::fee::DEFAULT_SIMULATED_GAS_MULTIPLIER,
|
||||
simulated_gas_multiplier: DEFAULT_SIMULATED_GAS_MULTIPLIER,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
impl NyxdClient<SigningNyxdClient<DirectSecp256k1HdWallet>> {
|
||||
// TODO: rename this one
|
||||
pub fn connect_with_mnemonic<U: Clone>(
|
||||
@@ -207,14 +187,12 @@ impl NyxdClient<SigningNyxdClient<DirectSecp256k1HdWallet>> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "signing", feature = "http-client"))]
|
||||
impl<S> NyxdClient<SigningNyxdClient<S>>
|
||||
where
|
||||
S: OfflineSigner,
|
||||
// I have no idea why S::Error: Into<NyxdError> bound wouldn't do the trick
|
||||
NyxdError: From<S::Error>,
|
||||
{
|
||||
#[cfg(feature = "http-client")]
|
||||
pub fn connect_with_signer<U: Clone>(
|
||||
config: Config,
|
||||
endpoint: U,
|
||||
@@ -236,11 +214,10 @@ where
|
||||
client: SigningNyxdClient::connect_with_signer(endpoint, signer, gas_price)?,
|
||||
config,
|
||||
client_address: Some(client_address),
|
||||
simulated_gas_multiplier: crate::nyxd::fee::DEFAULT_SIMULATED_GAS_MULTIPLIER,
|
||||
simulated_gas_multiplier: DEFAULT_SIMULATED_GAS_MULTIPLIER,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(feature = "http-client")]
|
||||
pub fn change_endpoint<U>(&mut self, new_endpoint: U) -> Result<(), NyxdError>
|
||||
where
|
||||
U: TryInto<HttpClientUrl, Error = TendermintRpcError>,
|
||||
@@ -253,47 +230,133 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
impl<C> NyxdClient<C>
|
||||
where
|
||||
C: SigningCosmWasmClient + Sync,
|
||||
{
|
||||
pub fn address(&self) -> &AccountId
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
// if this is a signing client (as required by the trait bound), it must have the address set
|
||||
&self.client_address.as_ref().unwrap()[0]
|
||||
impl<C> NyxdClient<C> {
|
||||
pub fn current_config(&self) -> &Config {
|
||||
&self.config
|
||||
}
|
||||
|
||||
pub fn cw_address(&self) -> Addr
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
// the call to unchecked is fine here as we're converting directly from `AccountId`
|
||||
// which must have been a valid bech32 address
|
||||
Addr::unchecked(self.address().as_ref())
|
||||
pub fn current_chain_details(&self) -> &ChainDetails {
|
||||
&self.config.chain_details
|
||||
}
|
||||
|
||||
pub async fn account_sequence(&self) -> Result<SequenceResponse, NyxdError>
|
||||
where
|
||||
C: SigningCosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_sequence(self.address()).await
|
||||
pub fn set_mixnet_contract_address(&mut self, address: AccountId) {
|
||||
self.config.mixnet_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn signer(&self) -> &<C as SigningCosmWasmClient>::Signer
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
self.client.signer()
|
||||
pub fn set_vesting_contract_address(&mut self, address: AccountId) {
|
||||
self.config.vesting_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn gas_price(&self) -> &GasPrice
|
||||
pub fn set_bandwidth_claim_contract_address(&mut self, address: AccountId) {
|
||||
self.config.bandwidth_claim_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_coconut_bandwidth_contract_address(&mut self, address: AccountId) {
|
||||
self.config.coconut_bandwidth_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_multisig_contract_address(&mut self, address: AccountId) {
|
||||
self.config.multisig_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_service_provider_contract_address(&mut self, address: AccountId) {
|
||||
self.config.service_provider_contract_address = Some(address);
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn mixnet_contract_address(&self) -> &AccountId {
|
||||
self.config.mixnet_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn vesting_contract_address(&self) -> &AccountId {
|
||||
self.config.vesting_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn bandwidth_claim_contract_address(&self) -> &AccountId {
|
||||
self.config
|
||||
.bandwidth_claim_contract_address
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn coconut_bandwidth_contract_address(&self) -> &AccountId {
|
||||
self.config
|
||||
.coconut_bandwidth_contract_address
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn group_contract_address(&self) -> &AccountId {
|
||||
self.config.group_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn multisig_contract_address(&self) -> &AccountId {
|
||||
self.config.multisig_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn coconut_dkg_contract_address(&self) -> &AccountId {
|
||||
self.config.coconut_dkg_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// The service provider directory contract is optional, so we return an Option not a Result
|
||||
pub fn service_provider_contract_address(&self) -> Option<&AccountId> {
|
||||
self.config.service_provider_contract_address.as_ref()
|
||||
}
|
||||
|
||||
// The name service contract is optional, so we return an Option not a Result
|
||||
pub fn name_service_contract_address(&self) -> Option<&AccountId> {
|
||||
self.config.name_service_contract_address.as_ref()
|
||||
}
|
||||
|
||||
pub fn set_simulated_gas_multiplier(&mut self, multiplier: f32) {
|
||||
self.simulated_gas_multiplier = multiplier;
|
||||
}
|
||||
|
||||
pub async fn query_contract_smart<M, T>(
|
||||
&self,
|
||||
contract: &AccountId,
|
||||
query_msg: &M,
|
||||
) -> Result<T, NyxdError>
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
C: CosmWasmClient + Sync,
|
||||
M: ?Sized + Serialize + Sync,
|
||||
for<'a> T: Deserialize<'a>,
|
||||
{
|
||||
self.client.gas_price()
|
||||
self.client.query_contract_smart(contract, query_msg).await
|
||||
}
|
||||
|
||||
pub async fn query_contract_raw(
|
||||
&self,
|
||||
contract: &AccountId,
|
||||
query_data: Vec<u8>,
|
||||
) -> Result<Vec<u8>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.query_contract_raw(contract, query_data).await
|
||||
}
|
||||
|
||||
pub fn wrap_contract_execute_message<M>(
|
||||
@@ -314,6 +377,175 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
pub fn address(&self) -> &AccountId
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
// if this is a signing client (as required by the trait bound), it must have the address set
|
||||
&self.client_address.as_ref().unwrap()[0]
|
||||
}
|
||||
|
||||
pub fn cw_address(&self) -> Addr
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
// the call to unchecked is fine here as we're converting directly from `AccountId`
|
||||
// which must have been a valid bech32 address
|
||||
Addr::unchecked(self.address().as_ref())
|
||||
}
|
||||
|
||||
pub fn signer(&self) -> &<C as SigningCosmWasmClient>::Signer
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
self.client.signer()
|
||||
}
|
||||
|
||||
pub fn gas_price(&self) -> &GasPrice
|
||||
where
|
||||
C: SigningCosmWasmClient,
|
||||
{
|
||||
self.client.gas_price()
|
||||
}
|
||||
|
||||
pub fn gas_adjustment(&self) -> GasAdjustment {
|
||||
self.simulated_gas_multiplier
|
||||
}
|
||||
|
||||
// =============
|
||||
// CHAIN RELATED
|
||||
// =============
|
||||
|
||||
// CHAIN QUERIES
|
||||
|
||||
pub async fn account_sequence(&self) -> Result<SequenceResponse, NyxdError>
|
||||
where
|
||||
C: SigningCosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_sequence(self.address()).await
|
||||
}
|
||||
|
||||
pub async fn get_account_details(
|
||||
&self,
|
||||
address: &AccountId,
|
||||
) -> Result<Option<Account>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_account(address).await
|
||||
}
|
||||
|
||||
pub async fn get_account_public_key(
|
||||
&self,
|
||||
address: &AccountId,
|
||||
) -> Result<Option<cosmrs::crypto::PublicKey>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
if let Some(account) = self.client.get_account(address).await? {
|
||||
let base_account = account.try_get_base_account()?;
|
||||
return Ok(base_account.pubkey);
|
||||
}
|
||||
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub async fn get_current_block_timestamp(&self) -> Result<TendermintTime, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.get_block_timestamp(None).await
|
||||
}
|
||||
|
||||
pub async fn get_block_timestamp(
|
||||
&self,
|
||||
height: Option<u32>,
|
||||
) -> Result<TendermintTime, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
Ok(self.client.get_block(height).await?.block.header.time)
|
||||
}
|
||||
|
||||
pub async fn get_block(&self, height: Option<u32>) -> Result<BlockResponse, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_block(height).await
|
||||
}
|
||||
|
||||
pub async fn get_current_block_height(&self) -> Result<Height, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_height().await
|
||||
}
|
||||
|
||||
/// Obtains the hash of a block specified by the provided height.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `height`: height of the block for which we want to obtain the hash.
|
||||
pub async fn get_block_hash(&self, height: u32) -> Result<hash::Hash, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client
|
||||
.get_block(Some(height))
|
||||
.await
|
||||
.map(|block| block.block_id.hash)
|
||||
}
|
||||
|
||||
pub async fn get_validators(
|
||||
&self,
|
||||
height: u64,
|
||||
paging: Paging,
|
||||
) -> Result<ValidatorResponse, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
Ok(self.client.validators(height as u32, paging).await?)
|
||||
}
|
||||
|
||||
pub async fn get_balance(
|
||||
&self,
|
||||
address: &AccountId,
|
||||
denom: String,
|
||||
) -> Result<Option<Coin>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_balance(address, denom).await
|
||||
}
|
||||
|
||||
pub async fn get_all_balances(&self, address: &AccountId) -> Result<Vec<Coin>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_all_balances(address).await
|
||||
}
|
||||
|
||||
pub async fn get_tx(&self, id: tx::Hash) -> Result<TxResponse, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_tx(id).await
|
||||
}
|
||||
|
||||
pub async fn search_tx(&self, query: Query) -> Result<Vec<TxResponse>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.search_tx(query).await
|
||||
}
|
||||
|
||||
pub async fn get_total_supply(&self) -> Result<Vec<Coin>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_total_supply().await
|
||||
}
|
||||
|
||||
pub async fn simulate<I, M>(&self, messages: I) -> Result<SimulateResponse, NyxdError>
|
||||
where
|
||||
C: SigningCosmWasmClient + Sync,
|
||||
@@ -530,264 +762,3 @@ where
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
impl<C> NyxdClient<C> {
|
||||
pub fn current_config(&self) -> &Config {
|
||||
&self.config
|
||||
}
|
||||
|
||||
pub fn current_chain_details(&self) -> &ChainDetails {
|
||||
&self.config.chain_details
|
||||
}
|
||||
|
||||
pub fn set_mixnet_contract_address(&mut self, address: AccountId) {
|
||||
self.config.mixnet_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_vesting_contract_address(&mut self, address: AccountId) {
|
||||
self.config.vesting_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_bandwidth_claim_contract_address(&mut self, address: AccountId) {
|
||||
self.config.bandwidth_claim_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_coconut_bandwidth_contract_address(&mut self, address: AccountId) {
|
||||
self.config.coconut_bandwidth_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_multisig_contract_address(&mut self, address: AccountId) {
|
||||
self.config.multisig_contract_address = Some(address);
|
||||
}
|
||||
|
||||
pub fn set_service_provider_contract_address(&mut self, address: AccountId) {
|
||||
self.config.service_provider_contract_address = Some(address);
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn mixnet_contract_address(&self) -> &AccountId {
|
||||
self.config.mixnet_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn vesting_contract_address(&self) -> &AccountId {
|
||||
self.config.vesting_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn bandwidth_claim_contract_address(&self) -> &AccountId {
|
||||
self.config
|
||||
.bandwidth_claim_contract_address
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn coconut_bandwidth_contract_address(&self) -> &AccountId {
|
||||
self.config
|
||||
.coconut_bandwidth_contract_address
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn group_contract_address(&self) -> &AccountId {
|
||||
self.config.group_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn multisig_contract_address(&self) -> &AccountId {
|
||||
self.config.multisig_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// TODO: this should get changed into Result<&AccountId, NyxdError> (or Option<&AccountId> in future commits
|
||||
// note: what unwrap is doing here is just moving a failure that would have normally
|
||||
// occurred in `connect` when attempting to parse an empty address,
|
||||
// so it's not introducing new source of failure (just moves it)
|
||||
pub fn coconut_dkg_contract_address(&self) -> &AccountId {
|
||||
self.config.coconut_dkg_contract_address.as_ref().unwrap()
|
||||
}
|
||||
|
||||
// The service provider directory contract is optional, so we return an Option not a Result
|
||||
pub fn service_provider_contract_address(&self) -> Option<&AccountId> {
|
||||
self.config.service_provider_contract_address.as_ref()
|
||||
}
|
||||
|
||||
// The name service contract is optional, so we return an Option not a Result
|
||||
pub fn name_service_contract_address(&self) -> Option<&AccountId> {
|
||||
self.config.name_service_contract_address.as_ref()
|
||||
}
|
||||
|
||||
pub fn set_simulated_gas_multiplier(&mut self, multiplier: f32) {
|
||||
self.simulated_gas_multiplier = multiplier;
|
||||
}
|
||||
|
||||
pub async fn query_contract_smart<M, T>(
|
||||
&self,
|
||||
contract: &AccountId,
|
||||
query_msg: &M,
|
||||
) -> Result<T, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
M: ?Sized + Serialize + Sync,
|
||||
for<'a> T: Deserialize<'a>,
|
||||
{
|
||||
self.client.query_contract_smart(contract, query_msg).await
|
||||
}
|
||||
|
||||
pub async fn query_contract_raw(
|
||||
&self,
|
||||
contract: &AccountId,
|
||||
query_data: Vec<u8>,
|
||||
) -> Result<Vec<u8>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.query_contract_raw(contract, query_data).await
|
||||
}
|
||||
|
||||
pub fn gas_adjustment(&self) -> GasAdjustment {
|
||||
self.simulated_gas_multiplier
|
||||
}
|
||||
|
||||
// =============
|
||||
// CHAIN RELATED
|
||||
// =============
|
||||
|
||||
// CHAIN QUERIES
|
||||
|
||||
pub async fn get_account_details(
|
||||
&self,
|
||||
address: &AccountId,
|
||||
) -> Result<Option<Account>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_account(address).await
|
||||
}
|
||||
|
||||
pub async fn get_account_public_key(
|
||||
&self,
|
||||
address: &AccountId,
|
||||
) -> Result<Option<cosmrs::crypto::PublicKey>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
if let Some(account) = self.client.get_account(address).await? {
|
||||
let base_account = account.try_get_base_account()?;
|
||||
return Ok(base_account.pubkey);
|
||||
}
|
||||
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub async fn get_current_block_timestamp(&self) -> Result<TendermintTime, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.get_block_timestamp(None).await
|
||||
}
|
||||
|
||||
pub async fn get_block_timestamp(
|
||||
&self,
|
||||
height: Option<u32>,
|
||||
) -> Result<TendermintTime, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
Ok(self.client.get_block(height).await?.block.header.time)
|
||||
}
|
||||
|
||||
pub async fn get_block(&self, height: Option<u32>) -> Result<BlockResponse, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_block(height).await
|
||||
}
|
||||
|
||||
pub async fn get_current_block_height(&self) -> Result<Height, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_height().await
|
||||
}
|
||||
|
||||
/// Obtains the hash of a block specified by the provided height.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `height`: height of the block for which we want to obtain the hash.
|
||||
pub async fn get_block_hash(&self, height: u32) -> Result<Hash, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client
|
||||
.get_block(Some(height))
|
||||
.await
|
||||
.map(|block| block.block_id.hash)
|
||||
}
|
||||
|
||||
pub async fn get_validators(
|
||||
&self,
|
||||
height: u64,
|
||||
paging: Paging,
|
||||
) -> Result<ValidatorResponse, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
Ok(self.client.validators(height as u32, paging).await?)
|
||||
}
|
||||
|
||||
pub async fn get_balance(
|
||||
&self,
|
||||
address: &AccountId,
|
||||
denom: String,
|
||||
) -> Result<Option<Coin>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_balance(address, denom).await
|
||||
}
|
||||
|
||||
pub async fn get_all_balances(&self, address: &AccountId) -> Result<Vec<Coin>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_all_balances(address).await
|
||||
}
|
||||
|
||||
pub async fn get_tx(&self, id: Hash) -> Result<TxResponse, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_tx(id).await
|
||||
}
|
||||
|
||||
pub async fn search_tx(&self, query: Query) -> Result<Vec<TxResponse>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.search_tx(query).await
|
||||
}
|
||||
|
||||
pub async fn get_total_supply(&self) -> Result<Vec<Coin>, NyxdError>
|
||||
where
|
||||
C: CosmWasmClient + Sync,
|
||||
{
|
||||
self.client.get_total_supply().await
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,25 +8,20 @@ mod dkg_query_client;
|
||||
mod group_query_client;
|
||||
mod mixnet_query_client;
|
||||
mod multisig_query_client;
|
||||
mod name_service_query_client;
|
||||
mod sp_directory_query_client;
|
||||
mod vesting_query_client;
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
mod coconut_bandwidth_signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
mod dkg_signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
mod mixnet_signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
mod multisig_signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
mod name_service_signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
mod sp_directory_signing_client;
|
||||
#[cfg(feature = "signing")]
|
||||
mod vesting_signing_client;
|
||||
|
||||
mod sp_directory_query_client;
|
||||
mod sp_directory_signing_client;
|
||||
|
||||
mod name_service_query_client;
|
||||
mod name_service_signing_client;
|
||||
|
||||
pub use coconut_bandwidth_query_client::CoconutBandwidthQueryClient;
|
||||
pub use dkg_query_client::DkgQueryClient;
|
||||
pub use group_query_client::GroupQueryClient;
|
||||
@@ -36,17 +31,10 @@ pub use name_service_query_client::NameServiceQueryClient;
|
||||
pub use sp_directory_query_client::SpDirectoryQueryClient;
|
||||
pub use vesting_query_client::VestingQueryClient;
|
||||
|
||||
#[cfg(feature = "signing")]
|
||||
pub use coconut_bandwidth_signing_client::CoconutBandwidthSigningClient;
|
||||
#[cfg(feature = "signing")]
|
||||
pub use dkg_signing_client::DkgSigningClient;
|
||||
#[cfg(feature = "signing")]
|
||||
pub use mixnet_signing_client::MixnetSigningClient;
|
||||
#[cfg(feature = "signing")]
|
||||
pub use multisig_signing_client::MultisigSigningClient;
|
||||
#[cfg(feature = "signing")]
|
||||
pub use name_service_signing_client::NameServiceSigningClient;
|
||||
#[cfg(feature = "signing")]
|
||||
pub use sp_directory_signing_client::SpDirectorySigningClient;
|
||||
#[cfg(feature = "signing")]
|
||||
pub use vesting_signing_client::VestingSigningClient;
|
||||
|
||||
@@ -63,6 +63,7 @@ impl SignerData {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "nyxd-client")]
|
||||
pub fn new_from_sequence_response(
|
||||
response: crate::nyxd::cosmwasm_client::types::SequenceResponse,
|
||||
chain_id: chain::Id,
|
||||
|
||||
@@ -28,7 +28,7 @@ tap = "1"
|
||||
cosmrs = { workspace = true }
|
||||
cosmwasm-std = { workspace = true }
|
||||
|
||||
nym-validator-client = { path = "../client-libs/validator-client", features = ["signing", "http-client"] }
|
||||
nym-validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"] }
|
||||
nym-bin-common = { path = "../../common/bin-common", features = ["output_format"] }
|
||||
nym-crypto = { path = "../../common/crypto", features = ["asymmetric"] }
|
||||
nym-network-defaults = { path = "../network-defaults" }
|
||||
|
||||
@@ -6,7 +6,7 @@ use log::info;
|
||||
|
||||
use nym_mixnet_contract_common::{Coin, MixId};
|
||||
use nym_validator_client::nyxd::traits::MixnetQueryClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
use crate::context::SigningClient;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use clap::Parser;
|
||||
use log::info;
|
||||
use nym_mixnet_contract_common::MixId;
|
||||
use nym_validator_client::nyxd::traits::MixnetQueryClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
use crate::context::SigningClient;
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use clap::Parser;
|
||||
use log::info;
|
||||
use nym_mixnet_contract_common::GatewayConfigUpdate;
|
||||
use nym_validator_client::nyxd::traits::MixnetQueryClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -7,7 +7,7 @@ use log::{info, warn};
|
||||
use nym_contracts_common::signing::MessageSignature;
|
||||
use nym_mixnet_contract_common::{Coin, Gateway};
|
||||
use nym_network_defaults::{DEFAULT_CLIENT_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT};
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::context::SigningClient;
|
||||
use clap::Parser;
|
||||
use log::info;
|
||||
use nym_validator_client::nyxd::traits::MixnetSigningClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -8,7 +8,7 @@ use nym_contracts_common::signing::MessageSignature;
|
||||
use nym_crypto::asymmetric::identity;
|
||||
use nym_mixnet_contract_common::families::FamilyHead;
|
||||
use nym_validator_client::nyxd::traits::MixnetSigningClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use clap::Parser;
|
||||
use log::info;
|
||||
use nym_crypto::asymmetric::identity;
|
||||
use nym_validator_client::nyxd::traits::MixnetSigningClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -7,7 +7,7 @@ use log::info;
|
||||
use nym_crypto::asymmetric::identity;
|
||||
use nym_mixnet_contract_common::families::FamilyHead;
|
||||
use nym_validator_client::nyxd::traits::MixnetSigningClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use clap::Parser;
|
||||
use log::info;
|
||||
use nym_mixnet_contract_common::MixNodeConfigUpdate;
|
||||
use nym_validator_client::nyxd::traits::MixnetQueryClient;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -11,7 +11,7 @@ use nym_mixnet_contract_common::{MixNode, Percent};
|
||||
use nym_network_defaults::{
|
||||
DEFAULT_HTTP_API_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT, DEFAULT_VERLOC_LISTENING_PORT,
|
||||
};
|
||||
use nym_validator_client::nyxd::{traits::VestingSigningClient, CosmWasmCoin};
|
||||
use nym_validator_client::nyxd::{CosmWasmCoin, VestingSigningClient};
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::context::SigningClient;
|
||||
use clap::Parser;
|
||||
use log::info;
|
||||
use nym_mixnet_contract_common::Coin;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
use clap::Parser;
|
||||
use log::info;
|
||||
use nym_mixnet_contract_common::Coin;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
use crate::context::SigningClient;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
use crate::context::SigningClient;
|
||||
use clap::Parser;
|
||||
use log::info;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Args {
|
||||
|
||||
@@ -10,7 +10,7 @@ pub fn secp256k1_verify_with_public_key(
|
||||
public_key_as_bytes: &[u8],
|
||||
signature_as_hex: String,
|
||||
message: String,
|
||||
) -> Result<(), k256::ecdsa::Error> {
|
||||
) -> Result<(), k256::ecdsa::signature::Error> {
|
||||
let verifying_key = VerifyingKey::from_sec1_bytes(public_key_as_bytes)?;
|
||||
let signature = Signature::from_str(&signature_as_hex)?;
|
||||
let message_as_bytes = message.into_bytes();
|
||||
|
||||
@@ -6,7 +6,7 @@ use std::str::FromStr;
|
||||
|
||||
use crate::context::QueryClient;
|
||||
use crate::utils::show_error;
|
||||
use cosmrs::tendermint::Hash;
|
||||
use cosmrs::tx::Hash;
|
||||
use serde_json::json;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
|
||||
@@ -5,7 +5,7 @@ use clap::Parser;
|
||||
use cosmrs::AccountId;
|
||||
use log::{error, info};
|
||||
|
||||
use nym_validator_client::nyxd::{traits::VestingQueryClient, Coin};
|
||||
use nym_validator_client::nyxd::{Coin, VestingQueryClient};
|
||||
|
||||
use crate::context::QueryClient;
|
||||
use crate::utils::show_error;
|
||||
|
||||
@@ -8,8 +8,8 @@ use log::info;
|
||||
|
||||
use nym_mixnet_contract_common::Coin;
|
||||
use nym_network_defaults::NymNetworkDetails;
|
||||
use nym_validator_client::nyxd::traits::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::AccountId;
|
||||
use nym_validator_client::nyxd::VestingSigningClient;
|
||||
use nym_validator_client::nyxd::{CosmosCoin, Denom};
|
||||
use nym_vesting_contract_common::messages::VestingSpecification;
|
||||
use nym_vesting_contract_common::PledgeCap;
|
||||
|
||||
@@ -6,7 +6,7 @@ use cosmrs::AccountId;
|
||||
use cosmwasm_std::Coin as CosmWasmCoin;
|
||||
use log::{error, info};
|
||||
|
||||
use nym_validator_client::nyxd::{traits::VestingQueryClient, Coin};
|
||||
use nym_validator_client::nyxd::{Coin, VestingQueryClient};
|
||||
|
||||
use crate::context::QueryClient;
|
||||
use crate::utils::show_error;
|
||||
|
||||
@@ -4,10 +4,7 @@
|
||||
use clap::Parser;
|
||||
use log::info;
|
||||
|
||||
use nym_validator_client::nyxd::{
|
||||
traits::{VestingQueryClient, VestingSigningClient},
|
||||
Coin,
|
||||
};
|
||||
use nym_validator_client::nyxd::{Coin, VestingQueryClient, VestingSigningClient};
|
||||
|
||||
use crate::context::SigningClient;
|
||||
use crate::utils::show_error;
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
// right now this has no double-spending protection, spender binding, etc
|
||||
// it's the simplest possible case
|
||||
|
||||
use cosmrs::tendermint::hash::Algorithm;
|
||||
use cosmrs::tendermint::Hash;
|
||||
use nym_coconut_interface::{
|
||||
hash_to_scalar, prepare_blind_sign, Attribute, BlindSignRequest, Credential, Parameters,
|
||||
PrivateAttribute, PublicAttribute, Signature, VerificationKey,
|
||||
};
|
||||
use nym_crypto::asymmetric::{encryption, identity};
|
||||
|
||||
use cosmrs::tx::Hash;
|
||||
|
||||
use super::utils::prepare_credential_for_spending;
|
||||
use crate::error::Error;
|
||||
|
||||
@@ -129,9 +129,7 @@ impl BandwidthVoucher {
|
||||
let binding_number = Option::<PrivateAttribute>::from(PrivateAttribute::from_bytes(&buff))
|
||||
.ok_or_else(scalar_err)?;
|
||||
buff.copy_from_slice(&bytes[2 * 32..3 * 32]);
|
||||
let tx_hash = Hash::from_bytes(Algorithm::Sha256, &buff).map_err(|_| {
|
||||
Error::BandwidthVoucherDeserializationError(String::from("Invalid transaction Hash"))
|
||||
})?;
|
||||
let tx_hash = Hash::new(buff);
|
||||
buff.copy_from_slice(&bytes[3 * 32..4 * 32]);
|
||||
let signing_key = identity::PrivateKey::from_bytes(&buff).map_err(|_| {
|
||||
Error::BandwidthVoucherDeserializationError(String::from("Invalid key"))
|
||||
@@ -284,7 +282,6 @@ pub fn prepare_for_spending(
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use cosmrs::tendermint::hash::Algorithm;
|
||||
use nym_coconut_interface::Base58;
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
@@ -295,7 +292,7 @@ mod test {
|
||||
¶ms,
|
||||
"1234".to_string(),
|
||||
"voucher info".to_string(),
|
||||
Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap(),
|
||||
Hash::new([0; 32]),
|
||||
identity::PrivateKey::from_base58_string(
|
||||
identity::KeyPair::new(&mut rng)
|
||||
.private_key()
|
||||
|
||||
@@ -10,10 +10,10 @@ use nym_dkg::bte::proof_discrete_log::ProofOfDiscreteLog;
|
||||
use nym_dkg::bte::proof_sharing::ProofOfSecretSharing;
|
||||
use nym_dkg::bte::{
|
||||
decrypt_share, encrypt_shares, keygen, proof_chunking, proof_sharing, setup, DecryptionKey,
|
||||
Params, PublicKey,
|
||||
PublicKey,
|
||||
};
|
||||
use nym_dkg::interpolation::polynomial::Polynomial;
|
||||
use nym_dkg::{combine_shares, Dealing, NodeIndex, Share, Threshold};
|
||||
use nym_dkg::{Dealing, NodeIndex, Share};
|
||||
use rand_core::{RngCore, SeedableRng};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
@@ -49,37 +49,6 @@ fn prepare_keys(
|
||||
(receivers, dks)
|
||||
}
|
||||
|
||||
fn prepare_resharing(
|
||||
mut rng: impl RngCore,
|
||||
params: &Params,
|
||||
nodes: usize,
|
||||
threshold: Threshold,
|
||||
) -> (BTreeMap<NodeIndex, PublicKey>, Vec<Scalar>) {
|
||||
let (receivers, mut dks) = prepare_keys(&mut rng, nodes);
|
||||
|
||||
let first_dealings = receivers
|
||||
.keys()
|
||||
.map(|&dealer_index| {
|
||||
Dealing::create(&mut rng, params, dealer_index, threshold, &receivers, None).0
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let mut derived_secrets = Vec::new();
|
||||
for (i, ref mut dk) in dks.iter_mut().enumerate() {
|
||||
let shares = first_dealings
|
||||
.iter()
|
||||
.map(|dealing| decrypt_share(dk, i, &dealing.ciphertexts, None).unwrap())
|
||||
.collect();
|
||||
|
||||
let recovered_secret =
|
||||
combine_shares(shares, &receivers.keys().copied().collect::<Vec<_>>()).unwrap();
|
||||
|
||||
derived_secrets.push(recovered_secret)
|
||||
}
|
||||
|
||||
(receivers, derived_secrets)
|
||||
}
|
||||
|
||||
pub fn creating_dealing_for_3_parties(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
@@ -104,33 +73,6 @@ pub fn creating_dealing_for_3_parties(c: &mut Criterion) {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn creating_reshared_dealing_for_3_parties(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
let params = setup();
|
||||
let threshold = 2;
|
||||
|
||||
let (receivers, mut derived_secrets) = prepare_resharing(&mut rng, ¶ms, 3, threshold);
|
||||
|
||||
c.bench_function(
|
||||
"creating single re-shared dealing for 3 parties (threshold 2)",
|
||||
|b| {
|
||||
b.iter(|| {
|
||||
black_box({
|
||||
Dealing::create(
|
||||
&mut rng,
|
||||
¶ms,
|
||||
receivers.keys().next().copied().unwrap(),
|
||||
threshold,
|
||||
&receivers,
|
||||
Some(derived_secrets.pop().unwrap()),
|
||||
)
|
||||
})
|
||||
})
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
pub fn verifying_dealing_made_for_3_parties_and_recovering_share(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
@@ -187,33 +129,6 @@ pub fn creating_dealing_for_20_parties(c: &mut Criterion) {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn creating_reshared_dealing_for_20_parties(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
let params = setup();
|
||||
let threshold = 14;
|
||||
|
||||
let (receivers, mut derived_secrets) = prepare_resharing(&mut rng, ¶ms, 20, threshold);
|
||||
|
||||
c.bench_function(
|
||||
"creating single re-shared dealing for 20 parties (threshold 14)",
|
||||
|b| {
|
||||
b.iter(|| {
|
||||
black_box({
|
||||
Dealing::create(
|
||||
&mut rng,
|
||||
¶ms,
|
||||
receivers.keys().next().copied().unwrap(),
|
||||
threshold,
|
||||
&receivers,
|
||||
Some(derived_secrets.pop().unwrap()),
|
||||
)
|
||||
})
|
||||
})
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
pub fn verifying_dealing_made_for_20_parties_and_recovering_share(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
@@ -270,33 +185,6 @@ pub fn creating_dealing_for_100_parties(c: &mut Criterion) {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn creating_reshared_dealing_for_100_parties(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
let params = setup();
|
||||
let threshold = 67;
|
||||
|
||||
let (receivers, mut derived_secrets) = prepare_resharing(&mut rng, ¶ms, 100, threshold);
|
||||
|
||||
c.bench_function(
|
||||
"creating single re-shared dealing for 100 parties (threshold 67)",
|
||||
|b| {
|
||||
b.iter(|| {
|
||||
black_box({
|
||||
Dealing::create(
|
||||
&mut rng,
|
||||
¶ms,
|
||||
receivers.keys().next().copied().unwrap(),
|
||||
threshold,
|
||||
&receivers,
|
||||
Some(derived_secrets.pop().unwrap()),
|
||||
)
|
||||
})
|
||||
})
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
pub fn verifying_dealing_made_for_100_parties_and_recovering_share(c: &mut Criterion) {
|
||||
let dummy_seed = [42u8; 32];
|
||||
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
|
||||
@@ -584,13 +472,6 @@ criterion_group!(
|
||||
creating_dealing_for_100_parties,
|
||||
);
|
||||
|
||||
criterion_group!(
|
||||
reshared_dealings_creation,
|
||||
creating_reshared_dealing_for_3_parties,
|
||||
creating_reshared_dealing_for_20_parties,
|
||||
creating_reshared_dealing_for_100_parties,
|
||||
);
|
||||
|
||||
// note: in our setting each party will have to create at least 4 dealings (one per attribute in credential)
|
||||
// and verify 99 * 4 of them (4 from each other dealer)
|
||||
criterion_group!(
|
||||
@@ -620,7 +501,6 @@ criterion_group!(
|
||||
criterion_main!(
|
||||
utils,
|
||||
dealings_creation,
|
||||
reshared_dealings_creation,
|
||||
dealings_verification,
|
||||
proofs_of_knowledge,
|
||||
encryption
|
||||
|
||||
@@ -6,7 +6,7 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
bip32 = "0.5.1"
|
||||
bip32 = "0.4.0"
|
||||
k256 = { workspace = true }
|
||||
ledger-transport = "0.10.0"
|
||||
ledger-transport-hid = "0.10.0"
|
||||
|
||||
@@ -27,7 +27,7 @@ impl TryFrom<APDUAnswer<Vec<u8>>> for AddrSecp256k1Response {
|
||||
}
|
||||
|
||||
let (pub_key, addr) = bytes.split_at(33);
|
||||
let public_key = PublicKey::from_bytes(
|
||||
let public_key = k256::PublicKey::from_bytes(
|
||||
PublicKeyBytes::try_from(pub_key).expect("Public key should be 33 bytes"),
|
||||
)?;
|
||||
let address = String::from_utf8(addr.to_vec()).unwrap();
|
||||
|
||||
@@ -36,7 +36,9 @@ nym-sphinx-framing = { path = "../nymsphinx/framing" }
|
||||
nym-sphinx-params = { path = "../nymsphinx/params" }
|
||||
nym-sphinx-types = { path = "../nymsphinx/types" }
|
||||
nym-task = { path = "../task" }
|
||||
nym-validator-client = { path = "../client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../client-libs/validator-client", features = [
|
||||
"nyxd-client",
|
||||
] }
|
||||
nym-bin-common = { path = "../bin-common" }
|
||||
|
||||
cfg-if = "1.0.0"
|
||||
|
||||
@@ -26,7 +26,7 @@ nym-service-providers-common = { path = "../../service-providers/common" }
|
||||
nym-socks5-requests = { path = "../socks5/requests" }
|
||||
nym-sphinx = { path = "../nymsphinx" }
|
||||
nym-task = { path = "../task" }
|
||||
nym-validator-client = { path = "../client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
@@ -22,7 +22,9 @@ ts-rs = "6.1.2"
|
||||
cosmwasm-std = { workspace = true }
|
||||
cosmrs = { workspace = true }
|
||||
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client", features = [
|
||||
"nyxd-client",
|
||||
] }
|
||||
nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" }
|
||||
nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" }
|
||||
nym-config = { path = "../../common/config" }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use cosmrs::Gas as CosmrsGas;
|
||||
use cosmrs::tx::Gas as CosmrsGas;
|
||||
use nym_validator_client::nyxd::cosmwasm_client::types::GasInfo as ValidatorClientGasInfo;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -21,14 +21,8 @@ impl Gas {
|
||||
|
||||
impl From<CosmrsGas> for Gas {
|
||||
fn from(gas: CosmrsGas) -> Self {
|
||||
Gas { gas_units: gas }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<i64> for Gas {
|
||||
fn from(value: i64) -> Self {
|
||||
Gas {
|
||||
gas_units: value.try_into().unwrap_or_default(),
|
||||
gas_units: gas.value(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,14 +93,6 @@ We love seeing our developer community create applications using Nym. If you wou
|
||||
|
||||
|
||||
|
||||
## <img src='../images/profile_picture/nymgraph_pp.png' style="float: right; width: 75px; height: 75px;">NymGraph
|
||||
|
||||
> NymGraph is a graphical chat client for Nym running on Ubuntu and Debian. Test it to chat over the Nym network!
|
||||
* [Github](https://github.com/Tyz3/nymgraph)
|
||||
|
||||
|
||||
|
||||
|
||||
<br/> <br/>
|
||||
|
||||
# Community Guides
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.3 KiB |
+14
-14
@@ -3,22 +3,22 @@ CONFIGURED=true
|
||||
RUST_LOG=info
|
||||
RUST_BACKTRACE=1
|
||||
|
||||
BECH32_PREFIX=n
|
||||
MIX_DENOM=unym
|
||||
MIX_DENOM_DISPLAY=nym
|
||||
STAKE_DENOM=unyx
|
||||
STAKE_DENOM_DISPLAY=nyx
|
||||
BECH32_PREFIX=nymt
|
||||
MIX_DENOM=unymt
|
||||
MIX_DENOM_DISPLAY=nymt
|
||||
STAKE_DENOM=unyxt
|
||||
STAKE_DENOM_DISPLAY=nyxt
|
||||
DENOMS_EXPONENT=6
|
||||
|
||||
REWARDING_VALIDATOR_ADDRESS=n1pefc2utwpy5w78p2kqdsfmpjxfwmn9d39k5mqa
|
||||
MIXNET_CONTRACT_ADDRESS=n1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3sjkxkav
|
||||
VESTING_CONTRACT_ADDRESS=n1unyuj8qnmygvzuex3dwmg9yzt9alhvyeat0uu0jedg2wj33efl5qackslz
|
||||
BANDWIDTH_CLAIM_CONTRACT_ADDRESS=n19lc9u84cz0yz3fww5283nucc9yvr8gsjmgeul0
|
||||
COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n16a32stm6kknhq5cc8rx77elr66pygf2hfszw7wvpq746x3uffylqkjar4l
|
||||
GROUP_CONTRACT_ADDRESS=n1pd7kfgvr5tpcv0xnlv46c4jsq9jg2r799xxrcwqdm4l2jhq2pjwqrmz5ju
|
||||
MULTISIG_CONTRACT_ADDRESS=n14ph4e660eyqz0j36zlkaey4zgzexm5twkmjlqaequxr2cjm9eprqsmad6k
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1ahg0erc2fs6xx3j5m8sfx3ryuzdjh6kf6qm9plsf865fltekyrfsesac6a
|
||||
REWARDING_VALIDATOR_ADDRESS="nymt1mxuweurc066kprnngtm8zmvam7m2nw26yatpmv"
|
||||
MIXNET_CONTRACT_ADDRESS="nymt1dlsvvgey26ernlj0sq2afjluh3qd4ap0k9eerekfkw5algqrwqksaf2qf7"
|
||||
VESTING_CONTRACT_ADDRESS="nymt19g9xuqrvz2frv905v3fc7puryfypluhg383q9zwsmedrlqekfgys62ykm4"
|
||||
BANDWIDTH_CLAIM_CONTRACT_ADDRESS="nymt1rhmk9udessnv3r8f3eh2s03f45svnjaczpmcqz"
|
||||
MULTISIG_CONTRACT_ADDRESS="nymt142dkm8xe9f0ytyarp7ww4kvclva65705jphxsk9exn3nqdsm8jkqnp06ac"
|
||||
COCONUT_BANDWIDTH_CONTRACT_ADDRESS="nymt1ty0frysegskh6ndm3v96z5xdq66qzcu0aw7xcxlgp54jg0mjwlgqplc6v0"
|
||||
COCONUT_DKG_CONTRACT_ADDRESS="nymt1gwk6muhmzeuxje7df7rjvqwl2vex0kj4t2hwuzmyx5k62kfusu5qk4k5z4"
|
||||
GROUP_CONTRACT_ADDRESS="nymt14ry36mwauycz08v8ndcujghxz4hmua5epxcn0mamlr3suqe0l2qsqx5ya2"
|
||||
|
||||
STATISTICS_SERVICE_DOMAIN_ADDRESS="http://0.0.0.0"
|
||||
NYXD="https://sandbox-validator1.nymtech.net"
|
||||
NYM_API="https://sandbox-nym-api1.nymtech.net/api"
|
||||
NYM_API="https://sandbox-validator1-api.nymtech.net/api"
|
||||
@@ -34,4 +34,4 @@ nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-co
|
||||
nym-network-defaults = { path = "../common/network-defaults" }
|
||||
nym-bin-common = { path = "../common/bin-common"}
|
||||
nym-task = { path = "../common/task" }
|
||||
nym-validator-client = { path = "../common/client-libs/validator-client", features=["http-client"] }
|
||||
nym-validator-client = { path = "../common/client-libs/validator-client", features=["nyxd-client"] }
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ nym-sphinx = { path = "../common/nymsphinx" }
|
||||
nym-statistics-common = { path = "../common/statistics" }
|
||||
nym-task = { path = "../common/task" }
|
||||
nym-types = { path = "../common/types" }
|
||||
nym-validator-client = { path = "../common/client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../common/client-libs/validator-client", features = [ "nyxd-client" ] }
|
||||
|
||||
[build-dependencies]
|
||||
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
|
||||
|
||||
@@ -14,7 +14,9 @@ eyre = "0.6.5"
|
||||
cosmrs = { workspace = true }
|
||||
|
||||
nym-cli-commands = { path = "../../common/commands" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client", features = [
|
||||
"nyxd-client",
|
||||
] }
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = "1"
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ nym-task = { path = "../common/task" }
|
||||
nym-topology = { path = "../common/topology" }
|
||||
nym-api-requests = { path = "nym-api-requests" }
|
||||
nym-validator-client = { path = "../common/client-libs/validator-client", features = [
|
||||
"http-client", "signing"
|
||||
"nyxd-client",
|
||||
] }
|
||||
nym-bin-common = { path = "../common/bin-common" }
|
||||
nym-node-tester-utils = { path = "../common/node-tester-utils" }
|
||||
|
||||
@@ -35,14 +35,14 @@ pub async fn extract_encryption_key(
|
||||
.tx_result
|
||||
.events
|
||||
.iter()
|
||||
.find(|event| event.kind == format!("wasm-{}", DEPOSITED_FUNDS_EVENT_TYPE))
|
||||
.find(|event| event.type_str == format!("wasm-{}", DEPOSITED_FUNDS_EVENT_TYPE))
|
||||
.ok_or(CoconutError::DepositEventNotFound)?
|
||||
.attributes
|
||||
.as_ref();
|
||||
|
||||
let deposit_value: &str = attributes
|
||||
let deposit_value = attributes
|
||||
.iter()
|
||||
.find(|tag| tag.key == DEPOSIT_VALUE)
|
||||
.find(|tag| tag.key.as_ref() == DEPOSIT_VALUE)
|
||||
.ok_or(CoconutError::DepositValueNotFound)?
|
||||
.value
|
||||
.as_ref();
|
||||
@@ -54,9 +54,9 @@ pub async fn extract_encryption_key(
|
||||
));
|
||||
}
|
||||
|
||||
let deposit_info: &str = attributes
|
||||
let deposit_info = attributes
|
||||
.iter()
|
||||
.find(|tag| tag.key == DEPOSIT_INFO)
|
||||
.find(|tag| tag.key.as_ref() == DEPOSIT_INFO)
|
||||
.ok_or(CoconutError::DepositInfoNotFound)?
|
||||
.value
|
||||
.as_ref();
|
||||
@@ -69,19 +69,21 @@ pub async fn extract_encryption_key(
|
||||
}
|
||||
|
||||
let verification_key = identity::PublicKey::from_base58_string(
|
||||
&attributes
|
||||
attributes
|
||||
.iter()
|
||||
.find(|tag| tag.key == DEPOSIT_IDENTITY_KEY)
|
||||
.find(|tag| tag.key.as_ref() == DEPOSIT_IDENTITY_KEY)
|
||||
.ok_or(CoconutError::DepositVerifKeyNotFound)?
|
||||
.value,
|
||||
.value
|
||||
.as_ref(),
|
||||
)?;
|
||||
|
||||
let encryption_key = encryption::PublicKey::from_base58_string(
|
||||
&attributes
|
||||
attributes
|
||||
.iter()
|
||||
.find(|tag| tag.key == DEPOSIT_ENCRYPTION_KEY)
|
||||
.find(|tag| tag.key.as_ref() == DEPOSIT_ENCRYPTION_KEY)
|
||||
.ok_or(CoconutError::DepositEncrKeyNotFound)?
|
||||
.value,
|
||||
.value
|
||||
.as_ref(),
|
||||
)?;
|
||||
|
||||
verification_key.verify(&message, &signature)?;
|
||||
@@ -95,8 +97,8 @@ mod test {
|
||||
use crate::coconut::tests::tx_entry_fixture;
|
||||
use nym_coconut::{prepare_blind_sign, BlindSignRequest, Parameters};
|
||||
use nym_config::defaults::VOUCHER_INFO;
|
||||
use nym_validator_client::nyxd::Hash;
|
||||
use nym_validator_client::nyxd::{Event, EventAttribute};
|
||||
use nym_validator_client::nyxd::tx::Hash;
|
||||
use nym_validator_client::nyxd::{Event, Tag};
|
||||
use rand_07::rngs::OsRng;
|
||||
use std::str::FromStr;
|
||||
|
||||
@@ -180,7 +182,7 @@ mod test {
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.push(Event {
|
||||
kind: format!("wasm-{}", DEPOSITED_FUNDS_EVENT_TYPE),
|
||||
type_str: format!("wasm-{}", DEPOSITED_FUNDS_EVENT_TYPE),
|
||||
attributes: vec![],
|
||||
});
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -191,10 +193,9 @@ mod test {
|
||||
CoconutError::DepositValueNotFound.to_string(),
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![EventAttribute {
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "10".parse().unwrap(),
|
||||
index: false,
|
||||
}];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
.await
|
||||
@@ -205,10 +206,9 @@ mod test {
|
||||
.to_string(),
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![EventAttribute {
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
}];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
.await
|
||||
@@ -219,15 +219,13 @@ mod test {
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: "bandwidth deposit info".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -243,15 +241,13 @@ mod test {
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -263,20 +259,17 @@ mod test {
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_IDENTITY_KEY.parse().unwrap(),
|
||||
value: "verification key".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -291,22 +284,19 @@ mod test {
|
||||
));
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_IDENTITY_KEY.parse().unwrap(),
|
||||
value: "2eSxwquNJb2nZTEW5p4rbqjHfBaz9UaNhjHHiexPN4He"
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -318,27 +308,23 @@ mod test {
|
||||
);
|
||||
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_IDENTITY_KEY.parse().unwrap(),
|
||||
value: "6EJGMdEq7t8Npz54uPkftGsdmj7DKntLVputAnDfVZB2"
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_ENCRYPTION_KEY.parse().unwrap(),
|
||||
value: "encryption key".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -354,27 +340,23 @@ mod test {
|
||||
|
||||
let expected_encryption_key = "HxnTpWTkgigSTAysVKLE8pEiUULHdTT1BxFfzfJvQRi6";
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_IDENTITY_KEY.parse().unwrap(),
|
||||
value: "6EJGMdEq7t8Npz54uPkftGsdmj7DKntLVputAnDfVZB2"
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_ENCRYPTION_KEY.parse().unwrap(),
|
||||
value: expected_encryption_key.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let err = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
@@ -423,29 +405,25 @@ mod test {
|
||||
4,
|
||||
);
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_IDENTITY_KEY.parse().unwrap(),
|
||||
value: "64auwDkWan7R8yH1Mwe9dS4qXgrDBCUNDg3Q4KFnd2P5"
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_ENCRYPTION_KEY.parse().unwrap(),
|
||||
value: "HxnTpWTkgigSTAysVKLE8pEiUULHdTT1BxFfzfJvQRi6"
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
let encryption_key = extract_encryption_key(&correct_request, tx_entry.clone())
|
||||
|
||||
@@ -11,7 +11,7 @@ pub(crate) fn accepted_vote_err(ret: Result<(), CoconutError>) -> Result<(), Coc
|
||||
let accepted_err =
|
||||
nym_multisig_contract_common::error::ContractError::NotOpen {}.to_string();
|
||||
// If redundant voting is not the case, error out on all other error variants
|
||||
if !log.contains(&accepted_err) {
|
||||
if !log.value().contains(&accepted_err) {
|
||||
ret?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ use nym_validator_client::nym_api::routes::{
|
||||
API_VERSION, BANDWIDTH, COCONUT_BLIND_SIGN, COCONUT_ROUTES, COCONUT_VERIFY_BANDWIDTH_CREDENTIAL,
|
||||
};
|
||||
use nym_validator_client::nyxd::Coin;
|
||||
use nym_validator_client::nyxd::{
|
||||
AccountId, Algorithm, DeliverTx, Event, EventAttribute, Fee, Hash, TxResponse,
|
||||
};
|
||||
use nym_validator_client::nyxd::{tx::Hash, AccountId, DeliverTx, Event, Fee, Tag, TxResponse};
|
||||
|
||||
use crate::coconut::State;
|
||||
use crate::support::storage::NymApiStorage;
|
||||
@@ -367,7 +365,7 @@ impl super::client::Client for DummyClient {
|
||||
.add_attribute(NODE_INDEX, assigned_index.to_string())],
|
||||
}],
|
||||
data: Default::default(),
|
||||
transaction_hash: Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap(),
|
||||
transaction_hash: Hash::new([0; 32]),
|
||||
gas_info: Default::default(),
|
||||
})
|
||||
}
|
||||
@@ -391,7 +389,7 @@ impl super::client::Client for DummyClient {
|
||||
Ok(ExecuteResult {
|
||||
logs: vec![],
|
||||
data: Default::default(),
|
||||
transaction_hash: Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap(),
|
||||
transaction_hash: Hash::new([0; 32]),
|
||||
gas_info: Default::default(),
|
||||
})
|
||||
}
|
||||
@@ -459,7 +457,7 @@ impl super::client::Client for DummyClient {
|
||||
.add_attribute(DKG_PROPOSAL_ID, proposal_id.to_string())],
|
||||
}],
|
||||
data: Default::default(),
|
||||
transaction_hash: Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap(),
|
||||
transaction_hash: Hash::new([0; 32]),
|
||||
gas_info: Default::default(),
|
||||
})
|
||||
}
|
||||
@@ -500,7 +498,7 @@ pub fn tx_entry_fixture(tx_hash: &str) -> TxResponse {
|
||||
events: vec![],
|
||||
codespace: Default::default(),
|
||||
},
|
||||
tx: vec![],
|
||||
tx: vec![].into(),
|
||||
proof: None,
|
||||
}
|
||||
}
|
||||
@@ -751,37 +749,33 @@ async fn blind_sign_correct() {
|
||||
|
||||
let mut tx_entry = tx_entry_fixture(&tx_hash.to_string());
|
||||
tx_entry.tx_result.events.push(Event {
|
||||
kind: format!("wasm-{}", DEPOSITED_FUNDS_EVENT_TYPE),
|
||||
type_str: format!("wasm-{}", DEPOSITED_FUNDS_EVENT_TYPE),
|
||||
attributes: vec![],
|
||||
});
|
||||
tx_entry.tx_result.events.get_mut(0).unwrap().attributes = vec![
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_VALUE.parse().unwrap(),
|
||||
value: "1234".parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_INFO.parse().unwrap(),
|
||||
value: VOUCHER_INFO.parse().unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_IDENTITY_KEY.parse().unwrap(),
|
||||
value: identity_keypair
|
||||
.public_key()
|
||||
.to_base58_string()
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
EventAttribute {
|
||||
Tag {
|
||||
key: DEPOSIT_ENCRYPTION_KEY.parse().unwrap(),
|
||||
value: encryption_keypair
|
||||
.public_key()
|
||||
.to_base58_string()
|
||||
.parse()
|
||||
.unwrap(),
|
||||
index: false,
|
||||
},
|
||||
];
|
||||
tx_db
|
||||
|
||||
@@ -35,13 +35,13 @@ use nym_validator_client::nyxd::{
|
||||
cosmwasm_client::types::ExecuteResult,
|
||||
traits::{
|
||||
CoconutBandwidthQueryClient, DkgQueryClient, DkgSigningClient, GroupQueryClient,
|
||||
MultisigQueryClient, MultisigSigningClient, NameServiceQueryClient, VestingQueryClient,
|
||||
MultisigQueryClient, MultisigSigningClient, NameServiceQueryClient,
|
||||
},
|
||||
Fee,
|
||||
};
|
||||
use nym_validator_client::nyxd::{
|
||||
hash::{Hash, SHA256_HASH_SIZE},
|
||||
AccountId, Coin, DirectSigningNyxdClient, TendermintTime,
|
||||
AccountId, Coin, DirectSigningNyxdClient, TendermintTime, VestingQueryClient,
|
||||
};
|
||||
use nym_validator_client::ValidatorClientError;
|
||||
use nym_vesting_contract_common::AccountVestingCoins;
|
||||
@@ -321,8 +321,8 @@ impl crate::coconut::client::Client for Client {
|
||||
&self,
|
||||
tx_hash: &str,
|
||||
) -> crate::coconut::error::Result<nym_validator_client::nyxd::TxResponse> {
|
||||
let tx_hash: Hash = tx_hash
|
||||
.parse()
|
||||
let tx_hash = tx_hash
|
||||
.parse::<nym_validator_client::nyxd::tx::Hash>()
|
||||
.map_err(|_| CoconutError::TxHashParseError)?;
|
||||
Ok(self.0.read().await.nyxd.get_tx(tx_hash).await?)
|
||||
}
|
||||
|
||||
Generated
+110
-293
@@ -226,12 +226,6 @@ version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
|
||||
|
||||
[[package]]
|
||||
name = "base16ct"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.1"
|
||||
@@ -261,13 +255,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bip32"
|
||||
version = "0.5.1"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164"
|
||||
checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b"
|
||||
dependencies = [
|
||||
"bs58 0.5.0",
|
||||
"bs58",
|
||||
"hmac 0.12.1",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"once_cell",
|
||||
"pbkdf2",
|
||||
"rand_core 0.6.4",
|
||||
@@ -284,8 +278,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f"
|
||||
dependencies = [
|
||||
"bitcoin_hashes",
|
||||
"rand 0.7.3",
|
||||
"rand_core 0.5.1",
|
||||
"rand 0.8.5",
|
||||
"rand_core 0.6.4",
|
||||
"serde",
|
||||
"unicode-normalization",
|
||||
"zeroize",
|
||||
@@ -344,7 +338,7 @@ dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"constant_time_eq",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -425,14 +419,8 @@ name = "bs58"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
||||
|
||||
[[package]]
|
||||
name = "bs58"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896"
|
||||
dependencies = [
|
||||
"sha2 0.10.6",
|
||||
"sha2 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -474,9 +462,6 @@ name = "bytes"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
@@ -801,9 +786,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cosmos-sdk-proto"
|
||||
version = "0.19.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c"
|
||||
checksum = "8bb61f3d2224c90ea78e1fa7444787761a549170c46b6b0ed09b93f9b7e4076a"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"prost-types",
|
||||
@@ -812,16 +797,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cosmrs"
|
||||
version = "0.14.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6"
|
||||
checksum = "20d5890dac07a62337e5841adb8f2074a66a962a098a48df9460f64d483beaf4"
|
||||
dependencies = [
|
||||
"bip32",
|
||||
"cosmos-sdk-proto",
|
||||
"ecdsa 0.16.8",
|
||||
"ecdsa",
|
||||
"eyre",
|
||||
"getrandom 0.2.10",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"rand_core 0.6.4",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -837,9 +824,9 @@ version = "1.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75836a10cb9654c54e77ee56da94d592923092a10b369cdb0dbd56acefc16340"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-zebra",
|
||||
"k256 0.11.6",
|
||||
"k256",
|
||||
"rand_core 0.6.4",
|
||||
"thiserror",
|
||||
]
|
||||
@@ -1016,18 +1003,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15"
|
||||
dependencies = [
|
||||
"generic-array 0.14.7",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
@@ -1136,19 +1111,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek-ng"
|
||||
version = "4.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"digest 0.9.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle-ng",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cw-controllers"
|
||||
version = "1.0.1"
|
||||
@@ -1323,16 +1285,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "der"
|
||||
version = "0.7.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "2.2.0"
|
||||
@@ -1377,12 +1329,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.4",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
@@ -1500,24 +1451,10 @@ version = "0.14.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"elliptic-curve 0.12.3",
|
||||
"rfc6979 0.3.1",
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ecdsa"
|
||||
version = "0.16.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"digest 0.10.7",
|
||||
"elliptic-curve 0.13.5",
|
||||
"rfc6979 0.4.0",
|
||||
"signature 2.1.0",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"elliptic-curve",
|
||||
"rfc6979",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1526,30 +1463,7 @@ version = "1.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
|
||||
dependencies = [
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "2.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963"
|
||||
dependencies = [
|
||||
"pkcs8 0.10.2",
|
||||
"signature 2.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519-consensus"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b"
|
||||
dependencies = [
|
||||
"curve25519-dalek-ng",
|
||||
"hex",
|
||||
"rand_core 0.6.4",
|
||||
"sha2 0.9.9",
|
||||
"zeroize",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1559,7 +1473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519 1.5.3",
|
||||
"ed25519",
|
||||
"rand 0.7.3",
|
||||
"serde",
|
||||
"sha2 0.9.9",
|
||||
@@ -1593,35 +1507,16 @@ version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"crypto-bigint 0.4.9",
|
||||
"der 0.6.1",
|
||||
"digest 0.10.7",
|
||||
"base16ct",
|
||||
"crypto-bigint",
|
||||
"der",
|
||||
"digest 0.10.6",
|
||||
"ff 0.12.1",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.12.1",
|
||||
"pkcs8 0.9.0",
|
||||
"pkcs8",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.3.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "elliptic-curve"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"crypto-bigint 0.5.2",
|
||||
"digest 0.10.7",
|
||||
"ff 0.13.0",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.13.0",
|
||||
"pkcs8 0.10.2",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.7.3",
|
||||
"sec1",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -1766,16 +1661,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
||||
dependencies = [
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "field-offset"
|
||||
version = "0.3.5"
|
||||
@@ -2115,7 +2000,6 @@ dependencies = [
|
||||
"serde",
|
||||
"typenum",
|
||||
"version_check",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2327,17 +2211,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
|
||||
dependencies = [
|
||||
"ff 0.13.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gtk"
|
||||
version = "0.15.5"
|
||||
@@ -2582,18 +2455,7 @@ version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hostname"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"match_cfg",
|
||||
"winapi",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3012,23 +2874,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"ecdsa 0.14.8",
|
||||
"elliptic-curve 0.12.3",
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"sha2 0.10.6",
|
||||
"sha3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "k256"
|
||||
version = "0.13.1"
|
||||
name = "keccak"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc"
|
||||
checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"ecdsa 0.16.8",
|
||||
"elliptic-curve 0.13.5",
|
||||
"once_cell",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3515,7 +3373,7 @@ dependencies = [
|
||||
name = "nym-api-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmrs",
|
||||
"cosmwasm-std",
|
||||
"getset",
|
||||
@@ -3606,7 +3464,7 @@ name = "nym-coconut"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bls12_381 0.6.0",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"digest 0.9.0",
|
||||
"ff 0.11.1",
|
||||
"getrandom 0.2.10",
|
||||
@@ -3647,7 +3505,7 @@ dependencies = [
|
||||
name = "nym-coconut-interface"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"getset",
|
||||
"nym-coconut",
|
||||
"serde",
|
||||
@@ -3706,6 +3564,7 @@ dependencies = [
|
||||
"tauri-codegen",
|
||||
"tauri-macros",
|
||||
"tempfile",
|
||||
"tendermint-rpc",
|
||||
"thiserror",
|
||||
"time",
|
||||
"tokio",
|
||||
@@ -3719,7 +3578,7 @@ dependencies = [
|
||||
name = "nym-contracts-common"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"schemars",
|
||||
"serde",
|
||||
@@ -3756,10 +3615,10 @@ version = "0.4.0"
|
||||
dependencies = [
|
||||
"aes 0.8.2",
|
||||
"blake3",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cipher 0.4.4",
|
||||
"ctr 0.9.2",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-dalek",
|
||||
"generic-array 0.14.7",
|
||||
"hkdf 0.12.3",
|
||||
@@ -3779,7 +3638,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"bls12_381 0.6.0",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"ff 0.11.1",
|
||||
"group 0.11.0",
|
||||
"lazy_static",
|
||||
@@ -3829,7 +3688,7 @@ dependencies = [
|
||||
name = "nym-gateway-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"futures",
|
||||
"generic-array 0.14.7",
|
||||
"log",
|
||||
@@ -3861,7 +3720,7 @@ dependencies = [
|
||||
name = "nym-mixnet-contract-common"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"humantime-serde",
|
||||
"log",
|
||||
@@ -4092,7 +3951,7 @@ dependencies = [
|
||||
name = "nym-sphinx-anonymous-replies"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"nym-crypto",
|
||||
"nym-sphinx-addressing",
|
||||
"nym-sphinx-params",
|
||||
@@ -4201,7 +4060,7 @@ name = "nym-topology"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"log",
|
||||
"nym-bin-common",
|
||||
"nym-crypto",
|
||||
@@ -4250,7 +4109,6 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.9.9",
|
||||
"tendermint-rpc",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"url",
|
||||
@@ -4551,12 +4409,11 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
||||
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"hmac 0.12.1",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4783,18 +4640,8 @@ version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"spki 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4913,9 +4760,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.11.9"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd"
|
||||
checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
@@ -4923,9 +4770,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.11.9"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4"
|
||||
checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools",
|
||||
@@ -4936,10 +4783,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.11.9"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13"
|
||||
checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost",
|
||||
]
|
||||
|
||||
@@ -5197,21 +5045,11 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb"
|
||||
dependencies = [
|
||||
"crypto-bigint 0.4.9",
|
||||
"crypto-bigint",
|
||||
"hmac 0.12.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfc6979"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
||||
dependencies = [
|
||||
"hmac 0.12.1",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfd"
|
||||
version = "0.10.0"
|
||||
@@ -5257,7 +5095,18 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ripemd160"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251"
|
||||
dependencies = [
|
||||
"block-buffer 0.9.0",
|
||||
"digest 0.9.0",
|
||||
"opaque-debug 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5469,24 +5318,10 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"der 0.6.1",
|
||||
"base16ct",
|
||||
"der",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.9.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sec1"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"der 0.7.7",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.10.2",
|
||||
"pkcs8",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -5867,7 +5702,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5891,7 +5726,17 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha3"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
|
||||
dependencies = [
|
||||
"digest 0.10.6",
|
||||
"keccak",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5918,17 +5763,7 @@ version = "1.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
@@ -6000,7 +5835,7 @@ dependencies = [
|
||||
"aes 0.7.5",
|
||||
"arrayref",
|
||||
"blake2",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"byteorder",
|
||||
"chacha",
|
||||
"curve25519-dalek",
|
||||
@@ -6037,17 +5872,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.6.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spki"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.7.7",
|
||||
"der",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6357,12 +6182,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle-ng"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
@@ -6692,28 +6511,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0"
|
||||
checksum = "a199518e0366ba0aeb0d0e0a59dbd99ea0bdc14280f414ecc758c9228a454ad8"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"digest 0.10.7",
|
||||
"ed25519 2.2.1",
|
||||
"ed25519-consensus",
|
||||
"ed25519",
|
||||
"ed25519-dalek",
|
||||
"flex-error",
|
||||
"futures",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"ripemd",
|
||||
"ripemd160",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"sha2 0.9.9",
|
||||
"signature",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint-proto",
|
||||
@@ -6723,9 +6542,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-config"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372"
|
||||
checksum = "c6d8f6a64ae3b59ea3c73efad727271ee085b544b817d7f46901817ca6bb1773"
|
||||
dependencies = [
|
||||
"flex-error",
|
||||
"serde",
|
||||
@@ -6737,9 +6556,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-proto"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d"
|
||||
checksum = "1b303d6387aaea38cea7ef924476d1f798573044e7b4f6ddd1166ac5184b2281"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flex-error",
|
||||
@@ -6755,9 +6574,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-rpc"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d119d83a130537fc4a98c3c9eb6899ebe857fea4860400a61675bfb5f0b35129"
|
||||
checksum = "3036f0b65baa11e767dabd22a0663e842b595b0a1903f149b7b8b1e09b2b443d"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
@@ -6770,11 +6589,9 @@ dependencies = [
|
||||
"hyper-rustls",
|
||||
"peg",
|
||||
"pin-project",
|
||||
"semver 1.0.17",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint",
|
||||
"tendermint-config",
|
||||
|
||||
@@ -37,7 +37,7 @@ serde_json = "1.0"
|
||||
serde_repr = "0.1"
|
||||
tap = "1.0.1"
|
||||
tauri = { version = "^1.2.2", features = ["clipboard-write-text", "macos-private-api", "notification-all", "shell-open", "system-tray", "updater", "window-close", "window-minimize", "window-start-dragging"] }
|
||||
#tendermint-rpc = "0.23.0"
|
||||
tendermint-rpc = "0.23.0"
|
||||
thiserror = "1.0"
|
||||
time = { version = "0.3.17", features = ["local-offset"] }
|
||||
tokio = { version = "1.24.1", features = ["sync", "time"] }
|
||||
|
||||
@@ -104,17 +104,16 @@ impl FernExt for fern::Dispatch {
|
||||
}
|
||||
|
||||
fn filter_lowlevel_external_components(self) -> Self {
|
||||
self.level_for("handlebars", log::LevelFilter::Warn)
|
||||
.level_for("hyper", log::LevelFilter::Warn)
|
||||
.level_for("mio", log::LevelFilter::Warn)
|
||||
.level_for("reqwest", log::LevelFilter::Warn)
|
||||
.level_for("rustls", log::LevelFilter::Warn)
|
||||
.level_for("sled", log::LevelFilter::Warn)
|
||||
self.level_for("hyper", log::LevelFilter::Warn)
|
||||
.level_for("tokio_reactor", log::LevelFilter::Warn)
|
||||
.level_for("tokio_tungstenite", log::LevelFilter::Warn)
|
||||
.level_for("tokio_util", log::LevelFilter::Warn)
|
||||
.level_for("tungstenite", log::LevelFilter::Warn)
|
||||
.level_for("reqwest", log::LevelFilter::Warn)
|
||||
.level_for("mio", log::LevelFilter::Warn)
|
||||
.level_for("want", log::LevelFilter::Warn)
|
||||
.level_for("sled", log::LevelFilter::Warn)
|
||||
.level_for("tungstenite", log::LevelFilter::Warn)
|
||||
.level_for("tokio_tungstenite", log::LevelFilter::Warn)
|
||||
.level_for("rustls", log::LevelFilter::Warn)
|
||||
.level_for("tokio_util", log::LevelFilter::Warn)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ fn main() {
|
||||
crate::operations::connection::status::get_gateway_connection_status,
|
||||
crate::operations::connection::status::start_connection_health_check_task,
|
||||
crate::operations::directory::get_services,
|
||||
crate::operations::directory::get_gateways,
|
||||
crate::operations::directory::get_gateways_detailed,
|
||||
crate::operations::export::export_keys,
|
||||
crate::operations::window::hide_window,
|
||||
crate::operations::growth::test_and_earn::growth_tne_get_client_id,
|
||||
|
||||
@@ -86,6 +86,7 @@ pub struct DirectoryService {
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct HarbourMasterService {
|
||||
pub service_provider_client_id: String,
|
||||
pub gateway_identity_key: String,
|
||||
pub ip_address: String,
|
||||
pub last_successful_ping_utc: String,
|
||||
pub last_updated_utc: String,
|
||||
@@ -97,9 +98,11 @@ pub struct HarbourMasterService {
|
||||
pub struct DirectoryServiceProvider {
|
||||
pub id: String,
|
||||
pub description: String,
|
||||
/// Address of the network requester in the form "<client_id>.<client_enc>@<gateway_id>"
|
||||
/// Address of the network requester in the form "<gateway_id>.<service_provider_id>"
|
||||
/// e.g. DpB3cHAchJiNBQi5FrZx2csXb1mrHkpYh9Wzf8Rjsuko.ANNWrvHqMYuertHGHUrZdBntQhpzfbWekB39qez9U2Vx@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh
|
||||
pub address: String,
|
||||
/// Address of the gateway, e.g. 2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh
|
||||
pub gateway: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
@@ -109,9 +112,3 @@ pub struct PagedResult<T> {
|
||||
pub total: i32,
|
||||
pub items: Vec<T>,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct Gateway {
|
||||
pub identity: String,
|
||||
}
|
||||
|
||||
@@ -11,15 +11,15 @@ pub async fn run_health_check() -> bool {
|
||||
log::info!("Running network health check");
|
||||
match crate::operations::http::socks5_get::<_, ConnectionSuccess>(HEALTH_CHECK_URL).await {
|
||||
Ok(res) if res.status == "ok" => {
|
||||
log::info!("✅✅✅ Healthcheck success!");
|
||||
log::info!("Healthcheck success!");
|
||||
true
|
||||
}
|
||||
Ok(res) => {
|
||||
log::error!("⛔⛔⛔ Healthcheck failed with status: {}", res.status);
|
||||
log::error!("Healthcheck failed with status: {}", res.status);
|
||||
false
|
||||
}
|
||||
Err(err) => {
|
||||
log::error!("⛔⛔⛔ Healthcheck failed: {err}");
|
||||
log::error!("Healthcheck failed: {err}");
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
use crate::{
|
||||
config::PrivacyLevel,
|
||||
error::Result,
|
||||
models::{
|
||||
DirectoryService, DirectoryServiceProvider, Gateway, HarbourMasterService, PagedResult,
|
||||
},
|
||||
state::State,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::config::PrivacyLevel;
|
||||
use crate::error::Result;
|
||||
use crate::models::{
|
||||
DirectoryService, DirectoryServiceProvider, HarbourMasterService, PagedResult,
|
||||
};
|
||||
use crate::state::State;
|
||||
use nym_api_requests::models::GatewayBondAnnotated;
|
||||
use nym_contracts_common::types::Percent;
|
||||
use std::sync::Arc;
|
||||
@@ -19,39 +18,26 @@ static SERVICE_PROVIDER_WELLKNOWN_URL: &str =
|
||||
static SERVICE_PROVIDER_WELLKNOWN_URL_MEDIUM: &str =
|
||||
"https://nymtech.net/.wellknown/connect/service-providers-medium.json";
|
||||
|
||||
// Harbour master is used to periodically keep track of which network-requesters are online
|
||||
static HARBOUR_MASTER_URL: &str = "https://harbourmaster.nymtech.net/v1/services/?size=100";
|
||||
|
||||
// We only consider network requesters with a routing score above this threshold
|
||||
const SERVICE_ROUTING_SCORE_THRESHOLD: f32 = 0.9;
|
||||
|
||||
static GATEWAYS_DETAILED_URL: &str =
|
||||
"https://validator.nymtech.net/api/v1/status/gateways/detailed";
|
||||
|
||||
// Only use gateways with a performnnce score above this
|
||||
const GATEWAY_PERFORMANCE_SCORE_THRESHOLD: u64 = 90;
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_services(
|
||||
state: tauri::State<'_, Arc<RwLock<State>>>,
|
||||
) -> Result<Vec<DirectoryServiceProvider>> {
|
||||
log::trace!("Fetching services");
|
||||
|
||||
let guard = state.read().await;
|
||||
let privacy_level = guard.get_user_data().privacy_level.unwrap_or_default();
|
||||
|
||||
log::trace!("Fetching services");
|
||||
let all_services_with_category = fetch_services(&privacy_level).await?;
|
||||
log::trace!("Received: {:#?}", all_services_with_category);
|
||||
|
||||
// Flatten all services into a single vector (get rid of categories)
|
||||
// We currently don't care about categories, but we might in the future...
|
||||
let all_services = all_services_with_category
|
||||
.into_iter()
|
||||
.flat_map(|sp| sp.items)
|
||||
.collect_vec();
|
||||
let all_services = fetch_services(&privacy_level).await?;
|
||||
log::trace!("Received: {:#?}", all_services);
|
||||
|
||||
// Early return if we're running with medium toggle enabled
|
||||
if let PrivacyLevel::Medium = privacy_level {
|
||||
return Ok(all_services);
|
||||
return Ok(all_services.into_iter().flat_map(|sp| sp.items).collect());
|
||||
}
|
||||
|
||||
// TODO: get paged
|
||||
@@ -59,23 +45,61 @@ pub async fn get_services(
|
||||
let active_services = fetch_active_services().await?;
|
||||
log::trace!("Active: {:#?}", active_services);
|
||||
|
||||
if active_services.items.is_empty() {
|
||||
log::warn!("No active services found! Using all services instead as fallback");
|
||||
return Ok(all_services);
|
||||
let filtered_services = filter_out_inactive(all_services, active_services);
|
||||
|
||||
log::trace!("Fetching gateways");
|
||||
let gateway_res = get_gateways_detailed().await?;
|
||||
log::trace!("Received: {:#?}", gateway_res);
|
||||
|
||||
// Use only services that are active AND have a performance of >= 90%
|
||||
let filtered_services_with_good_gateway =
|
||||
filter_out_poor_gateways(filtered_services, gateway_res);
|
||||
|
||||
Ok(filtered_services_with_good_gateway)
|
||||
}
|
||||
|
||||
fn filter_out_inactive(
|
||||
services_res: Vec<DirectoryService>,
|
||||
active_services: PagedResult<HarbourMasterService>,
|
||||
) -> Vec<DirectoryService> {
|
||||
let mut filtered: Vec<DirectoryService> = vec![];
|
||||
for service_type in &services_res {
|
||||
let items = service_type
|
||||
.items
|
||||
.clone()
|
||||
.into_iter()
|
||||
.filter(|sp| {
|
||||
active_services
|
||||
.items
|
||||
.iter()
|
||||
.any(|active| active.service_provider_client_id == sp.address)
|
||||
})
|
||||
.collect_vec();
|
||||
log::trace!("service = {} has {} items", service_type.id, items.len());
|
||||
filtered.push(DirectoryService {
|
||||
id: service_type.id.clone(),
|
||||
description: service_type.description.clone(),
|
||||
items,
|
||||
})
|
||||
}
|
||||
filtered
|
||||
}
|
||||
|
||||
log::trace!("Filter out inactive");
|
||||
let filtered_services = filter_out_inactive_services(&all_services, active_services);
|
||||
log::trace!("After filtering: {:#?}", filtered_services);
|
||||
|
||||
if filtered_services.is_empty() {
|
||||
log::warn!(
|
||||
"After filtering, no active services found! Using all services instead as fallback"
|
||||
);
|
||||
return Ok(all_services);
|
||||
}
|
||||
|
||||
Ok(filtered_services)
|
||||
fn filter_out_poor_gateways(
|
||||
services: Vec<DirectoryService>,
|
||||
gateway_res: Vec<GatewayBondAnnotated>,
|
||||
) -> Vec<DirectoryServiceProvider> {
|
||||
let perf_threshold = Percent::from_percentage_value(90).unwrap();
|
||||
services
|
||||
.into_iter()
|
||||
.flat_map(|sp| sp.items)
|
||||
.filter(|sp| {
|
||||
gateway_res.iter().any(|gateway| {
|
||||
gateway.gateway_bond.gateway.identity_key == sp.gateway
|
||||
&& gateway.performance >= perf_threshold
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
async fn fetch_services(privacy_level: &PrivacyLevel) -> Result<Vec<DirectoryService>> {
|
||||
@@ -99,56 +123,11 @@ async fn fetch_active_services() -> Result<PagedResult<HarbourMasterService>> {
|
||||
Ok(active_services)
|
||||
}
|
||||
|
||||
fn filter_out_inactive_services(
|
||||
all_services: &[DirectoryServiceProvider],
|
||||
active_services: PagedResult<HarbourMasterService>,
|
||||
) -> Vec<DirectoryServiceProvider> {
|
||||
all_services
|
||||
.iter()
|
||||
.filter(|sp| {
|
||||
active_services.items.iter().any(|active| {
|
||||
active.service_provider_client_id == sp.address
|
||||
&& active.routing_score > SERVICE_ROUTING_SCORE_THRESHOLD
|
||||
})
|
||||
})
|
||||
.cloned()
|
||||
.collect()
|
||||
}
|
||||
|
||||
async fn fetch_gateways() -> Result<Vec<GatewayBondAnnotated>> {
|
||||
Ok(reqwest::get(GATEWAYS_DETAILED_URL)
|
||||
#[tauri::command]
|
||||
pub async fn get_gateways_detailed() -> Result<Vec<GatewayBondAnnotated>> {
|
||||
let res = reqwest::get(GATEWAYS_DETAILED_URL)
|
||||
.await?
|
||||
.json::<Vec<GatewayBondAnnotated>>()
|
||||
.await?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_gateways() -> Result<Vec<Gateway>> {
|
||||
log::trace!("Fetching gateways");
|
||||
let all_gateways = fetch_gateways().await?;
|
||||
log::trace!("Received: {:#?}", all_gateways);
|
||||
|
||||
let filtered_gateways = all_gateways
|
||||
.iter()
|
||||
.filter(|g| {
|
||||
g.node_performance.most_recent
|
||||
> Percent::from_percentage_value(GATEWAY_PERFORMANCE_SCORE_THRESHOLD).unwrap()
|
||||
})
|
||||
.map(|g| Gateway {
|
||||
identity: g.identity().clone(),
|
||||
})
|
||||
.collect_vec();
|
||||
log::trace!("Filtered: {:#?}", filtered_gateways);
|
||||
|
||||
if filtered_gateways.is_empty() {
|
||||
log::warn!("No gateways with high enough performance score found! Using all gateways instead as fallback");
|
||||
return Ok(all_gateways
|
||||
.iter()
|
||||
.map(|g| Gateway {
|
||||
identity: g.identity().clone(),
|
||||
})
|
||||
.collect_vec());
|
||||
}
|
||||
|
||||
Ok(filtered_gateways)
|
||||
.await?;
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Box, CircularProgress, Stack, Tooltip, Typography } from '@mui/material
|
||||
import { DateTime } from 'luxon';
|
||||
import { ErrorOutline, InfoOutlined } from '@mui/icons-material';
|
||||
import { ConnectionStatusKind, GatewayPerformance } from '../types';
|
||||
import { ServiceProvider, Gateway } from '../types/directory';
|
||||
import { ServiceProvider } from '../types/directory';
|
||||
import { GatwayWarningInfo, ServiceProviderInfo } from './TooltipInfo';
|
||||
import { useClientContext } from '../context/main';
|
||||
|
||||
@@ -14,9 +14,8 @@ const FONT_STYLE = 'normal';
|
||||
const ConnectionStatusContent: FCWithChildren<{
|
||||
status: ConnectionStatusKind;
|
||||
serviceProvider?: ServiceProvider;
|
||||
gateway?: Gateway;
|
||||
gatewayError: boolean;
|
||||
}> = ({ status, serviceProvider, gateway, gatewayError }) => {
|
||||
}> = ({ status, serviceProvider, gatewayError }) => {
|
||||
const { userData } = useClientContext();
|
||||
|
||||
if (gatewayError) {
|
||||
@@ -42,13 +41,7 @@ const ConnectionStatusContent: FCWithChildren<{
|
||||
case 'connected':
|
||||
return (
|
||||
<>
|
||||
<Tooltip
|
||||
title={
|
||||
serviceProvider && gateway ? (
|
||||
<ServiceProviderInfo serviceProvider={serviceProvider} gateway={gateway} />
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
<Tooltip title={serviceProvider ? <ServiceProviderInfo serviceProvider={serviceProvider} /> : undefined}>
|
||||
<Box display="flex" alignItems="center" gap={0.5} justifyContent="center" sx={{ cursor: 'pointer' }}>
|
||||
<InfoOutlined sx={{ fontSize: 14 }} />
|
||||
<Typography fontWeight={FONT_WEIGHT} fontStyle={FONT_STYLE} fontSize={FONT_SIZE} textAlign="center">
|
||||
@@ -100,8 +93,7 @@ export const ConnectionStatus: FCWithChildren<{
|
||||
gatewayPerformance?: GatewayPerformance;
|
||||
connectedSince?: DateTime;
|
||||
serviceProvider?: ServiceProvider;
|
||||
gateway?: Gateway;
|
||||
}> = ({ status, serviceProvider, gateway, gatewayPerformance }) => {
|
||||
}> = ({ status, serviceProvider, gatewayPerformance }) => {
|
||||
const color = status === 'connected' || status === 'disconnecting' ? '#21D072' : 'white';
|
||||
|
||||
return (
|
||||
@@ -109,7 +101,6 @@ export const ConnectionStatus: FCWithChildren<{
|
||||
<ConnectionStatusContent
|
||||
status={status}
|
||||
serviceProvider={serviceProvider}
|
||||
gateway={gateway}
|
||||
gatewayError={gatewayPerformance !== 'Good'}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
import * as React from 'react';
|
||||
import { ComponentMeta } from '@storybook/react';
|
||||
import { Box } from '@mui/material';
|
||||
import { ServiceProviderSelector } from './ServiceProviderSelector';
|
||||
import { Services } from '../types/directory';
|
||||
|
||||
export default {
|
||||
title: 'Components/Service Provider Selector',
|
||||
component: ServiceProviderSelector,
|
||||
} as ComponentMeta<typeof ServiceProviderSelector>;
|
||||
|
||||
const width = 240;
|
||||
|
||||
export const Loading = () => (
|
||||
<Box width={width}>
|
||||
<ServiceProviderSelector />
|
||||
</Box>
|
||||
);
|
||||
|
||||
const services: Services = JSON.parse(`[
|
||||
{
|
||||
"id": "keybase",
|
||||
"description": "Keybase",
|
||||
"items": [
|
||||
{
|
||||
"id": "nym-keybase",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "Entztfv6Uaz2hpYHQJ6JKoaCTpDL5dja18SuQWVJAmmx.Cvhn9rBJw5Ay9wgHcbgCnVg89MPSV5s2muPV2YF1BXYu@Fo4f4SQLdoyoGkFae5TpVhRVoXCF8UiypLVGtGjujVPf",
|
||||
"gateway": "Fo4f4SQLdoyoGkFae5TpVhRVoXCF8UiypLVGtGjujVPf"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-1",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "D55ksecHzY6vAeqk8MCTzCfj2pqwJeKCKZCUUGnwGnn3.FS42vXS5a6GNTb1qk3aVk5mjSiJCAuawbBVyQZZVfhvt@DfNMqQRy6pPkU8Z5rBsxRwzDUzAMXHPFwMhjF16ScZqn",
|
||||
"gateway": "DfNMqQRy6pPkU8Z5rBsxRwzDUzAMXHPFwMhjF16ScZqn"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-2",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "DFdDtW7LNBATxQ4ef3jNbqs3cRE8b9wDZTCctHCQRULa.4AbKiTNVUwYFWHhy98o5pT9dELiUrkXoJQ9wHqPgf6GV@GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN",
|
||||
"gateway": "GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-3",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "6Y1HE1jJ92P9yoHer11TR4A2NdZePrLGaBNFf65MnYGe.FwXoh217odQDWNmViqzNX28fauYrjB3PYLrVvpqnQrX4@5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz",
|
||||
"gateway": "5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-4",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "3zzhLtWvaJgn755MkRckG5aRnoTZich8ASn395iSsTgj.J1R5VuxXbh2eNHiaRbrwbKGXrrEQcHKLdzf8eg9HTB6q@3B7PsbXFuqq6rerYFLw5HPbQb4UmBqAhfWURRovMmWoj",
|
||||
"gateway": "3B7PsbXFuqq6rerYFLw5HPbQb4UmBqAhfWURRovMmWoj"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-5",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "CHuXdZJYQ8xH7ekgN9gAuVtQ7ZikjjHEZY5BSN7yc5mN.29dFvqicKQQQvoX1vup44mspmc249RH5xgLibWMwTYGT@CfWcDJq8QBz6cVAPCYSaLbaJEhVTmHEmyYgQ6C5GdDW9",
|
||||
"gateway": "CfWcDJq8QBz6cVAPCYSaLbaJEhVTmHEmyYgQ6C5GdDW9"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "electrum",
|
||||
"description": "Electrum Wallet",
|
||||
"items": [
|
||||
{
|
||||
"id": "nym-electrum",
|
||||
"description": "Nym Electrum Service Provider",
|
||||
"address": "DpB3cHAchJiNBQi5FrZx2csXb1mrHkpYh9Wzf8Rjsuko.ANNWrvHqMYuertHGHUrZdBntQhpzfbWekB39qez9U2Vx@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh",
|
||||
"gateway": "2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-electrum-1",
|
||||
"description": "Nym Electrum Service Provider",
|
||||
"address": "8Tb73cFQpXCLpgxEA2VSDru2hHrcZ3KQcyMsGbxcTjBp.4x5tu66k8YkHk4tYac1qwEFbNq5WsKiX5kR51q5KKH88@4WgKhJdmUffz4e1o1ftVAGS3HnG56LiNAxA9dmaekrVd",
|
||||
"gateway": "4WgKhJdmUffz4e1o1ftVAGS3HnG56LiNAxA9dmaekrVd"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-electrum-2",
|
||||
"description": "Nym Electrum Service Provider",
|
||||
"address": "GR6z31MwCsvxHrnvvVN1Cpasd8aQ1giwQqPTZM9dN7VH.5rEiqakSPDrBtKmvpU8Shnhz6gRM85JLoB7AX4h7PJYr@5Ao1J38frnU9Rx5YVeF5BWExcnDTcW8etNe9W2sRASXD",
|
||||
"gateway": "5Ao1J38frnU9Rx5YVeF5BWExcnDTcW8etNe9W2sRASXD"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "telegram",
|
||||
"description": "Telegram",
|
||||
"items": [
|
||||
{
|
||||
"id": "shipyard-telegram-2",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "C4w6ewbQtoaZEeoaaNw1xVASChqo4WVjNfuYEUFjZxpc.8F1D7rQXf2jGoj1Ken7PiGDM8HS2Ug79wSoc9nZ1iqh1@62F81C9GrHDRja9WCqozemRFSzFPMecY85MbGwn6efve",
|
||||
"gateway": "62F81C9GrHDRja9WCqozemRFSzFPMecY85MbGwn6efve"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-3",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "DStL3BEUZuQZfbij1KAY3BvJh8rC5jpr9mc6AQ6aTLUu.Ax9foYaKfFgX6g8y393GoNpKkKrnDGFGRZwxDv9R7X6M@FQon7UwF5knbUr2jf6jHhmNLbJnMreck1eUcVH59kxYE",
|
||||
"gateway": "FQon7UwF5knbUr2jf6jHhmNLbJnMreck1eUcVH59kxYE"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-4",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "8gRdGTzsDxYzpasRQhsRg59MCgNNhnfag2oFfwwZPXnB.DtDrGz7ScVm4o7sN4K3CYUJveYgz7fcXELBVLNDfMS9Y@3ojQD6V7skM1bSXJX7fVQvscjmcgptzdixQEaAha2ixh",
|
||||
"gateway": "3ojQD6V7skM1bSXJX7fVQvscjmcgptzdixQEaAha2ixh"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-5",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "AR3oEM6Uvmfs6fyddwSehoBUKCFxz7MdFi4z7aahuHuY.3ZKapg9A3Py1PXhyLbCJr8ZbJsEV6NZdN1WJaGGut5tj@EEyq16v63aotPBCepxUpCgAojrNasZ6Hk1PjpRyBAdEp",
|
||||
"gateway": "EEyq16v63aotPBCepxUpCgAojrNasZ6Hk1PjpRyBAdEp"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-6",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "7n1BYhsXSwcr8Qim8AqZTAodqFia4QG6T7CRc1ihQHpv.7o4trpGqu2LHMUiXc3dddgfGET1CFFcAK9gKYoHoSn5e@BTZNB3bkkEePsT14GN8ofVtM1SJae4YLWjpBerrKYfr",
|
||||
"gateway": "BTZNB3bkkEePsT14GN8ofVtM1SJae4YLWjpBerrKYfr"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-7",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "Gv4TWhUKrvJfqh1jBRPGEQrikNZvZse2kS3ZgN9Z2nAZ.7KGPaaqUEum2C59jLvw7f8Ug8a48YuZdjjZu3t4JES4U@C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi",
|
||||
"gateway": "C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-8",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "8Mqgp12cpF6FSXMeqzxgFgQXvTSapyNqGAi5wy7ub4ge.7z7PDsiJGiGxGz4p77v5L5fZhXBJ5qNZ8CgJwYNr6H6J",
|
||||
"gateway": "3zd3wrCK8Dz5TXrcvk5dG5s9EEdf4Ck1v9VgBPMMFVkR"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-9",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "F3N5eiPDZcGFC985Go4Mpv8p9uxFD1L3jRUdrLCbrZLm.EyTxWwwTwYpPrJBmc97GLd1LpUAphjptS5y1ed182bGk@GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ",
|
||||
"gateway": "GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-10",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "G7y7e1nVBr8fmQSzdeAxXnCmmmJb5k8N3E8LBV31KE5g.GRRUCj6t6cCUUjakmTWzidMLiYA7EdCedKnup8osaBC6@AJad2R9virYEYXEsTcicN5y5tyPoixrhhAGsxoESZVnc",
|
||||
"gateway": "AJad2R9virYEYXEsTcicN5y5tyPoixrhhAGsxoESZVnc"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-11",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "2kq9Z7RyDZtb8kxXjyP3ZT8VMWHg6JXFDChGuuNBk7Hw.F5XYbBaGSoF8qAo8faPcaNRPHEq3Y25BDcwESeabUS9S@HaLyPQrhBTq75dnGeBUdYWeFVA2BBn39MgkhEt3VTMMM",
|
||||
"gateway": "HaLyPQrhBTq75dnGeBUdYWeFVA2BBn39MgkhEt3VTMMM"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-12",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "GegdtpNzYj4QCgpih9Kxv7ZVZxmVdxYHsDkiPsbT71XG.E8xtE8mrapjzFtyuziZSrsScAKhwZMH5wNpKWtKfzJ5Y@9Byd9VAtyYMnbVAcqdoQxJnq76XEg2dbxbiF5Aa5Jj9J",
|
||||
"gateway": "9Byd9VAtyYMnbVAcqdoQxJnq76XEg2dbxbiF5Aa5Jj9J"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-13",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "4SsrDQeEtG3mpeD9nN5CDdGaCsxFvNeYMhoviDzNNB9f.GyqG6iK5rBvhe3HXLR11m6ULpf13ATgYvkkidLmteDLs@5EpkkrMFYAM3XcaztXnZwBWquURHSKsyc9JxUCengDFS",
|
||||
"gateway": "5EpkkrMFYAM3XcaztXnZwBWquURHSKsyc9JxUCengDFS"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-14",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "9JoHRu2RrSD1fjbj9NSTASgjv9Szep7Nhd9L2PywxbBi.AZhAUDNX6iH8BqXyR5c7TJuzpwMEvDXrabNLGuRukvVf@9xJM74FwwHhEKKJHihD21QSZnHM2QBRMoFx9Wst6qNBS",
|
||||
"gateway": "9xJM74FwwHhEKKJHihD21QSZnHM2QBRMoFx9Wst6qNBS"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-15",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "3K174ijjXqCkhMDT9xLcqjS4MXk2QsqZt4PdgNcuUrnn.BNnHnQmWoj6Uo6kkS1QkPqsdHaXrcwyR9F6MnnzDkZJL@C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi",
|
||||
"gateway": "C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-16",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "BqX5Q3MEcbTnM39hUswQchLW68SrqbhL8K5ucrLmtP39.AWrVsFoVC9s6KjdpcasATmZPA3GtMsUxcfHpAkuNdtFG@Emswx6KXyjRfq1c2k4d4uD2e6nBSbH1biorCZUei8UNS",
|
||||
"gateway": "Emswx6KXyjRfq1c2k4d4uD2e6nBSbH1biorCZUei8UNS"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-17",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "2tQxccgcqdkuUvLqgiEkEN4rNRZ5QknygnKAFcS4gfoe.EVrY5q5sqDqBUbS3wHsRRZhk2MAw1S17hNoH1Bicyv7n@DAGQxdxwAkwjaLjTw1B9vndia4YyFD15qRgcTQxrmkom",
|
||||
"gateway": "DAGQxdxwAkwjaLjTw1B9vndia4YyFD15qRgcTQxrmkom"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-18",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "8YG1rcEauJA814Nd7hSxjNe2UrRwrGsrXTm1Cmd3gRrU.FxYaYqpNN8PciNsySs3zYPrTB1J8AYUu9DBsM2vVDDfF@7EfEESLo71GUvx3UEW79LgTegHUBPUocUzGyJVv6LHog",
|
||||
"gateway": "7EfEESLo71GUvx3UEW79LgTegHUBPUocUzGyJVv6LHog"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-19",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "HPiXADVFLwLQPNpPtyYefzvYntC6tp9UJ5fJZGfkqvDt.2EUUxmeT3AiaUzAcE5SyXRAk8a2JXBkRz4B8McSdkrST@9ACTkYraCqE9jMb6zb6ne8EDQGGhZw5ykNiq9YRUdHTD",
|
||||
"gateway": "9ACTkYraCqE9jMb6zb6ne8EDQGGhZw5ykNiq9YRUdHTD"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-20",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "2QLnEEnTmf2NRWtcQPWBeRcg7Hej5WSPWRWwtTpEEZWF.BheS78ozc8ngvhsXNNnshdJzpoYsmEvhfn3WKUYF5dRU@C2uyokSPoxhku9GexRxEo1e8KPZ7q6e8FXmK3gtY8kkF",
|
||||
"gateway": "C2uyokSPoxhku9GexRxEo1e8KPZ7q6e8FXmK3gtY8kkF"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-21",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "FuBbnwiANfaXZnn683jBapK5XVm5ttgZSykU3vqPSHoD.94MFGv1VcBLTkRwzBDQUkWjvqtZYVBrJg2Q8JGbizcib@CTqYPY8htdAQMXCzRW9SjZzZuqYwSt2iUh6HPaNgmTvK",
|
||||
"gateway": "CTqYPY8htdAQMXCzRW9SjZzZuqYwSt2iUh6HPaNgmTvK"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-22",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "9EbQx5jQznSVbftFom7sqUSHAACrsfvMhrzhaFt4A3SZ.D1FQCirL4YKwfcmtMGvB5Rugt5sAzGEhdSjJ3bHVQRZ@7Zh1Sz5dXpA6s53CbtcdqhQhLqwf4cLynL7KqHKcjrG4",
|
||||
"gateway": "7Zh1Sz5dXpA6s53CbtcdqhQhLqwf4cLynL7KqHKcjrG4"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-24",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "6Umawwvf551VyB3Ko46NgKLqJdTFJeToCM67mrTmM3G.3A4sesBac4KGuMTFjvYBwLpksMJvbMbteGJQgmm4PV4Y@AnnYnEtBjB2a5sHmeRCnBq43qxyHDf95Bqd7cwQyKNLR",
|
||||
"gateway": "AnnYnEtBjB2a5sHmeRCnBq43qxyHDf95Bqd7cwQyKNLR"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-25",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "CDtxTeoyqq83JpV9G8cR5HRHRdMMaVspQsCwH3Qnajt3.F5EHK9HFcdGrE2hqA7bK9AUmkbihujYDhtNNqHKxW765@BDkeNx7JQm5NsQakst9s8htogZXhpTQedFAgZpvsGCqH",
|
||||
"gateway": "BDkeNx7JQm5NsQakst9s8htogZXhpTQedFAgZpvsGCqH"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-26",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "HukZkLG2DoarQEqaoDLuqW1GFf2NSHDUMGBZiyJGRYJD.9GyU8wPsyzcvRjcyk8hiNpTJbXCmq5F3VoVhFBZYuHR3@GsGEZiDBz8SWfHGaK5SDmhfbTEM55v37WCYYcT9wTSxN",
|
||||
"gateway": "GsGEZiDBz8SWfHGaK5SDmhfbTEM55v37WCYYcT9wTSxN"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-27",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "773y8iMVJiRk4dRbjQzkJVbrei4TwkePNE5WTEttt77d.3Mw47C9XZj3oAzk1iSqC5Y36tbBsjtaTtdgaHM3Zsdma@7fiZtNL1RACQTwGrKLBT9nbY77bfwZnX9rqcWqc53qgv",
|
||||
"gateway": "7fiZtNL1RACQTwGrKLBT9nbY77bfwZnX9rqcWqc53qgv"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-28",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "6jQJEorCu7YiP9HdDaMeHxcNhxeNmZ1kpd836GnqLZX.HsJqEmNTszGecsKqFB37i84nBXxqf4ETgrKmKmBvMGHC@FYnDMQzT49ZGM23gVqpTxfih14V6wuedNXirekmt37zE",
|
||||
"gateway": "FYnDMQzT49ZGM23gVqpTxfih14V6wuedNXirekmt37zE"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-29",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "BiCSyovpFMuSnTvF2TdiuZwrytXDrd9AH47ZMcCxscVC.G9YpdicA9BBNoVHDgjWjgt17wv5WYKWcbE3vPJJVpSJD@GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ",
|
||||
"gateway":"GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-30",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "AQRRAs9oc8QWXAFBs44YhCKUny7AyLsfLy91pwmGgxuf.CWUKoKA1afSKyw5BnFJJg19UDgnaVATupsFhQpyTEBHJ@EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w",
|
||||
"gateway": "EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-31",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "6YqjAZK3Pr1ngiBLcDkotboB5WiN6k6NPpbXvShH4pR5.9Ss6VW3Xbyi8LuxduNNwnXEv9njHCQ2PLSP1UK6tsoa5@42XCK9dMS9m5XJLzQd2dBuwimk6ndZnczhZaV5VPFkQD",
|
||||
"gateway": "42XCK9dMS9m5XJLzQd2dBuwimk6ndZnczhZaV5VPFkQD"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-32",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "EmYWLeybmj86Vzr62vxuZ3T15jwMNHggzK7sQwid96yp.GyaF9WprSr56cxUdGf5TpcUvAjb2VbAr8CVBrmBUYAaw@GL5wESoz4oSbpBaTki9qB9213FGUQXCiRjbzDkhWwoBC",
|
||||
"gateway": "GL5wESoz4oSbpBaTki9qB9213FGUQXCiRjbzDkhWwoBC"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-33",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "4PDb96cck5btTj6G7rsomqwHJsp4qu8uPvFCbwHfjFUx.C5dKbaoakH7egsZvAueRbwLFbmxnQaVMeSr6QTMpuBAA@58ceEFaLJh6zAo3cirzT1BDQm7D3L5acnQrxGH1D6TAY",
|
||||
"gateway": "58ceEFaLJh6zAo3cirzT1BDQm7D3L5acnQrxGH1D6TAY"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-34",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "BeZbeMf9vcpUf368qDd85dtLwXLj4Ee5bsHMB2fUD8uX.HELVbppkwU1jmzUAUrCEbHeJfVciSeo8VGAkbJSpwxsb@ADdHkiTfkpsSt31zVToWW9j3KikH24aLAAwDKtCYE5jY",
|
||||
"gateway":"ADdHkiTfkpsSt31zVToWW9j3KikH24aLAAwDKtCYE5jY"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-35",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "Bp4JRFyf7GB9L9J95AqMPnz9zbGmPnViA5fDXKeNraLJ.D6CTdcjJVxDmH2UQvzXuPWg9Se9xXYe76uDMypXvhzd7@6UjGEeQZK14C5K2kenycTkqt7qRjEHGLgaQx3FWySo3N",
|
||||
"gateway": "6UjGEeQZK14C5K2kenycTkqt7qRjEHGLgaQx3FWySo3N"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-36",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "91h7io6BGhVjbtC7dbbRcScyTJcTfnMsTQZ6aWMVsrWR.Epb4hANXCp8cGEY3wSgawux991ti9Z5Y1FHTMzAKFa6E@DF4TE7V8kJkttMvnoSVGnRFFRt6WYGxxiC2w1XyPQnHe",
|
||||
"gateway": "DF4TE7V8kJkttMvnoSVGnRFFRt6WYGxxiC2w1XyPQnHe"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-37",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "Cy2wuwKpWZ3iWzKU3ZWL1qqcVfJ5Cq85dU7UHVWwv2gc.9AhC9b2zVcLnXLGriMdxjpsWJpq6iAdCavDi63udbL89@678qVUJ21uwxZBhp3r56z7GRf6gMh3NYDHruTegPtgMf",
|
||||
"gateway": "678qVUJ21uwxZBhp3r56z7GRf6gMh3NYDHruTegPtgMf"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-38",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "GgUeUWW1NRSuquZYeZf3WkppE92EQUHJrFjNZtYU1jow.CSEjwrRi4f4uyw7N6L2LPKw2tB8spcMbFu99wHZzFZSj@77TSuVU8d1oXKbPzjec2xh4i3Wj5WwUyy9Lr36sm8gZm",
|
||||
"gateway": "77TSuVU8d1oXKbPzjec2xh4i3Wj5WwUyy9Lr36sm8gZm"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-39",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "kz4zWwSkYiQxqxXFPNcGUByTPQWXascD9RfYsmSxY7n.ajp3SjbBVBjrU9nXpSQXAXzbb6EHJJyhbY6cc1ajayx@BTZNB3bkkEePsT14GN8ofVtM1SJae4YLWjpBerrKYf",
|
||||
"gateway": "HyS2UZtZX3kQXdazbdE99DhCjBXjbG61LC9QsmXwbxrU"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "blockstream",
|
||||
"description": "Blockstream Green",
|
||||
"items": [
|
||||
{
|
||||
"id": "nym-blockstream",
|
||||
"description": "Nym Blockstream Green Service Provider",
|
||||
"address": "GiRjFWrMxt58pEMuusm4yT3RxoMD1MMPrR9M2N4VWRJP.3CNZBPq4vg7v7qozjGjdPMXcvDmkbWPCgbGCjQVw9n6Z@2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW",
|
||||
"gateway": "2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW"
|
||||
}
|
||||
]
|
||||
}
|
||||
]`);
|
||||
export const Loaded = () => (
|
||||
<Box width={width}>
|
||||
<ServiceProviderSelector services={services} />
|
||||
</Box>
|
||||
);
|
||||
|
||||
export const ServiceAlreadySelected = () => (
|
||||
<Box width={width}>
|
||||
<ServiceProviderSelector
|
||||
services={services}
|
||||
currentSp={services[2].items[2]}
|
||||
onChange={(serviceProvider) => console.log('New service provider selected: ', serviceProvider)}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
@@ -0,0 +1,147 @@
|
||||
import React, { useEffect, useMemo } from 'react';
|
||||
import { Box, CircularProgress, MenuItem, Stack, TextField, Tooltip, Typography } from '@mui/material';
|
||||
import { Service, ServiceProvider, Services } from '../types/directory';
|
||||
import { useTauriEvents } from '../utils';
|
||||
|
||||
type ServiceWithRandomSp = {
|
||||
id: string;
|
||||
description: string;
|
||||
sp: ServiceProvider;
|
||||
};
|
||||
|
||||
const defaultServiceValue = { id: '', description: '', items: [] };
|
||||
|
||||
export const ServiceProviderSelector: FCWithChildren<{
|
||||
onChange?: (serviceProvider?: ServiceProvider) => void;
|
||||
services?: Services;
|
||||
currentSp?: ServiceProvider;
|
||||
}> = ({ services, currentSp, onChange }) => {
|
||||
const [service, setService] = React.useState<Service>(defaultServiceValue);
|
||||
const [serviceProvider, setServiceProvider] = React.useState<ServiceProvider | undefined>(currentSp);
|
||||
const [resetTrigger, setResetTrigger] = React.useState(new Date().toISOString());
|
||||
|
||||
const handleSelectSp = (newServiceProvider?: ServiceProvider) => {
|
||||
if (newServiceProvider && newServiceProvider !== currentSp) {
|
||||
setServiceProvider(newServiceProvider);
|
||||
onChange?.(newServiceProvider);
|
||||
}
|
||||
};
|
||||
|
||||
// when the user clears local storage, reset the selector
|
||||
useTauriEvents('help://clear-storage', () => {
|
||||
setService(defaultServiceValue);
|
||||
setServiceProvider(undefined);
|
||||
onChange?.(undefined);
|
||||
setResetTrigger(new Date().toISOString());
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!serviceProvider && currentSp) {
|
||||
setServiceProvider(currentSp);
|
||||
}
|
||||
}, [currentSp]);
|
||||
|
||||
useEffect(() => {
|
||||
if (services && serviceProvider) {
|
||||
// retrieve the service corresponding to this service provider
|
||||
|
||||
const match = services.find((s) =>
|
||||
s.items.some(
|
||||
({ id, address, gateway }) =>
|
||||
id === serviceProvider.id && address === serviceProvider.address && gateway === serviceProvider.gateway,
|
||||
),
|
||||
);
|
||||
|
||||
if (match) {
|
||||
setService(match);
|
||||
}
|
||||
}
|
||||
}, [serviceProvider, services]);
|
||||
|
||||
if (!services) {
|
||||
return (
|
||||
<Box display="flex" alignItems="center" justifyContent="center" sx={{ my: 3 }}>
|
||||
<Typography fontSize={14} fontWeight={700} color={(theme) => theme.palette.common.white}>
|
||||
<CircularProgress size={14} sx={{ mr: 1 }} color="inherit" />
|
||||
Loading services...
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
const servicesWithRandomSp: ServiceWithRandomSp[] = useMemo(
|
||||
() =>
|
||||
services.map(({ id, items, description }) => ({
|
||||
id,
|
||||
description,
|
||||
sp: items[Math.floor(Math.random() * items.length)],
|
||||
})),
|
||||
[services, resetTrigger],
|
||||
);
|
||||
|
||||
if (!service) return null;
|
||||
|
||||
return (
|
||||
<Box display="flex" alignItems="center" justifyContent="space-between" sx={{ my: 3 }}>
|
||||
<TextField
|
||||
variant="filled"
|
||||
select
|
||||
fullWidth
|
||||
value={service.description}
|
||||
label="Select a service"
|
||||
InputLabelProps={{
|
||||
sx: {
|
||||
color: 'grey.500',
|
||||
'&.Mui-focused': {
|
||||
color: 'grey.500',
|
||||
},
|
||||
},
|
||||
}}
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
PaperProps: {
|
||||
sx: {
|
||||
background: '#383C41',
|
||||
borderTopLeftRadius: 0,
|
||||
borderTopRightRadius: 0,
|
||||
'&& .Mui-selected': {
|
||||
backgroundColor: '#FFFFFF33',
|
||||
},
|
||||
'&& .Mui-focusVisible': {
|
||||
backgroundColor: '#FFFFFF33',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{servicesWithRandomSp.map(({ id, description, sp }) => (
|
||||
<MenuItem key={id} value={description} onClick={() => handleSelectSp(sp)}>
|
||||
<Tooltip
|
||||
title={
|
||||
<Stack direction="column">
|
||||
<Typography fontSize="inherit">
|
||||
<code>{sp.id}</code>
|
||||
</Typography>
|
||||
<Typography fontSize="inherit" fontWeight={700}>
|
||||
{sp.description}
|
||||
</Typography>
|
||||
<Typography fontSize="inherit">
|
||||
Gateway <code>{sp.gateway.slice(0, 10)}...</code>
|
||||
</Typography>
|
||||
<Typography fontSize="inherit">
|
||||
Provider <code>{sp.address.slice(0, 10)}...</code>
|
||||
</Typography>
|
||||
</Stack>
|
||||
}
|
||||
arrow
|
||||
placement="top"
|
||||
>
|
||||
<Typography>{description}</Typography>
|
||||
</Tooltip>
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,342 @@
|
||||
import * as React from 'react';
|
||||
import { ComponentMeta } from '@storybook/react';
|
||||
import { Box } from '@mui/material';
|
||||
import { ServiceSelector } from './ServiceSelector';
|
||||
import { Services } from '../types/directory';
|
||||
|
||||
export default {
|
||||
title: 'Components/Service Selector',
|
||||
component: ServiceSelector,
|
||||
} as ComponentMeta<typeof ServiceSelector>;
|
||||
|
||||
const width = 240;
|
||||
|
||||
export const Loading = () => (
|
||||
<Box width={width}>
|
||||
<ServiceSelector />
|
||||
</Box>
|
||||
);
|
||||
|
||||
const services: Services = JSON.parse(`[
|
||||
{
|
||||
"id": "keybase",
|
||||
"description": "Keybase",
|
||||
"items": [
|
||||
{
|
||||
"id": "nym-keybase",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "Entztfv6Uaz2hpYHQJ6JKoaCTpDL5dja18SuQWVJAmmx.Cvhn9rBJw5Ay9wgHcbgCnVg89MPSV5s2muPV2YF1BXYu@Fo4f4SQLdoyoGkFae5TpVhRVoXCF8UiypLVGtGjujVPf",
|
||||
"gateway": "Fo4f4SQLdoyoGkFae5TpVhRVoXCF8UiypLVGtGjujVPf"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-1",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "D55ksecHzY6vAeqk8MCTzCfj2pqwJeKCKZCUUGnwGnn3.FS42vXS5a6GNTb1qk3aVk5mjSiJCAuawbBVyQZZVfhvt@DfNMqQRy6pPkU8Z5rBsxRwzDUzAMXHPFwMhjF16ScZqn",
|
||||
"gateway": "DfNMqQRy6pPkU8Z5rBsxRwzDUzAMXHPFwMhjF16ScZqn"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-2",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "DFdDtW7LNBATxQ4ef3jNbqs3cRE8b9wDZTCctHCQRULa.4AbKiTNVUwYFWHhy98o5pT9dELiUrkXoJQ9wHqPgf6GV@GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN",
|
||||
"gateway": "GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-3",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "6Y1HE1jJ92P9yoHer11TR4A2NdZePrLGaBNFf65MnYGe.FwXoh217odQDWNmViqzNX28fauYrjB3PYLrVvpqnQrX4@5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz",
|
||||
"gateway": "5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-4",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "3zzhLtWvaJgn755MkRckG5aRnoTZich8ASn395iSsTgj.J1R5VuxXbh2eNHiaRbrwbKGXrrEQcHKLdzf8eg9HTB6q@3B7PsbXFuqq6rerYFLw5HPbQb4UmBqAhfWURRovMmWoj",
|
||||
"gateway": "3B7PsbXFuqq6rerYFLw5HPbQb4UmBqAhfWURRovMmWoj"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-keybase-5",
|
||||
"description": "Nym Keybase Service Provider",
|
||||
"address": "CHuXdZJYQ8xH7ekgN9gAuVtQ7ZikjjHEZY5BSN7yc5mN.29dFvqicKQQQvoX1vup44mspmc249RH5xgLibWMwTYGT@CfWcDJq8QBz6cVAPCYSaLbaJEhVTmHEmyYgQ6C5GdDW9",
|
||||
"gateway": "CfWcDJq8QBz6cVAPCYSaLbaJEhVTmHEmyYgQ6C5GdDW9"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "electrum",
|
||||
"description": "Electrum Wallet",
|
||||
"items": [
|
||||
{
|
||||
"id": "nym-electrum",
|
||||
"description": "Nym Electrum Service Provider",
|
||||
"address": "DpB3cHAchJiNBQi5FrZx2csXb1mrHkpYh9Wzf8Rjsuko.ANNWrvHqMYuertHGHUrZdBntQhpzfbWekB39qez9U2Vx@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh",
|
||||
"gateway": "2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-electrum-1",
|
||||
"description": "Nym Electrum Service Provider",
|
||||
"address": "8Tb73cFQpXCLpgxEA2VSDru2hHrcZ3KQcyMsGbxcTjBp.4x5tu66k8YkHk4tYac1qwEFbNq5WsKiX5kR51q5KKH88@4WgKhJdmUffz4e1o1ftVAGS3HnG56LiNAxA9dmaekrVd",
|
||||
"gateway": "4WgKhJdmUffz4e1o1ftVAGS3HnG56LiNAxA9dmaekrVd"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-electrum-2",
|
||||
"description": "Nym Electrum Service Provider",
|
||||
"address": "GR6z31MwCsvxHrnvvVN1Cpasd8aQ1giwQqPTZM9dN7VH.5rEiqakSPDrBtKmvpU8Shnhz6gRM85JLoB7AX4h7PJYr@5Ao1J38frnU9Rx5YVeF5BWExcnDTcW8etNe9W2sRASXD",
|
||||
"gateway": "5Ao1J38frnU9Rx5YVeF5BWExcnDTcW8etNe9W2sRASXD"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "telegram",
|
||||
"description": "Telegram",
|
||||
"items": [
|
||||
{
|
||||
"id": "shipyard-telegram-2",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "C4w6ewbQtoaZEeoaaNw1xVASChqo4WVjNfuYEUFjZxpc.8F1D7rQXf2jGoj1Ken7PiGDM8HS2Ug79wSoc9nZ1iqh1@62F81C9GrHDRja9WCqozemRFSzFPMecY85MbGwn6efve",
|
||||
"gateway": "62F81C9GrHDRja9WCqozemRFSzFPMecY85MbGwn6efve"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-3",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "DStL3BEUZuQZfbij1KAY3BvJh8rC5jpr9mc6AQ6aTLUu.Ax9foYaKfFgX6g8y393GoNpKkKrnDGFGRZwxDv9R7X6M@FQon7UwF5knbUr2jf6jHhmNLbJnMreck1eUcVH59kxYE",
|
||||
"gateway": "FQon7UwF5knbUr2jf6jHhmNLbJnMreck1eUcVH59kxYE"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-4",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "8gRdGTzsDxYzpasRQhsRg59MCgNNhnfag2oFfwwZPXnB.DtDrGz7ScVm4o7sN4K3CYUJveYgz7fcXELBVLNDfMS9Y@3ojQD6V7skM1bSXJX7fVQvscjmcgptzdixQEaAha2ixh",
|
||||
"gateway": "3ojQD6V7skM1bSXJX7fVQvscjmcgptzdixQEaAha2ixh"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-5",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "AR3oEM6Uvmfs6fyddwSehoBUKCFxz7MdFi4z7aahuHuY.3ZKapg9A3Py1PXhyLbCJr8ZbJsEV6NZdN1WJaGGut5tj@EEyq16v63aotPBCepxUpCgAojrNasZ6Hk1PjpRyBAdEp",
|
||||
"gateway": "EEyq16v63aotPBCepxUpCgAojrNasZ6Hk1PjpRyBAdEp"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-6",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "7n1BYhsXSwcr8Qim8AqZTAodqFia4QG6T7CRc1ihQHpv.7o4trpGqu2LHMUiXc3dddgfGET1CFFcAK9gKYoHoSn5e@BTZNB3bkkEePsT14GN8ofVtM1SJae4YLWjpBerrKYfr",
|
||||
"gateway": "BTZNB3bkkEePsT14GN8ofVtM1SJae4YLWjpBerrKYfr"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-7",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "Gv4TWhUKrvJfqh1jBRPGEQrikNZvZse2kS3ZgN9Z2nAZ.7KGPaaqUEum2C59jLvw7f8Ug8a48YuZdjjZu3t4JES4U@C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi",
|
||||
"gateway": "C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-8",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "8Mqgp12cpF6FSXMeqzxgFgQXvTSapyNqGAi5wy7ub4ge.7z7PDsiJGiGxGz4p77v5L5fZhXBJ5qNZ8CgJwYNr6H6J",
|
||||
"gateway": "3zd3wrCK8Dz5TXrcvk5dG5s9EEdf4Ck1v9VgBPMMFVkR"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-9",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "F3N5eiPDZcGFC985Go4Mpv8p9uxFD1L3jRUdrLCbrZLm.EyTxWwwTwYpPrJBmc97GLd1LpUAphjptS5y1ed182bGk@GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ",
|
||||
"gateway": "GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-10",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "G7y7e1nVBr8fmQSzdeAxXnCmmmJb5k8N3E8LBV31KE5g.GRRUCj6t6cCUUjakmTWzidMLiYA7EdCedKnup8osaBC6@AJad2R9virYEYXEsTcicN5y5tyPoixrhhAGsxoESZVnc",
|
||||
"gateway": "AJad2R9virYEYXEsTcicN5y5tyPoixrhhAGsxoESZVnc"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-11",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "2kq9Z7RyDZtb8kxXjyP3ZT8VMWHg6JXFDChGuuNBk7Hw.F5XYbBaGSoF8qAo8faPcaNRPHEq3Y25BDcwESeabUS9S@HaLyPQrhBTq75dnGeBUdYWeFVA2BBn39MgkhEt3VTMMM",
|
||||
"gateway": "HaLyPQrhBTq75dnGeBUdYWeFVA2BBn39MgkhEt3VTMMM"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-12",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "GegdtpNzYj4QCgpih9Kxv7ZVZxmVdxYHsDkiPsbT71XG.E8xtE8mrapjzFtyuziZSrsScAKhwZMH5wNpKWtKfzJ5Y@9Byd9VAtyYMnbVAcqdoQxJnq76XEg2dbxbiF5Aa5Jj9J",
|
||||
"gateway": "9Byd9VAtyYMnbVAcqdoQxJnq76XEg2dbxbiF5Aa5Jj9J"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-13",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "4SsrDQeEtG3mpeD9nN5CDdGaCsxFvNeYMhoviDzNNB9f.GyqG6iK5rBvhe3HXLR11m6ULpf13ATgYvkkidLmteDLs@5EpkkrMFYAM3XcaztXnZwBWquURHSKsyc9JxUCengDFS",
|
||||
"gateway": "5EpkkrMFYAM3XcaztXnZwBWquURHSKsyc9JxUCengDFS"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-14",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "9JoHRu2RrSD1fjbj9NSTASgjv9Szep7Nhd9L2PywxbBi.AZhAUDNX6iH8BqXyR5c7TJuzpwMEvDXrabNLGuRukvVf@9xJM74FwwHhEKKJHihD21QSZnHM2QBRMoFx9Wst6qNBS",
|
||||
"gateway": "9xJM74FwwHhEKKJHihD21QSZnHM2QBRMoFx9Wst6qNBS"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-15",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "3K174ijjXqCkhMDT9xLcqjS4MXk2QsqZt4PdgNcuUrnn.BNnHnQmWoj6Uo6kkS1QkPqsdHaXrcwyR9F6MnnzDkZJL@C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi",
|
||||
"gateway": "C7J8SwZQqjWqhBryyjJxLt7FacVuPTwAmR2otGy53ayi"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-16",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "BqX5Q3MEcbTnM39hUswQchLW68SrqbhL8K5ucrLmtP39.AWrVsFoVC9s6KjdpcasATmZPA3GtMsUxcfHpAkuNdtFG@Emswx6KXyjRfq1c2k4d4uD2e6nBSbH1biorCZUei8UNS",
|
||||
"gateway": "Emswx6KXyjRfq1c2k4d4uD2e6nBSbH1biorCZUei8UNS"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-17",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "2tQxccgcqdkuUvLqgiEkEN4rNRZ5QknygnKAFcS4gfoe.EVrY5q5sqDqBUbS3wHsRRZhk2MAw1S17hNoH1Bicyv7n@DAGQxdxwAkwjaLjTw1B9vndia4YyFD15qRgcTQxrmkom",
|
||||
"gateway": "DAGQxdxwAkwjaLjTw1B9vndia4YyFD15qRgcTQxrmkom"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-18",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "8YG1rcEauJA814Nd7hSxjNe2UrRwrGsrXTm1Cmd3gRrU.FxYaYqpNN8PciNsySs3zYPrTB1J8AYUu9DBsM2vVDDfF@7EfEESLo71GUvx3UEW79LgTegHUBPUocUzGyJVv6LHog",
|
||||
"gateway": "7EfEESLo71GUvx3UEW79LgTegHUBPUocUzGyJVv6LHog"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-19",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "HPiXADVFLwLQPNpPtyYefzvYntC6tp9UJ5fJZGfkqvDt.2EUUxmeT3AiaUzAcE5SyXRAk8a2JXBkRz4B8McSdkrST@9ACTkYraCqE9jMb6zb6ne8EDQGGhZw5ykNiq9YRUdHTD",
|
||||
"gateway": "9ACTkYraCqE9jMb6zb6ne8EDQGGhZw5ykNiq9YRUdHTD"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-20",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "2QLnEEnTmf2NRWtcQPWBeRcg7Hej5WSPWRWwtTpEEZWF.BheS78ozc8ngvhsXNNnshdJzpoYsmEvhfn3WKUYF5dRU@C2uyokSPoxhku9GexRxEo1e8KPZ7q6e8FXmK3gtY8kkF",
|
||||
"gateway": "C2uyokSPoxhku9GexRxEo1e8KPZ7q6e8FXmK3gtY8kkF"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-21",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "FuBbnwiANfaXZnn683jBapK5XVm5ttgZSykU3vqPSHoD.94MFGv1VcBLTkRwzBDQUkWjvqtZYVBrJg2Q8JGbizcib@CTqYPY8htdAQMXCzRW9SjZzZuqYwSt2iUh6HPaNgmTvK",
|
||||
"gateway": "CTqYPY8htdAQMXCzRW9SjZzZuqYwSt2iUh6HPaNgmTvK"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-22",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "9EbQx5jQznSVbftFom7sqUSHAACrsfvMhrzhaFt4A3SZ.D1FQCirL4YKwfcmtMGvB5Rugt5sAzGEhdSjJ3bHVQRZ@7Zh1Sz5dXpA6s53CbtcdqhQhLqwf4cLynL7KqHKcjrG4",
|
||||
"gateway": "7Zh1Sz5dXpA6s53CbtcdqhQhLqwf4cLynL7KqHKcjrG4"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-24",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "6Umawwvf551VyB3Ko46NgKLqJdTFJeToCM67mrTmM3G.3A4sesBac4KGuMTFjvYBwLpksMJvbMbteGJQgmm4PV4Y@AnnYnEtBjB2a5sHmeRCnBq43qxyHDf95Bqd7cwQyKNLR",
|
||||
"gateway": "AnnYnEtBjB2a5sHmeRCnBq43qxyHDf95Bqd7cwQyKNLR"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-25",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "CDtxTeoyqq83JpV9G8cR5HRHRdMMaVspQsCwH3Qnajt3.F5EHK9HFcdGrE2hqA7bK9AUmkbihujYDhtNNqHKxW765@BDkeNx7JQm5NsQakst9s8htogZXhpTQedFAgZpvsGCqH",
|
||||
"gateway": "BDkeNx7JQm5NsQakst9s8htogZXhpTQedFAgZpvsGCqH"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-26",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "HukZkLG2DoarQEqaoDLuqW1GFf2NSHDUMGBZiyJGRYJD.9GyU8wPsyzcvRjcyk8hiNpTJbXCmq5F3VoVhFBZYuHR3@GsGEZiDBz8SWfHGaK5SDmhfbTEM55v37WCYYcT9wTSxN",
|
||||
"gateway": "GsGEZiDBz8SWfHGaK5SDmhfbTEM55v37WCYYcT9wTSxN"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-27",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "773y8iMVJiRk4dRbjQzkJVbrei4TwkePNE5WTEttt77d.3Mw47C9XZj3oAzk1iSqC5Y36tbBsjtaTtdgaHM3Zsdma@7fiZtNL1RACQTwGrKLBT9nbY77bfwZnX9rqcWqc53qgv",
|
||||
"gateway": "7fiZtNL1RACQTwGrKLBT9nbY77bfwZnX9rqcWqc53qgv"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-28",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "6jQJEorCu7YiP9HdDaMeHxcNhxeNmZ1kpd836GnqLZX.HsJqEmNTszGecsKqFB37i84nBXxqf4ETgrKmKmBvMGHC@FYnDMQzT49ZGM23gVqpTxfih14V6wuedNXirekmt37zE",
|
||||
"gateway": "FYnDMQzT49ZGM23gVqpTxfih14V6wuedNXirekmt37zE"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-29",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "BiCSyovpFMuSnTvF2TdiuZwrytXDrd9AH47ZMcCxscVC.G9YpdicA9BBNoVHDgjWjgt17wv5WYKWcbE3vPJJVpSJD@GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ",
|
||||
"gateway":"GAjhJcrd6f1edaqUkfWCff6zdHoqo756qYrc2TfPuCXJ"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-30",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "AQRRAs9oc8QWXAFBs44YhCKUny7AyLsfLy91pwmGgxuf.CWUKoKA1afSKyw5BnFJJg19UDgnaVATupsFhQpyTEBHJ@EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w",
|
||||
"gateway": "EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-31",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "6YqjAZK3Pr1ngiBLcDkotboB5WiN6k6NPpbXvShH4pR5.9Ss6VW3Xbyi8LuxduNNwnXEv9njHCQ2PLSP1UK6tsoa5@42XCK9dMS9m5XJLzQd2dBuwimk6ndZnczhZaV5VPFkQD",
|
||||
"gateway": "42XCK9dMS9m5XJLzQd2dBuwimk6ndZnczhZaV5VPFkQD"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-32",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "EmYWLeybmj86Vzr62vxuZ3T15jwMNHggzK7sQwid96yp.GyaF9WprSr56cxUdGf5TpcUvAjb2VbAr8CVBrmBUYAaw@GL5wESoz4oSbpBaTki9qB9213FGUQXCiRjbzDkhWwoBC",
|
||||
"gateway": "GL5wESoz4oSbpBaTki9qB9213FGUQXCiRjbzDkhWwoBC"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-33",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "4PDb96cck5btTj6G7rsomqwHJsp4qu8uPvFCbwHfjFUx.C5dKbaoakH7egsZvAueRbwLFbmxnQaVMeSr6QTMpuBAA@58ceEFaLJh6zAo3cirzT1BDQm7D3L5acnQrxGH1D6TAY",
|
||||
"gateway": "58ceEFaLJh6zAo3cirzT1BDQm7D3L5acnQrxGH1D6TAY"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-34",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "BeZbeMf9vcpUf368qDd85dtLwXLj4Ee5bsHMB2fUD8uX.HELVbppkwU1jmzUAUrCEbHeJfVciSeo8VGAkbJSpwxsb@ADdHkiTfkpsSt31zVToWW9j3KikH24aLAAwDKtCYE5jY",
|
||||
"gateway":"ADdHkiTfkpsSt31zVToWW9j3KikH24aLAAwDKtCYE5jY"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-35",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "Bp4JRFyf7GB9L9J95AqMPnz9zbGmPnViA5fDXKeNraLJ.D6CTdcjJVxDmH2UQvzXuPWg9Se9xXYe76uDMypXvhzd7@6UjGEeQZK14C5K2kenycTkqt7qRjEHGLgaQx3FWySo3N",
|
||||
"gateway": "6UjGEeQZK14C5K2kenycTkqt7qRjEHGLgaQx3FWySo3N"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-36",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "91h7io6BGhVjbtC7dbbRcScyTJcTfnMsTQZ6aWMVsrWR.Epb4hANXCp8cGEY3wSgawux991ti9Z5Y1FHTMzAKFa6E@DF4TE7V8kJkttMvnoSVGnRFFRt6WYGxxiC2w1XyPQnHe",
|
||||
"gateway": "DF4TE7V8kJkttMvnoSVGnRFFRt6WYGxxiC2w1XyPQnHe"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-37",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "Cy2wuwKpWZ3iWzKU3ZWL1qqcVfJ5Cq85dU7UHVWwv2gc.9AhC9b2zVcLnXLGriMdxjpsWJpq6iAdCavDi63udbL89@678qVUJ21uwxZBhp3r56z7GRf6gMh3NYDHruTegPtgMf",
|
||||
"gateway": "678qVUJ21uwxZBhp3r56z7GRf6gMh3NYDHruTegPtgMf"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-38",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "GgUeUWW1NRSuquZYeZf3WkppE92EQUHJrFjNZtYU1jow.CSEjwrRi4f4uyw7N6L2LPKw2tB8spcMbFu99wHZzFZSj@77TSuVU8d1oXKbPzjec2xh4i3Wj5WwUyy9Lr36sm8gZm",
|
||||
"gateway": "77TSuVU8d1oXKbPzjec2xh4i3Wj5WwUyy9Lr36sm8gZm"
|
||||
},
|
||||
{
|
||||
"id": "shipyard-telegram-39",
|
||||
"description": "Nym Telegram Service Provider",
|
||||
"address": "kz4zWwSkYiQxqxXFPNcGUByTPQWXascD9RfYsmSxY7n.ajp3SjbBVBjrU9nXpSQXAXzbb6EHJJyhbY6cc1ajayx@BTZNB3bkkEePsT14GN8ofVtM1SJae4YLWjpBerrKYf",
|
||||
"gateway": "HyS2UZtZX3kQXdazbdE99DhCjBXjbG61LC9QsmXwbxrU"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "blockstream",
|
||||
"description": "Blockstream Green",
|
||||
"items": [
|
||||
{
|
||||
"id": "nym-blockstream",
|
||||
"description": "Nym Blockstream Green Service Provider",
|
||||
"address": "GiRjFWrMxt58pEMuusm4yT3RxoMD1MMPrR9M2N4VWRJP.3CNZBPq4vg7v7qozjGjdPMXcvDmkbWPCgbGCjQVw9n6Z@2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW",
|
||||
"gateway": "2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW"
|
||||
}
|
||||
]
|
||||
}
|
||||
]`);
|
||||
export const Loaded = () => (
|
||||
<Box width={width}>
|
||||
<ServiceSelector services={services} />
|
||||
</Box>
|
||||
);
|
||||
|
||||
export const ServiceAlreadySelected = () => (
|
||||
<Box width={width}>
|
||||
<ServiceSelector
|
||||
services={services}
|
||||
currentSp={services[2].items[2]}
|
||||
onChange={(serviceProvider) => console.log('New service provider selected: ', serviceProvider)}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
@@ -0,0 +1,179 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import {
|
||||
Box,
|
||||
CircularProgress,
|
||||
Divider,
|
||||
FormControl,
|
||||
InputLabel,
|
||||
MenuItem,
|
||||
Select,
|
||||
Stack,
|
||||
Typography,
|
||||
} from '@mui/material';
|
||||
import { Service, ServiceProvider, Services } from '../types/directory';
|
||||
import { useTauriEvents } from '../utils';
|
||||
import { ServiceProviderPopup } from './ServiceProviderPopup';
|
||||
|
||||
export const ServiceSelector: FCWithChildren<{
|
||||
onChange?: (serviceProvider?: ServiceProvider) => void;
|
||||
services?: Services;
|
||||
currentSp?: ServiceProvider;
|
||||
}> = ({ services, currentSp, onChange }) => {
|
||||
const [service, setService] = React.useState<Service | undefined>();
|
||||
const [serviceProvider, setServiceProvider] = React.useState<ServiceProvider | undefined>(currentSp);
|
||||
const [isPopupVisible, setPopupVisible] = React.useState(false);
|
||||
|
||||
const getService = () => {
|
||||
if (!services || !currentSp) {
|
||||
return undefined;
|
||||
}
|
||||
return services.find((s) =>
|
||||
s.items.some(
|
||||
({ id, address, gateway }) =>
|
||||
id === currentSp.id && address === currentSp.address && gateway === currentSp.gateway,
|
||||
),
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!service && currentSp) {
|
||||
setServiceProvider(currentSp);
|
||||
setService(getService());
|
||||
}
|
||||
}, [currentSp, services]);
|
||||
|
||||
/**
|
||||
* Gets a random service provider from the currently selected service.
|
||||
*
|
||||
* If there is no service selected, or it does not have items, `undefined` is returned.
|
||||
*/
|
||||
const getRandomServiceProviderForService = (serviceToUse?: Service): ServiceProvider | undefined => {
|
||||
if (!serviceToUse?.items.length) {
|
||||
return undefined;
|
||||
}
|
||||
return serviceToUse.items[Math.floor(Math.random() * serviceToUse.items.length)];
|
||||
};
|
||||
|
||||
const handleServiceSelected = React.useCallback(
|
||||
(newService?: Service) => {
|
||||
console.log(newService?.id, service?.id);
|
||||
// if the user has chosen a new service, then pick a random service provider
|
||||
if (newService?.id !== service?.id) {
|
||||
const newServiceProvider = getRandomServiceProviderForService(newService);
|
||||
setServiceProvider(newServiceProvider);
|
||||
onChange?.(newServiceProvider);
|
||||
setService(newService);
|
||||
}
|
||||
},
|
||||
[service],
|
||||
);
|
||||
|
||||
// clears the display and fire on change (to trigger upstream storage clearance)
|
||||
const clearServiceProviderAndFireOnChange = () => {
|
||||
setService(undefined);
|
||||
setServiceProvider(undefined);
|
||||
onChange?.(undefined);
|
||||
};
|
||||
|
||||
// when the user clears local storage, reset the selector
|
||||
useTauriEvents('help://clear-storage', () => {
|
||||
clearServiceProviderAndFireOnChange();
|
||||
});
|
||||
|
||||
const handleAdvancedSpChange = (newServiceProvider?: ServiceProvider, newService?: Service) => {
|
||||
setPopupVisible(false);
|
||||
setService(newService);
|
||||
setServiceProvider(newServiceProvider);
|
||||
onChange?.(newServiceProvider);
|
||||
};
|
||||
|
||||
const handleNewService = (newServiceId?: string) => {
|
||||
const newService = (services || []).find((s) => s.id === newServiceId);
|
||||
setService(newService);
|
||||
};
|
||||
|
||||
if (!services) {
|
||||
return (
|
||||
<Box display="flex" alignItems="center" justifyContent="center" sx={{ my: 3 }}>
|
||||
<Typography fontSize={14} fontWeight={700} color={(theme) => theme.palette.common.white}>
|
||||
<CircularProgress size={14} sx={{ mr: 1 }} color="inherit" />
|
||||
Loading services...
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Box display="flex" alignItems="center" justifyContent="space-between" sx={{ my: 3 }}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel
|
||||
id="service-label"
|
||||
sx={{
|
||||
color: 'grey.500',
|
||||
'&.MuiInputLabel-shrink': {
|
||||
marginTop: '16px',
|
||||
marginLeft: '-2px',
|
||||
},
|
||||
'&.Mui-focused': {
|
||||
color: 'grey.500',
|
||||
},
|
||||
}}
|
||||
>
|
||||
Select a service
|
||||
</InputLabel>
|
||||
<Select
|
||||
labelId="service-label"
|
||||
id="service-id"
|
||||
variant="filled"
|
||||
value={service?.id || ''}
|
||||
onChange={(event) => handleNewService(event.target.value)}
|
||||
fullWidth
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
sx: {
|
||||
background: '#383C41',
|
||||
borderTopLeftRadius: 0,
|
||||
borderTopRightRadius: 0,
|
||||
'&& .Mui-selected': {
|
||||
backgroundColor: '#FFFFFF33',
|
||||
},
|
||||
'&& .Mui-focusVisible': {
|
||||
backgroundColor: '#FFFFFF33',
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{serviceProvider && (
|
||||
<Box px={2} pb={1} sx={{ opacity: 0.5 }}>
|
||||
<Stack direction="column" fontSize="small">
|
||||
<Typography fontSize="inherit">{serviceProvider.description}</Typography>
|
||||
<Typography fontSize="inherit">
|
||||
<code>{serviceProvider.id}</code>
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Box>
|
||||
)}
|
||||
{serviceProvider && <Divider />}
|
||||
{services.map((item) => (
|
||||
<MenuItem key={item.id} value={item.id} onClick={() => handleServiceSelected(item)}>
|
||||
<Typography>{item.description}</Typography>
|
||||
</MenuItem>
|
||||
))}
|
||||
<Divider />
|
||||
<Typography ml={2} variant="overline" display="block" sx={{ opacity: 0.5 }}>
|
||||
Advanced
|
||||
</Typography>
|
||||
<MenuItem onClick={() => setPopupVisible(true)}>Choose service provider</MenuItem>
|
||||
<MenuItem onClick={clearServiceProviderAndFireOnChange}>Clear settings</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
<ServiceProviderPopup
|
||||
open={isPopupVisible}
|
||||
services={services}
|
||||
onBackdropClick={() => setPopupVisible(false)}
|
||||
onServiceProviderChanged={handleAdvancedSpChange}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -1,21 +1,15 @@
|
||||
import React from 'react';
|
||||
import { Divider, Stack, Typography } from '@mui/material';
|
||||
import { ServiceProvider, Gateway } from 'src/types/directory';
|
||||
import { ServiceProvider } from 'src/types/directory';
|
||||
|
||||
export const ServiceProviderInfo = ({
|
||||
serviceProvider,
|
||||
gateway,
|
||||
}: {
|
||||
serviceProvider: ServiceProvider;
|
||||
gateway: Gateway;
|
||||
}) => (
|
||||
export const ServiceProviderInfo = ({ serviceProvider }: { serviceProvider: ServiceProvider }) => (
|
||||
<Stack gap={1} sx={{ wordWrap: 'break-word', maxWidth: 150, p: 1 }}>
|
||||
<Typography variant="body2" fontWeight="bold">
|
||||
Connection info
|
||||
</Typography>
|
||||
<Divider />
|
||||
<Typography variant="caption" fontWeight="bold">
|
||||
Gateway <Typography variant="caption">{gateway.identity}</Typography>
|
||||
Gateway <Typography variant="caption">{serviceProvider.gateway}</Typography>
|
||||
</Typography>
|
||||
<Divider />
|
||||
<Typography variant="caption" fontWeight="bold">
|
||||
|
||||
@@ -9,7 +9,7 @@ import { UserDefinedGateway, UserDefinedSPAddress } from 'src/types/service-prov
|
||||
import { getItemFromStorage, setItemInStorage } from 'src/utils';
|
||||
import { ConnectionStatusKind, GatewayPerformance, PrivacyLevel, UserData } from '../types';
|
||||
import { ConnectionStatsItem } from '../components/ConnectionStats';
|
||||
import { ServiceProvider, Gateway } from '../types/directory';
|
||||
import { ServiceProvider } from '../types/directory';
|
||||
import initSentry from '../sentry';
|
||||
|
||||
const FORAGE_GATEWAY_KEY = 'nym-connect-user-gateway';
|
||||
@@ -27,20 +27,17 @@ export type TClientContext = {
|
||||
error?: Error;
|
||||
gatewayPerformance: GatewayPerformance;
|
||||
selectedProvider?: ServiceProvider;
|
||||
selectedGateway?: Gateway;
|
||||
showInfoModal: boolean;
|
||||
userDefinedGateway?: UserDefinedGateway;
|
||||
userDefinedSPAddress: UserDefinedSPAddress;
|
||||
serviceProviders?: ServiceProvider[];
|
||||
gateways?: Gateway[];
|
||||
setMode: (mode: ModeType) => void;
|
||||
clearError: () => void;
|
||||
setConnectionStatus: (connectionStatus: ConnectionStatusKind) => void;
|
||||
setConnectionStats: (connectionStats: ConnectionStatsItem[] | undefined) => void;
|
||||
setConnectedSince: (connectedSince: DateTime | undefined) => void;
|
||||
setShowInfoModal: (show: boolean) => void;
|
||||
setServiceProvider: () => void;
|
||||
setGateway: () => void;
|
||||
setSerivceProvider: () => void;
|
||||
startConnecting: () => Promise<void>;
|
||||
startDisconnecting: () => Promise<void>;
|
||||
setUserDefinedGateway: React.Dispatch<React.SetStateAction<UserDefinedGateway>>;
|
||||
@@ -49,10 +46,6 @@ export type TClientContext = {
|
||||
setPrivacyLevel: (value: PrivacyLevel) => Promise<void>;
|
||||
};
|
||||
|
||||
function getRandomFromList<T>(items: T[]): T {
|
||||
return items[Math.floor(Math.random() * items.length)];
|
||||
}
|
||||
|
||||
export const ClientContext = createContext({} as TClientContext);
|
||||
|
||||
export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
@@ -61,9 +54,7 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
const [connectionStats, setConnectionStats] = useState<ConnectionStatsItem[]>();
|
||||
const [connectedSince, setConnectedSince] = useState<DateTime>();
|
||||
const [selectedProvider, setSelectedProvider] = React.useState<ServiceProvider>();
|
||||
const [selectedGateway, setSelectedGateway] = React.useState<Gateway>();
|
||||
const [serviceProviders, setServiceProviders] = React.useState<ServiceProvider[]>();
|
||||
const [gateways, setGateways] = React.useState<Gateway[]>();
|
||||
const [error, setError] = useState<Error>();
|
||||
const [appVersion, setAppVersion] = useState<string>();
|
||||
const [gatewayPerformance, setGatewayPerformance] = useState<GatewayPerformance>('Good');
|
||||
@@ -112,15 +103,13 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
}, [userDefinedSPAddress]);
|
||||
|
||||
const initialiseApp = async () => {
|
||||
const fetchedServices = await invoke<ServiceProvider[]>('get_services');
|
||||
const fetchedGateways = await invoke<Gateway[]>('get_gateways');
|
||||
const services = await invoke('get_services');
|
||||
const AppVersion = await getAppVersion();
|
||||
const storedUserDefinedGateway = await getItemFromStorage({ key: FORAGE_GATEWAY_KEY });
|
||||
const storedUserDefinedSP = await getItemFromStorage({ key: FORAGE_SP_KEY });
|
||||
|
||||
setAppVersion(AppVersion);
|
||||
setServiceProviders(fetchedServices);
|
||||
setGateways(fetchedGateways);
|
||||
setServiceProviders(services as ServiceProvider[]);
|
||||
|
||||
if (storedUserDefinedGateway) {
|
||||
setUserDefinedGateway(storedUserDefinedGateway);
|
||||
@@ -173,42 +162,39 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
const shouldUseUserGateway = !!userDefinedGateway.gateway && userDefinedGateway.isActive;
|
||||
const shouldUseUserSP = !!userDefinedSPAddress.address && userDefinedSPAddress.isActive;
|
||||
|
||||
const setServiceProvider = async (newServiceProvider: ServiceProvider) => {
|
||||
await invoke('set_gateway', {
|
||||
gateway: shouldUseUserGateway ? userDefinedGateway.gateway : newServiceProvider.gateway,
|
||||
});
|
||||
await invoke('set_service_provider', {
|
||||
serviceProvider: shouldUseUserSP ? userDefinedSPAddress.address : newServiceProvider.address,
|
||||
});
|
||||
};
|
||||
|
||||
const getRandomSPFromList = (services: ServiceProvider[]) => {
|
||||
const randomSelection = services[Math.floor(Math.random() * services.length)];
|
||||
return randomSelection;
|
||||
};
|
||||
|
||||
const buildServiceProvider = async (serviceProvider: ServiceProvider) => {
|
||||
const sp = { ...serviceProvider };
|
||||
|
||||
if (shouldUseUserGateway) sp.gateway = userDefinedGateway.gateway as string;
|
||||
if (shouldUseUserSP) sp.address = userDefinedSPAddress.address as string;
|
||||
|
||||
return sp;
|
||||
};
|
||||
|
||||
const buildGateway = async (gateway: Gateway) => {
|
||||
const gw = { ...gateway };
|
||||
if (shouldUseUserGateway) gw.identity = userDefinedGateway.gateway as string;
|
||||
return gw;
|
||||
};
|
||||
|
||||
const setServiceProvider = async () => {
|
||||
const setSerivceProvider = async () => {
|
||||
if (serviceProviders) {
|
||||
const randomServiceProvider = getRandomFromList(serviceProviders);
|
||||
const randomServiceProvider = getRandomSPFromList(serviceProviders);
|
||||
const withUserDefinitions = await buildServiceProvider(randomServiceProvider);
|
||||
await invoke('set_service_provider', {
|
||||
serviceProvider: shouldUseUserSP ? userDefinedSPAddress.address : withUserDefinitions.address,
|
||||
});
|
||||
await setServiceProvider(withUserDefinitions);
|
||||
setSelectedProvider(withUserDefinitions);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const setGateway = async () => {
|
||||
if (gateways) {
|
||||
const randomGateway = getRandomFromList(gateways);
|
||||
const withUserDefinitions = await buildGateway(randomGateway);
|
||||
await invoke('set_gateway', {
|
||||
gateway: shouldUseUserGateway ? userDefinedGateway.gateway : withUserDefinitions.identity,
|
||||
});
|
||||
setSelectedGateway(withUserDefinitions);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const clearError = () => setError(undefined);
|
||||
|
||||
const setMonitoring = async (value: boolean) => {
|
||||
@@ -236,13 +222,11 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
showInfoModal,
|
||||
setConnectionStats,
|
||||
selectedProvider,
|
||||
selectedGateway,
|
||||
serviceProviders,
|
||||
connectedSince,
|
||||
userData,
|
||||
setConnectedSince,
|
||||
setServiceProvider,
|
||||
setGateway,
|
||||
setSerivceProvider,
|
||||
startConnecting,
|
||||
startDisconnecting,
|
||||
gatewayPerformance,
|
||||
@@ -266,7 +250,6 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
connectedSince,
|
||||
gatewayPerformance,
|
||||
selectedProvider,
|
||||
selectedGateway,
|
||||
userDefinedGateway,
|
||||
userDefinedSPAddress,
|
||||
userData,
|
||||
|
||||
@@ -6,7 +6,7 @@ const mockValues: TClientContext = {
|
||||
appVersion: 'v1.x.x',
|
||||
mode: 'dark',
|
||||
connectionStatus: ConnectionStatusKind.disconnected,
|
||||
selectedProvider: { id: '1', description: 'Keybase service provider', address: '123abc' },
|
||||
selectedProvider: { id: '1', description: 'Keybase service provider', gateway: 'abc123', address: '123abc' },
|
||||
gatewayPerformance: 'Good',
|
||||
showInfoModal: false,
|
||||
userDefinedGateway: { isActive: false, gateway: '' },
|
||||
@@ -20,8 +20,7 @@ const mockValues: TClientContext = {
|
||||
setConnectionStatus: () => {},
|
||||
startConnecting: async () => {},
|
||||
startDisconnecting: async () => {},
|
||||
setServiceProvider: () => {},
|
||||
setGateway: () => {},
|
||||
setSerivceProvider: () => {},
|
||||
setUserDefinedGateway: () => {},
|
||||
setUserDefinedSPAddress: () => {},
|
||||
setMonitoring: async () => {},
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ConnectionStatus } from 'src/components/ConnectionStatus';
|
||||
import { ConnectionStatusKind, GatewayPerformance } from 'src/types';
|
||||
import { ConnectionStatsItem } from 'src/components/ConnectionStats';
|
||||
import { IpAddressAndPort } from 'src/components/IpAddressAndPort';
|
||||
import { ServiceProvider, Gateway } from 'src/types/directory';
|
||||
import { ServiceProvider } from 'src/types/directory';
|
||||
import { ExperimentalWarning } from 'src/components/ExperimentalWarning';
|
||||
import { ConnectionLayout } from 'src/layouts/ConnectionLayout';
|
||||
import { PowerButton } from 'src/components/PowerButton/PowerButton';
|
||||
@@ -26,7 +26,6 @@ export const Connected: FCWithChildren<{
|
||||
busy?: boolean;
|
||||
isError?: boolean;
|
||||
serviceProvider?: ServiceProvider;
|
||||
gateway?: Gateway;
|
||||
clearError: () => void;
|
||||
onConnectClick: (status: ConnectionStatusKind) => void;
|
||||
closeInfoModal: () => void;
|
||||
@@ -41,7 +40,6 @@ export const Connected: FCWithChildren<{
|
||||
busy,
|
||||
isError,
|
||||
serviceProvider,
|
||||
gateway,
|
||||
clearError,
|
||||
onConnectClick,
|
||||
closeInfoModal,
|
||||
@@ -56,7 +54,6 @@ export const Connected: FCWithChildren<{
|
||||
status={ConnectionStatusKind.connected}
|
||||
gatewayPerformance={gatewayPerformance}
|
||||
serviceProvider={serviceProvider}
|
||||
gateway={gateway}
|
||||
/>
|
||||
<ConnectionTimer connectedSince={connectedSince} />
|
||||
</Box>
|
||||
|
||||
@@ -30,8 +30,7 @@ export const ConnectionPage = () => {
|
||||
switch (currentStatus) {
|
||||
case 'disconnected':
|
||||
Sentry.captureMessage('start connect', 'info');
|
||||
await context.setServiceProvider();
|
||||
await context.setGateway();
|
||||
await context.setSerivceProvider();
|
||||
await context.startConnecting();
|
||||
context.setConnectedSince(DateTime.now());
|
||||
context.setShowInfoModal(true);
|
||||
@@ -62,7 +61,6 @@ export const ConnectionPage = () => {
|
||||
gatewayPerformance={context.gatewayPerformance}
|
||||
connectedSince={context.connectedSince}
|
||||
serviceProvider={context.selectedProvider}
|
||||
gateway={context.selectedGateway}
|
||||
closeInfoModal={closeInfoModal}
|
||||
stats={[
|
||||
{
|
||||
|
||||
@@ -37,8 +37,8 @@ export const PrivacyLevelSettings = () => {
|
||||
label="Enable"
|
||||
/>
|
||||
<FormHelperText sx={{ m: 0, my: 2 }}>
|
||||
By activating this option, the connection speed will be relatively faster in exchange for relaxing some
|
||||
privacy protections
|
||||
By activating this option, the connection speed will be relatively faster in exchange of relaxing some
|
||||
protections
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</Box>
|
||||
|
||||
@@ -29,6 +29,7 @@ export const Mock: ComponentStory<typeof AppWindowFrame> = () => {
|
||||
id: 'nym-keybase',
|
||||
description: 'Nym Keybase Service Provider',
|
||||
address: '1234.5678',
|
||||
gateway: 'abcedf',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ export const Default: ComponentStory<typeof Connected> = () => (
|
||||
status={ConnectionStatusKind.connected}
|
||||
connectedSince={DateTime.now()}
|
||||
ipAddress="127.0.0.1"
|
||||
serviceProvider={{ id: 'service 1', description: 'good services', address: 'abc123' }}
|
||||
serviceProvider={{ id: 'service 1', description: 'good services', address: 'abc123', gateway: '8910xyz' }}
|
||||
port={1080}
|
||||
stats={[
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ export const WithServices: ComponentStory<typeof Disconnected> = () => (
|
||||
{
|
||||
id: '1',
|
||||
description: 'Keybase service',
|
||||
items: [{ id: '1', description: 'Keybase service 1', address: '123abc' }],
|
||||
items: [{ id: '1', description: 'Keybase service 1', gateway: 'abc123', address: '123abc' }],
|
||||
},
|
||||
]}
|
||||
clearError={() => {}}
|
||||
|
||||
@@ -2,6 +2,7 @@ export interface ServiceProvider {
|
||||
id: string;
|
||||
description: string;
|
||||
address: string;
|
||||
gateway: string;
|
||||
}
|
||||
|
||||
export interface Service {
|
||||
@@ -11,7 +12,3 @@ export interface Service {
|
||||
}
|
||||
|
||||
export type Services = Service[];
|
||||
|
||||
export interface Gateway {
|
||||
identity: string;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ serde_repr = "0.1"
|
||||
tap = "1.0.1"
|
||||
# tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next", features = ["clipboard-write-text", "native-tls-vendored", "notification-all", "shell-open"] }
|
||||
tauri = { version = "2.0.0-alpha.3", features = ["clipboard-write-text", "native-tls-vendored", "notification-all", "shell-open"] }
|
||||
#tendermint-rpc = "0.23.0"
|
||||
tendermint-rpc = "0.23.0"
|
||||
thiserror = "1.0"
|
||||
time = { version = "0.3.17", features = ["local-offset"] }
|
||||
tokio = { version = "1.24.1", features = ["sync", "time"] }
|
||||
|
||||
@@ -2,7 +2,7 @@ plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21'
|
||||
id 'io.sentry.android.gradle' version '3.11.0'
|
||||
id "io.sentry.android.gradle" version "3.11.0"
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -122,6 +122,6 @@ dependencies {
|
||||
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
|
||||
debugImplementation 'androidx.compose.ui:ui-tooling'
|
||||
debugImplementation 'androidx.compose.ui:ui-test-manifest'
|
||||
implementation 'com.github.kittinunf.fuel:fuel:2.3.1'
|
||||
implementation 'com.github.kittinunf.fuel:fuel:3.0.0-alpha1'
|
||||
implementation 'io.sentry:sentry-android:6.24.0'
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ import androidx.work.ForegroundInfo
|
||||
import androidx.work.WorkManager
|
||||
import androidx.work.WorkerParameters
|
||||
import androidx.work.workDataOf
|
||||
import com.github.kittinunf.fuel.Fuel
|
||||
import fuel.Fuel
|
||||
import fuel.get
|
||||
import io.sentry.Sentry
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.decodeFromString
|
||||
@@ -109,23 +110,20 @@ class ProxyWorker(
|
||||
var serviceProvider: String? = null
|
||||
// fetch the SP list and select a random one
|
||||
try {
|
||||
val (_, response, result) = Fuel.get(spUrl).responseString()
|
||||
result.fold(
|
||||
{ data ->
|
||||
val spJson = json.decodeFromString<SPListData>(data)
|
||||
serviceProvider =
|
||||
Random.nextInt(until = spJson.items.size)
|
||||
.let { spJson.items[it].service_provider_client_id }
|
||||
Log.d(tag, "selected service provider: $serviceProvider")
|
||||
},
|
||||
{ error ->
|
||||
Log.w(
|
||||
tag,
|
||||
"failed to fetch the service provider list: ${response.statusCode} ${error.message}"
|
||||
)
|
||||
Log.w(tag, "using a default service provider $defaultSp")
|
||||
}
|
||||
)
|
||||
val res = Fuel.get(spUrl)
|
||||
if (res.statusCode == 200) {
|
||||
val spJson = json.decodeFromString<SPListData>(res.body)
|
||||
serviceProvider =
|
||||
Random.nextInt(until = spJson.items.size)
|
||||
.let { spJson.items[it].service_provider_client_id }
|
||||
Log.d(tag, "selected service provider: $serviceProvider")
|
||||
} else {
|
||||
Log.w(
|
||||
tag,
|
||||
"failed to fetch the service providers list: $res.statusCode"
|
||||
)
|
||||
Log.w(tag, "using a default service provider $defaultSp")
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Log.e(
|
||||
tag,
|
||||
|
||||
Generated
+107
-278
@@ -200,12 +200,6 @@ version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
|
||||
|
||||
[[package]]
|
||||
name = "base16ct"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.1"
|
||||
@@ -226,13 +220,13 @@ checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b"
|
||||
|
||||
[[package]]
|
||||
name = "bip32"
|
||||
version = "0.5.1"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164"
|
||||
checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b"
|
||||
dependencies = [
|
||||
"bs58 0.5.0",
|
||||
"bs58",
|
||||
"hmac 0.12.1",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"once_cell",
|
||||
"pbkdf2",
|
||||
"rand_core 0.6.4",
|
||||
@@ -298,7 +292,7 @@ version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -312,7 +306,7 @@ dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"constant_time_eq",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -379,14 +373,8 @@ name = "bs58"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
||||
|
||||
[[package]]
|
||||
name = "bs58"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896"
|
||||
dependencies = [
|
||||
"sha2 0.10.6",
|
||||
"sha2 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -428,9 +416,6 @@ name = "bytes"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
@@ -755,9 +740,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cosmos-sdk-proto"
|
||||
version = "0.19.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c"
|
||||
checksum = "8bb61f3d2224c90ea78e1fa7444787761a549170c46b6b0ed09b93f9b7e4076a"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"prost-types",
|
||||
@@ -766,16 +751,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cosmrs"
|
||||
version = "0.14.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6"
|
||||
checksum = "20d5890dac07a62337e5841adb8f2074a66a962a098a48df9460f64d483beaf4"
|
||||
dependencies = [
|
||||
"bip32",
|
||||
"cosmos-sdk-proto",
|
||||
"ecdsa 0.16.8",
|
||||
"ecdsa",
|
||||
"eyre",
|
||||
"getrandom 0.2.10",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"rand_core 0.6.4",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -791,9 +778,9 @@ version = "1.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75836a10cb9654c54e77ee56da94d592923092a10b369cdb0dbd56acefc16340"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"ed25519-zebra",
|
||||
"k256 0.11.6",
|
||||
"k256",
|
||||
"rand_core 0.6.4",
|
||||
"thiserror",
|
||||
]
|
||||
@@ -930,18 +917,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15"
|
||||
dependencies = [
|
||||
"generic-array 0.14.7",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
@@ -1056,19 +1031,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek-ng"
|
||||
version = "4.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"digest 0.9.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle-ng",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cw-controllers"
|
||||
version = "1.0.1"
|
||||
@@ -1209,16 +1171,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "der"
|
||||
version = "0.7.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "2.2.0"
|
||||
@@ -1263,12 +1215,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.3",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
@@ -1380,24 +1331,10 @@ version = "0.14.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"elliptic-curve 0.12.3",
|
||||
"rfc6979 0.3.1",
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ecdsa"
|
||||
version = "0.16.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"digest 0.10.7",
|
||||
"elliptic-curve 0.13.5",
|
||||
"rfc6979 0.4.0",
|
||||
"signature 2.1.0",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"elliptic-curve",
|
||||
"rfc6979",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1406,30 +1343,7 @@ version = "1.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
|
||||
dependencies = [
|
||||
"signature 1.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "2.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963"
|
||||
dependencies = [
|
||||
"pkcs8 0.10.2",
|
||||
"signature 2.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519-consensus"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b"
|
||||
dependencies = [
|
||||
"curve25519-dalek-ng",
|
||||
"hex",
|
||||
"rand_core 0.6.4",
|
||||
"sha2 0.9.9",
|
||||
"zeroize",
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1439,7 +1353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519 1.5.3",
|
||||
"ed25519",
|
||||
"rand 0.7.3",
|
||||
"serde",
|
||||
"sha2 0.9.9",
|
||||
@@ -1473,35 +1387,16 @@ version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"crypto-bigint 0.4.9",
|
||||
"der 0.6.1",
|
||||
"digest 0.10.7",
|
||||
"base16ct",
|
||||
"crypto-bigint",
|
||||
"der",
|
||||
"digest 0.10.6",
|
||||
"ff 0.12.1",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.12.1",
|
||||
"pkcs8 0.9.0",
|
||||
"pkcs8",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.3.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "elliptic-curve"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"crypto-bigint 0.5.2",
|
||||
"digest 0.10.7",
|
||||
"ff 0.13.0",
|
||||
"generic-array 0.14.7",
|
||||
"group 0.13.0",
|
||||
"pkcs8 0.10.2",
|
||||
"rand_core 0.6.4",
|
||||
"sec1 0.7.3",
|
||||
"sec1",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -1624,16 +1519,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
||||
dependencies = [
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "field-offset"
|
||||
version = "0.3.4"
|
||||
@@ -2120,17 +2005,6 @@ dependencies = [
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
|
||||
dependencies = [
|
||||
"ff 0.13.0",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gtk"
|
||||
version = "0.15.5"
|
||||
@@ -2330,7 +2204,7 @@ version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2715,23 +2589,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"ecdsa 0.14.8",
|
||||
"elliptic-curve 0.12.3",
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"sha2 0.10.6",
|
||||
"sha3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "k256"
|
||||
version = "0.13.1"
|
||||
name = "keccak"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc"
|
||||
checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"ecdsa 0.16.8",
|
||||
"elliptic-curve 0.13.5",
|
||||
"once_cell",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3120,7 +2990,7 @@ dependencies = [
|
||||
name = "nym-api-requests"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmrs",
|
||||
"cosmwasm-std",
|
||||
"getset",
|
||||
@@ -3150,7 +3020,7 @@ name = "nym-coconut"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bls12_381",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"digest 0.9.0",
|
||||
"ff 0.11.1",
|
||||
"getrandom 0.2.10",
|
||||
@@ -3191,7 +3061,7 @@ dependencies = [
|
||||
name = "nym-coconut-interface"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"getset",
|
||||
"nym-coconut",
|
||||
"serde",
|
||||
@@ -3215,7 +3085,7 @@ dependencies = [
|
||||
name = "nym-contracts-common"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"schemars",
|
||||
"serde",
|
||||
@@ -3226,7 +3096,7 @@ dependencies = [
|
||||
name = "nym-crypto"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"ed25519-dalek",
|
||||
"nym-pemstore",
|
||||
"nym-sphinx-types",
|
||||
@@ -3243,7 +3113,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"bls12_381",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"ff 0.11.1",
|
||||
"group 0.11.0",
|
||||
"lazy_static",
|
||||
@@ -3273,7 +3143,7 @@ dependencies = [
|
||||
name = "nym-mixnet-contract-common"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"cosmwasm-std",
|
||||
"humantime-serde",
|
||||
"log",
|
||||
@@ -3451,7 +3321,6 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.9.9",
|
||||
"tendermint-rpc",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"url",
|
||||
@@ -3524,7 +3393,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym_wallet"
|
||||
version = "1.2.6"
|
||||
version = "1.2.5"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.13.1",
|
||||
@@ -3539,7 +3408,7 @@ dependencies = [
|
||||
"fern",
|
||||
"futures",
|
||||
"itertools",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"log",
|
||||
"nym-coconut-interface",
|
||||
"nym-config",
|
||||
@@ -3565,6 +3434,7 @@ dependencies = [
|
||||
"tauri-codegen",
|
||||
"tauri-macros",
|
||||
"tempfile",
|
||||
"tendermint-rpc",
|
||||
"thiserror",
|
||||
"time",
|
||||
"tokio",
|
||||
@@ -3796,12 +3666,11 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
||||
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"hmac 0.12.1",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4028,18 +3897,8 @@ version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
|
||||
dependencies = [
|
||||
"der 0.6.1",
|
||||
"spki 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
||||
dependencies = [
|
||||
"der 0.7.7",
|
||||
"spki 0.7.2",
|
||||
"der",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4170,9 +4029,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.11.9"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd"
|
||||
checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
@@ -4180,9 +4039,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.11.9"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4"
|
||||
checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools",
|
||||
@@ -4193,10 +4052,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.11.9"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13"
|
||||
checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost",
|
||||
]
|
||||
|
||||
@@ -4456,21 +4316,11 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb"
|
||||
dependencies = [
|
||||
"crypto-bigint 0.4.9",
|
||||
"crypto-bigint",
|
||||
"hmac 0.12.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfc6979"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
||||
dependencies = [
|
||||
"hmac 0.12.1",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfd"
|
||||
version = "0.10.0"
|
||||
@@ -4516,7 +4366,18 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ripemd160"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251"
|
||||
dependencies = [
|
||||
"block-buffer 0.9.0",
|
||||
"digest 0.9.0",
|
||||
"opaque-debug 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4665,24 +4526,10 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928"
|
||||
dependencies = [
|
||||
"base16ct 0.1.1",
|
||||
"der 0.6.1",
|
||||
"base16ct",
|
||||
"der",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.9.0",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sec1"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
|
||||
dependencies = [
|
||||
"base16ct 0.2.0",
|
||||
"der 0.7.7",
|
||||
"generic-array 0.14.7",
|
||||
"pkcs8 0.10.2",
|
||||
"pkcs8",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -4920,7 +4767,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4944,7 +4791,17 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha3"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
|
||||
dependencies = [
|
||||
"digest 0.10.6",
|
||||
"keccak",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4971,17 +4828,7 @@ version = "1.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest 0.10.6",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
@@ -5053,7 +4900,7 @@ dependencies = [
|
||||
"aes 0.7.5",
|
||||
"arrayref",
|
||||
"blake2 0.8.1",
|
||||
"bs58 0.4.0",
|
||||
"bs58",
|
||||
"byteorder",
|
||||
"chacha",
|
||||
"curve25519-dalek",
|
||||
@@ -5081,17 +4928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.6.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spki"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der 0.7.7",
|
||||
"der",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5190,12 +5027,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle-ng"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.107"
|
||||
@@ -5512,28 +5343,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0"
|
||||
checksum = "a199518e0366ba0aeb0d0e0a59dbd99ea0bdc14280f414ecc758c9228a454ad8"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"digest 0.10.7",
|
||||
"ed25519 2.2.1",
|
||||
"ed25519-consensus",
|
||||
"ed25519",
|
||||
"ed25519-dalek",
|
||||
"flex-error",
|
||||
"futures",
|
||||
"k256 0.13.1",
|
||||
"k256",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"ripemd",
|
||||
"ripemd160",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"sha2 0.10.6",
|
||||
"signature 2.1.0",
|
||||
"sha2 0.9.9",
|
||||
"signature",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint-proto",
|
||||
@@ -5543,9 +5374,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-config"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372"
|
||||
checksum = "c6d8f6a64ae3b59ea3c73efad727271ee085b544b817d7f46901817ca6bb1773"
|
||||
dependencies = [
|
||||
"flex-error",
|
||||
"serde",
|
||||
@@ -5557,9 +5388,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-proto"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d"
|
||||
checksum = "1b303d6387aaea38cea7ef924476d1f798573044e7b4f6ddd1166ac5184b2281"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flex-error",
|
||||
@@ -5575,9 +5406,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tendermint-rpc"
|
||||
version = "0.32.2"
|
||||
version = "0.23.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d119d83a130537fc4a98c3c9eb6899ebe857fea4860400a61675bfb5f0b35129"
|
||||
checksum = "3036f0b65baa11e767dabd22a0663e842b595b0a1903f149b7b8b1e09b2b443d"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
@@ -5590,11 +5421,9 @@ dependencies = [
|
||||
"hyper-rustls",
|
||||
"peg",
|
||||
"pin-project",
|
||||
"semver 1.0.16",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"subtle 2.4.1",
|
||||
"subtle-encoding",
|
||||
"tendermint",
|
||||
"tendermint-config",
|
||||
|
||||
@@ -11,13 +11,15 @@ serde_json = "1.0"
|
||||
strum = { version = "0.23", features = ["derive"] }
|
||||
ts-rs = "6.1.2"
|
||||
|
||||
cosmwasm-std = "1.2.0"
|
||||
cosmrs = "=0.14.0"
|
||||
cosmwasm-std = "1.0.0"
|
||||
cosmrs = "=0.8.0"
|
||||
|
||||
nym-config = { path = "../../common/config" }
|
||||
nym-network-defaults = { path = "../../common/network-defaults" }
|
||||
nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client" }
|
||||
nym-validator-client = { path = "../../common/client-libs/validator-client", features = [
|
||||
"nyxd-client",
|
||||
] }
|
||||
nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" }
|
||||
# Used for Type conversion, can be extracted but its a lot of work
|
||||
nym-vesting-contract = { path = "../../contracts/vesting" }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user