diff --git a/.github/actions/codecov-integration-tests/action.yml b/.github/actions/codecov-integration-tests/action.yml index 424751ab91..5235fc09fd 100644 --- a/.github/actions/codecov-integration-tests/action.yml +++ b/.github/actions/codecov-integration-tests/action.yml @@ -33,12 +33,12 @@ runs: -e RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \ -e RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \ ${{ inputs.codecov-img-name }} \ - bash -c '(cd $HOME/libvcx && \ + bash -c '(cd $HOME/aries-vcx/libvcx && \ cargo test --features "pool_tests agency_v2" && \ - grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ./target/debug/coverage.lcov)' + grcov ../target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ../target/debug/coverage.lcov)' docker_id=$(docker ps -a | grep libvcx-codecov-integration | grep Exited | tail -n 1 | cut -d ' ' -f 1) docker_image_id=$(docker images | grep codecov | perl -pe 's/\s+/ /g' | cut -d ' ' -f 3) - docker cp ${docker_id}:/home/indy/libvcx/target/debug/coverage.lcov ${{ inputs.cov-file-path }} + docker cp ${docker_id}:/home/indy/aries-vcx/target/debug/coverage.lcov ${{ inputs.cov-file-path }} docker rm ${docker_id} > /dev/null docker rmi ${docker_image_id} > /dev/null shell: bash diff --git a/.github/actions/codecov-unit-tests/action.yml b/.github/actions/codecov-unit-tests/action.yml index 6004ab9fae..7937fc9e64 100644 --- a/.github/actions/codecov-unit-tests/action.yml +++ b/.github/actions/codecov-unit-tests/action.yml @@ -24,12 +24,12 @@ runs: -e RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \ -e RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \ ${{ inputs.docker-img-name }} \ - bash -c '(cd $HOME/libvcx && \ + bash -c '(cd $HOME/aries-vcx/libvcx && \ cargo test --features "general_test aries" && \ - grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ./target/debug/coverage.lcov)' + grcov ../target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ../target/debug/coverage.lcov)' docker_id=$(docker ps -a | grep libvcx-codecov-unit | grep Exited | tail -n 1 | cut -d ' ' -f 1) docker_image_id=$(docker images | grep codecov | perl -pe 's/\s+/ /g' | cut -d ' ' -f 3) - docker cp ${docker_id}:/home/indy/libvcx/target/debug/coverage.lcov ${{ inputs.cov-file-path }} + docker cp ${docker_id}:/home/indy/aries-vcx/target/debug/coverage.lcov ${{ inputs.cov-file-path }} docker rm ${docker_id} > /dev/null docker rmi ${docker_image_id} > /dev/null shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20898fb565..9f625a8b49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -469,7 +469,9 @@ jobs: set -x docker run --rm -i --name libvcx --network host $DOCKER_IMG_NAME_LIBVCX \ bash -c '(cd $HOME/libvcx && \ - RUST_TEST_THREADS=1 cargo test --release --features "general_test aries")' + RUST_TEST_THREADS=1 cargo test --release --features "general_test aries" && \ + cd $HOME/agency_client && \ + RUST_TEST_THREADS=1 cargo test --release --features "general_test")' test-libvcx-image-pool_tests: runs-on: ubuntu-latest diff --git a/libvcx/Cargo.lock b/Cargo.lock similarity index 89% rename from libvcx/Cargo.lock rename to Cargo.lock index 015e68b3df..d21fa673ad 100644 --- a/libvcx/Cargo.lock +++ b/Cargo.lock @@ -2,9 +2,9 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" +checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" dependencies = [ "gimli", ] @@ -15,11 +15,33 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +[[package]] +name = "agency_client" +version = "0.1.0" +dependencies = [ + "android_logger", + "env_logger", + "failure", + "futures", + "indy", + "lazy_static", + "libc", + "log", + "regex", + "reqwest", + "rmp-serde", + "rust-base58", + "serde", + "serde_derive", + "serde_json", + "url 1.7.2", +] + [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] @@ -60,18 +82,18 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" +checksum = "2baad346b2d4e94a24347adeee9c7a93f412ee94b9cc26e5b59dea23848e9f28" dependencies = [ "addr2line", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -122,9 +144,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.58" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" +checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40" [[package]] name = "cfg-if" @@ -132,6 +154,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chrono" version = "0.4.11" @@ -198,11 +226,11 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -222,8 +250,8 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.0.1", + "cfg-if 0.1.10", "crossbeam-utils", "lazy_static", "maybe-uninit", @@ -237,7 +265,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils", "maybe-uninit", ] @@ -248,8 +276,8 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.0.1", + "cfg-if 0.1.10", "lazy_static", ] @@ -261,17 +289,17 @@ checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.23" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" +checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -312,19 +340,19 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.19", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.38", + "syn 1.0.48", "synstructure", ] [[package]] name = "flate2" -version = "1.0.16" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" +checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crc32fast", "libc", "miniz_oxide", @@ -351,6 +379,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +dependencies = [ + "matches", + "percent-encoding 2.1.0", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -375,9 +413,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" [[package]] name = "futures-cpupool" @@ -391,20 +429,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "wasi", ] [[package]] name = "gimli" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" [[package]] name = "h2" @@ -426,12 +464,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" -dependencies = [ - "autocfg 1.0.0", -] +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "heck" @@ -444,9 +479,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] @@ -556,11 +591,11 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9" +checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "hashbrown", ] @@ -652,8 +687,9 @@ dependencies = [ [[package]] name = "libvcx" -version = "0.12.0" +version = "0.13.1" dependencies = [ + "agency_client", "android_logger", "base64 0.8.0", "chrono", @@ -701,7 +737,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -718,17 +754,17 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memoffset" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", ] [[package]] @@ -749,11 +785,12 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ "adler", + "autocfg 1.0.1", ] [[package]] @@ -762,7 +799,7 @@ version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -807,20 +844,20 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "winapi 0.3.9", ] [[package]] name = "num" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3e176191bc4faad357e3122c4747aa098ac880e88b168f106386128736cf4a" +checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" dependencies = [ "num-bigint", "num-complex", @@ -832,20 +869,20 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f3fc75e3697059fb1bc465e3d8cca6cf92f56854f201158b3f9c77d5a3cfa0" +checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05ad05bd8977050b171b3f6b48175fea6e0565b7981059b486075e1026a9fb5" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" dependencies = [ "num-traits", ] @@ -863,32 +900,32 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-integer", "num-traits", ] [[package]] name = "num-rational" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-bigint", "num-integer", "num-traits", @@ -896,11 +933,11 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", ] [[package]] @@ -915,9 +952,9 @@ dependencies = [ [[package]] name = "object" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" [[package]] name = "openssl" @@ -926,7 +963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" dependencies = [ "bitflags", - "cfg-if", + "cfg-if 0.1.10", "foreign-types", "lazy_static", "libc", @@ -945,7 +982,7 @@ version = "0.9.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "cc", "libc", "pkg-config", @@ -969,7 +1006,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", "libc", "redox_syscall", @@ -992,15 +1029,15 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro2" @@ -1013,9 +1050,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.19" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ "unicode-xid 0.2.1", ] @@ -1030,7 +1067,7 @@ dependencies = [ "idna 0.2.0", "lazy_static", "regex", - "url 2.1.1", + "url 2.2.0", ] [[package]] @@ -1054,7 +1091,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.19", + "proc-macro2 1.0.24", ] [[package]] @@ -1244,9 +1281,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "regex" -version = "1.3.9" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" dependencies = [ "aho-corasick", "memchr", @@ -1256,9 +1293,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" [[package]] name = "remove_dir_all" @@ -1335,9 +1372,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] name = "rustc_version" @@ -1415,29 +1452,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" dependencies = [ - "proc-macro2 1.0.19", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.38", + "syn 1.0.48", ] [[package]] name = "serde_json" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" +checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" dependencies = [ "itoa", "ryu", @@ -1493,9 +1530,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" dependencies = [ "heck", - "proc-macro2 1.0.19", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.38", + "syn 1.0.48", ] [[package]] @@ -1511,11 +1548,11 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.38" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" +checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" dependencies = [ - "proc-macro2 1.0.19", + "proc-macro2 1.0.24", "quote 1.0.7", "unicode-xid 0.2.1", ] @@ -1526,9 +1563,9 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ - "proc-macro2 1.0.19", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.38", + "syn 1.0.48", "unicode-xid 0.2.1", ] @@ -1538,7 +1575,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "rand 0.7.3", "redox_syscall", @@ -1577,9 +1614,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" [[package]] name = "tokio" @@ -1735,7 +1772,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -1796,10 +1833,11 @@ dependencies = [ [[package]] name = "url" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ + "form_urlencoded", "idna 0.2.0", "matches", "percent-encoding 2.1.0", diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000000..98e001514a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] + +members = [ + "libvcx", + "agency_client" +] + +[profile.release] +debug = true +panic = 'unwind' +incremental = false diff --git a/agency_client/Cargo.toml b/agency_client/Cargo.toml new file mode 100644 index 0000000000..2911ff3673 --- /dev/null +++ b/agency_client/Cargo.toml @@ -0,0 +1,49 @@ +[package] +name = "agency_client" +version = "0.1.0" +authors = ["Miroslav Kovar "] +edition = "2018" + +[features] +general_test = [] +to_restore = [] + +[dependencies] +env_logger = "0.5.10" +log = "0.4" +libc = "=0.2.66" +lazy_static = "1.3" +serde = "1.0.97" +serde_json = "1.0.40" +serde_derive = "1.0.97" +reqwest = "0.9.5" +regex = "1.1.0" +rmp-serde = "0.13.7" +rust-base58 = "0.0.4" +indy = "1.15.0" +futures = "0.1.23" +url = "1.5.1" +failure = "0.1.6" + +[target.'cfg(target_os = "android")'.dependencies] +android_logger = "0.5" + +[package.metadata.deb] +depends = "libindy (= 1.15.0)" +extended-description = """\ +This is the official SDK for Hyperledger Indy, which provides a\ + distributed-ledger-based foundation for self-sovereign identity.\ + The major artifact of the SDK is a c-callable library; there are\ + also convenience wrappers for various programming languages.\ + All bugs, stories, and backlog for this project are managed through\ + Hyperledger's Jira in project IS (note that regular Indy tickets are\ + in the INDY project instead...). Also, join us on Jira's Rocket.Chat\ + at #indy-sdk to discuss.""" +section = "devel" +priority = "optional" +assets = [ + ["target/release/libvcx.so", "usr/lib/", "644"], + ["include/vcx.h", "usr/share/libvcx/", "644"] +] +maintainer-scripts = "./debian" +changelog = "./debian/changelog" diff --git a/libvcx/src/agency_comm/agency_settings.rs b/agency_client/src/agency_settings.rs similarity index 68% rename from libvcx/src/agency_comm/agency_settings.rs rename to agency_client/src/agency_settings.rs index 5bdfbf8c24..f5b4188df8 100644 --- a/libvcx/src/agency_comm/agency_settings.rs +++ b/agency_client/src/agency_settings.rs @@ -5,8 +5,8 @@ use std::sync::RwLock; use serde_json::Value; use url::Url; -use error::{VcxError, VcxErrorKind, VcxResult}; -use utils::{error, validation}; +use crate::utils::error::{AgencyClientErrorKind, AgencyClientError, AgencyClientResult}; +use crate::utils::{error_utils, validation}; pub static CONFIG_AGENCY_ENDPOINT: &str = "agency_endpoint"; pub static CONFIG_AGENCY_DID: &str = "agency_did"; @@ -15,7 +15,7 @@ pub static CONFIG_REMOTE_TO_SDK_DID: &str = "remote_to_sdk_did"; pub static CONFIG_REMOTE_TO_SDK_VERKEY: &str = "remote_to_sdk_verkey"; pub static CONFIG_SDK_TO_REMOTE_DID: &str = "sdk_to_remote_did"; pub static CONFIG_SDK_TO_REMOTE_VERKEY: &str = "sdk_to_remote_verkey"; -static CONFIG_ENABLE_TEST_MODE: &str = "enable_test_mode"; +pub static CONFIG_ENABLE_TEST_MODE: &str = "enable_test_mode"; pub static VALID_AGENCY_CONFIG_KEYS: &[&str] = &[ CONFIG_AGENCY_ENDPOINT, @@ -33,22 +33,14 @@ lazy_static! { } -fn validate_mandatory_config_val(val: Option<&String>, err: VcxErrorKind, closure: F) -> VcxResult +fn validate_optional_config_val(val: Option<&String>, err: AgencyClientErrorKind, closure: F) -> AgencyClientResult where F: Fn(&str) -> Result { - closure(val.as_ref().ok_or(VcxError::from(err))?) - .or(Err(VcxError::from(err)))?; + if val.is_none() { return Ok(error_utils::SUCCESS.code_num); } - Ok(error::SUCCESS.code_num) -} - -fn validate_optional_config_val(val: Option<&String>, err: VcxErrorKind, closure: F) -> VcxResult - where F: Fn(&str) -> Result { - if val.is_none() { return Ok(error::SUCCESS.code_num); } - - closure(val.as_ref().ok_or(VcxError::from(VcxErrorKind::InvalidConfiguration))?) - .or(Err(VcxError::from(err)))?; + closure(val.as_ref().ok_or(AgencyClientError::from(AgencyClientErrorKind::InvalidConfiguration))?) + .or(Err(AgencyClientError::from(err)))?; - Ok(error::SUCCESS.code_num) + Ok(error_utils::SUCCESS.code_num) } pub fn set_testing_defaults_agency() -> u32 { @@ -69,7 +61,7 @@ pub fn set_testing_defaults_agency() -> u32 { agency_settings.insert(CONFIG_SDK_TO_REMOTE_DID.to_string(), DEFAULT_DID.to_string()); agency_settings.insert(CONFIG_SDK_TO_REMOTE_VERKEY.to_string(), DEFAULT_VERKEY.to_string()); - error::SUCCESS.code_num + error_utils::SUCCESS.code_num } pub fn clear_config_agency() { @@ -78,30 +70,30 @@ pub fn clear_config_agency() { config.clear(); } -pub fn validate_agency_config(config: &HashMap) -> VcxResult { +pub fn validate_agency_config(config: &HashMap) -> AgencyClientResult { trace!("validate_agency_config >>> config: {:?}", config); // todo: Since we scope these setting to agency module, these are not really optional anymore! - validate_optional_config_val(config.get(CONFIG_AGENCY_DID), VcxErrorKind::InvalidDid, validation::validate_did)?; - validate_optional_config_val(config.get(CONFIG_AGENCY_VERKEY), VcxErrorKind::InvalidVerkey, validation::validate_verkey)?; + validate_optional_config_val(config.get(CONFIG_AGENCY_DID), AgencyClientErrorKind::InvalidDid, validation::validate_did)?; + validate_optional_config_val(config.get(CONFIG_AGENCY_VERKEY), AgencyClientErrorKind::InvalidVerkey, validation::validate_verkey)?; - validate_optional_config_val(config.get(CONFIG_SDK_TO_REMOTE_DID), VcxErrorKind::InvalidDid, validation::validate_did)?; - validate_optional_config_val(config.get(CONFIG_SDK_TO_REMOTE_VERKEY), VcxErrorKind::InvalidVerkey, validation::validate_verkey)?; + validate_optional_config_val(config.get(CONFIG_SDK_TO_REMOTE_DID), AgencyClientErrorKind::InvalidDid, validation::validate_did)?; + validate_optional_config_val(config.get(CONFIG_SDK_TO_REMOTE_VERKEY), AgencyClientErrorKind::InvalidVerkey, validation::validate_verkey)?; - validate_optional_config_val(config.get(CONFIG_REMOTE_TO_SDK_DID), VcxErrorKind::InvalidDid, validation::validate_did)?; - validate_optional_config_val(config.get(CONFIG_REMOTE_TO_SDK_VERKEY), VcxErrorKind::InvalidVerkey, validation::validate_verkey)?; + validate_optional_config_val(config.get(CONFIG_REMOTE_TO_SDK_DID), AgencyClientErrorKind::InvalidDid, validation::validate_did)?; + validate_optional_config_val(config.get(CONFIG_REMOTE_TO_SDK_VERKEY), AgencyClientErrorKind::InvalidVerkey, validation::validate_verkey)?; - validate_optional_config_val(config.get(CONFIG_AGENCY_ENDPOINT), VcxErrorKind::InvalidUrl, Url::parse)?; + validate_optional_config_val(config.get(CONFIG_AGENCY_ENDPOINT), AgencyClientErrorKind::InvalidUrl, Url::parse)?; - Ok(error::SUCCESS.code_num) + Ok(error_utils::SUCCESS.code_num) } -pub fn process_agency_config_string(config: &str, do_validation: bool) -> VcxResult { +pub fn process_agency_config_string(config: &str, do_validation: bool) -> AgencyClientResult { trace!("process_config_string >>> config {}", config); let configuration: Value = serde_json::from_str(config) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot parse config: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot parse config: {}", err)))?; if let Value::Object(ref map) = configuration { for (key, value) in map { @@ -111,8 +103,8 @@ pub fn process_agency_config_string(config: &str, do_validation: bool) -> VcxRes match value { Value::String(value_) => set_config_value(key, &value_), Value::Bool(value_) => set_config_value(key, &json!(value_).to_string()), - _ => return Err(VcxError::from_msg(VcxErrorKind::InvalidJson, - format!("Invalid agency config value for key {}", key))), + _ => return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, + format!("Invalid agency config value for key {}", key))), } } } @@ -120,23 +112,22 @@ pub fn process_agency_config_string(config: &str, do_validation: bool) -> VcxRes if do_validation { let setting = AGENCY_SETTINGS.read() - .or(Err(VcxError::from(VcxErrorKind::InvalidConfiguration)))?; + .or(Err(AgencyClientError::from(AgencyClientErrorKind::InvalidConfiguration)))?; validate_agency_config(&setting.borrow()) } else { - Ok(error::SUCCESS.code_num) + Ok(error_utils::SUCCESS.code_num) } } - -pub fn get_config_value(key: &str) -> VcxResult { +pub fn get_config_value(key: &str) -> AgencyClientResult { trace!("get_config_value >>> key: {}", key); AGENCY_SETTINGS .read() - .or(Err(VcxError::from_msg(VcxErrorKind::InvalidConfiguration, "Cannot read AGENCY_SETTINGS")))? + .or(Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidConfiguration, "Cannot read AGENCY_SETTINGS")))? .get(key) .map(|v| v.to_string()) - .ok_or(VcxError::from_msg(VcxErrorKind::InvalidConfiguration, format!("Cannot read \"{}\" from AGENCY_SETTINGS", key))) + .ok_or(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidConfiguration, format!("Cannot read \"{}\" from AGENCY_SETTINGS", key))) } pub fn set_config_value(key: &str, value: &str) { @@ -149,5 +140,3 @@ pub fn set_config_value(key: &str, value: &str) { .insert(key.to_string(), value.to_string()); } } - - diff --git a/libvcx/src/agency_comm/get_message.rs b/agency_client/src/get_message.rs similarity index 74% rename from libvcx/src/agency_comm/get_message.rs rename to agency_client/src/get_message.rs index d376b17788..1e51b9c784 100644 --- a/libvcx/src/agency_comm/get_message.rs +++ b/agency_client/src/get_message.rs @@ -1,15 +1,8 @@ -use std::collections::HashMap; - -use agency_comm::{A2AMessage, A2AMessageKinds, A2AMessageV2, agency_settings, GeneralMessage, get_messages, MessageStatusCode, parse_response_from_agency, prepare_message_for_agency, prepare_message_for_agent, RemoteMessageType}; -use agency_comm::message_type::MessageTypes; -use agency_comm::utils::comm::post_to_agency; -use aries::handlers::connection::agent_info::AgentInfo; -use aries::messages::a2a::A2AMessage as AriesA2AMessage; -use aries::utils::encryption_envelope::EncryptionEnvelope; -use error::{VcxError, VcxErrorKind, VcxResult}; -use settings; -use utils::{constants, httpclient}; -use crate::agency_comm::mocking; +use crate::{get_messages, MessageStatusCode, prepare_message_for_agent, A2AMessageKinds, A2AMessageV2, A2AMessage, GeneralMessage, parse_response_from_agency, prepare_message_for_agency, agency_settings, mocking}; +use crate::utils::error::{AgencyClientResult, AgencyClientErrorKind, AgencyClientError}; +use crate::utils::encryption_envelope::EncryptionEnvelope; +use crate::utils::comm::post_to_agency; +use crate::message_type::MessageTypes; #[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] #[serde(rename_all = "camelCase")] @@ -99,30 +92,30 @@ impl GetMessagesBuilder { GetMessagesBuilder::create() } - pub fn uid(&mut self, uids: Option>) -> VcxResult<&mut Self> { + pub fn uid(&mut self, uids: Option>) -> AgencyClientResult<&mut Self> { //Todo: validate msg_uid?? self.uids = uids; Ok(self) } - pub fn status_codes(&mut self, status_codes: Option>) -> VcxResult<&mut Self> { + pub fn status_codes(&mut self, status_codes: Option>) -> AgencyClientResult<&mut Self> { self.status_codes = status_codes; Ok(self) } - pub fn pairwise_dids(&mut self, pairwise_dids: Option>) -> VcxResult<&mut Self> { + pub fn pairwise_dids(&mut self, pairwise_dids: Option>) -> AgencyClientResult<&mut Self> { //Todo: validate msg_uid?? self.pairwise_dids = pairwise_dids; Ok(self) } - pub fn include_edge_payload(&mut self, payload: &str) -> VcxResult<&mut Self> { + pub fn include_edge_payload(&mut self, payload: &str) -> AgencyClientResult<&mut Self> { //todo: is this a json value, String?? self.exclude_payload = Some(payload.to_string()); Ok(self) } - pub fn send_secure(&mut self) -> VcxResult> { + pub fn send_secure(&mut self) -> AgencyClientResult> { debug!("GetMessages::send >>> self.agent_vk={} self.agent_did={} self.to_did={} self.to_vk={}", self.agent_vk, self.agent_did, self.to_did, self.to_vk); let data = self.prepare_request()?; @@ -132,7 +125,7 @@ impl GetMessagesBuilder { self.parse_response(response) } - fn parse_response(&self, response: Vec) -> VcxResult> { + fn parse_response(&self, response: Vec) -> AgencyClientResult> { trace!("parse_get_messages_response >>> processing payload of {} bytes", response.len()); let mut response = parse_response_from_agency(&response)?; @@ -144,11 +137,11 @@ impl GetMessagesBuilder { trace!("Interpreting response as V2"); Ok(res.msgs) } - _ => Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of GetMessagesResponse")) + _ => Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of GetMessagesResponse")) } } - pub fn download_messages_noauth(&mut self) -> VcxResult> { + pub fn download_messages_noauth(&mut self) -> AgencyClientResult> { trace!("GetMessages::download >>>"); let data = self.prepare_download_request()?; @@ -164,7 +157,7 @@ impl GetMessagesBuilder { Ok(response) } - fn prepare_download_request(&self) -> VcxResult> { + fn prepare_download_request(&self) -> AgencyClientResult> { let message = A2AMessage::Version2( A2AMessageV2::GetMessages( GetMessages::build(A2AMessageKinds::GetMessagesByConnections, @@ -180,14 +173,14 @@ impl GetMessagesBuilder { } // todo: This should be removed after public method vcx_messages_download is removed - fn parse_download_messages_response_noauth(&self, response: Vec) -> VcxResult> { + fn parse_download_messages_response_noauth(&self, response: Vec) -> AgencyClientResult> { trace!("parse_download_messages_response >>>"); let mut response = parse_response_from_agency(&response)?; trace!("parse_download_messages_response: parsed response {:?}", response); let msgs = match response.remove(0) { A2AMessage::Version2(A2AMessageV2::GetMessagesByConnectionsResponse(res)) => res.msgs, - _ => return Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of GetMessagesByConnectionsResponse")) + _ => return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of GetMessagesByConnectionsResponse")) }; msgs @@ -211,7 +204,7 @@ impl GeneralMessage for GetMessagesBuilder { fn set_agent_did(&mut self, did: String) { self.agent_did = did; } fn set_agent_vk(&mut self, vk: String) { self.agent_vk = vk; } - fn prepare_request(&mut self) -> VcxResult> { + fn prepare_request(&mut self) -> AgencyClientResult> { debug!("prepare_request >>"); let message = A2AMessage::Version2( A2AMessageV2::GetMessages( @@ -262,10 +255,10 @@ macro_rules! convert_aries_message { } impl Message { - pub fn payload(&self) -> VcxResult> { + pub fn payload(&self) -> AgencyClientResult> { match self.payload { - Some(MessagePayload::V2(ref payload)) => serde_json::to_vec(payload).map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, err)), - _ => Err(VcxError::from(VcxErrorKind::InvalidState)), + Some(MessagePayload::V2(ref payload)) => serde_json::to_vec(payload).map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, err)), + _ => Err(AgencyClientError::from(AgencyClientErrorKind::InvalidState)), } } @@ -280,26 +273,25 @@ impl Message { new_message } - pub fn decrypt_auth(&self, expected_sender_vk: &str) -> VcxResult { + pub fn decrypt_auth(&self, expected_sender_vk: &str) -> AgencyClientResult { let mut new_message = self.clone(); let decrypted_msg = self._auth_decrypt_v3_message(expected_sender_vk)?; + trace!("decrypt_auth >>> decrypted_msg: {:?}", decrypted_msg); new_message.decrypted_msg = Some(decrypted_msg); new_message.payload = None; Ok(new_message) } - fn _noauth_decrypt_v3_message(&self) -> VcxResult { - let a2a_message = EncryptionEnvelope::anon_unpack(self.payload()?)?; - Ok(json!(&a2a_message).to_string()) + fn _noauth_decrypt_v3_message(&self) -> AgencyClientResult { + EncryptionEnvelope::anon_unpack(self.payload()?) } - fn _auth_decrypt_v3_message(&self, expected_sender_vk: &str) -> VcxResult { - let a2a_message = EncryptionEnvelope::auth_unpack(self.payload()?, &expected_sender_vk)?; - Ok(json!(&a2a_message).to_string()) + fn _auth_decrypt_v3_message(&self, expected_sender_vk: &str) -> AgencyClientResult { + EncryptionEnvelope::auth_unpack(self.payload()?, &expected_sender_vk) } } -pub fn get_connection_messages(pw_did: &str, pw_vk: &str, agent_did: &str, agent_vk: &str, msg_uid: Option>, status_codes: Option>) -> VcxResult> { +pub fn get_connection_messages(pw_did: &str, pw_vk: &str, agent_did: &str, agent_vk: &str, msg_uid: Option>, status_codes: Option>) -> AgencyClientResult> { trace!("get_connection_messages >>> pw_did: {}, pw_vk: {}, agent_vk: {}, msg_uid: {:?}", pw_did, pw_vk, agent_vk, msg_uid); @@ -311,51 +303,39 @@ pub fn get_connection_messages(pw_did: &str, pw_vk: &str, agent_did: &str, agent .uid(msg_uid)? .status_codes(status_codes)? .send_secure() - .map_err(|err| err.map(VcxErrorKind::PostMessageFailed, "Cannot get messages"))?; + .map_err(|err| err.map(AgencyClientErrorKind::PostMessageFailed, "Cannot get messages"))?; trace!("message returned: {:?}", response); Ok(response) } -pub fn get_bootstrap_agent_messages(remote_vk: VcxResult, bootstrap_agent_info: Option<&AgentInfo>) -> VcxResult, AgentInfo)>> { - let expected_sender_vk = match remote_vk { - Ok(vk) => vk, - Err(_) => return Ok(None) - }; - if let Some(bootstrap_agent_info) = bootstrap_agent_info { - let messages = bootstrap_agent_info.get_messages(&expected_sender_vk)?; - return Ok(Some((messages, bootstrap_agent_info.clone()))); - } - Ok(None) -} - -pub fn parse_status_codes(status_codes: Option>) -> VcxResult>> { +pub fn parse_status_codes(status_codes: Option>) -> AgencyClientResult>> { match status_codes { Some(codes) => { let codes = codes .iter() .map(|code| ::serde_json::from_str::(&format!("\"{}\"", code)) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot parse message status code: {}", err))) - ).collect::>>()?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot parse message status code: {}", err))) + ).collect::>>()?; Ok(Some(codes)) } None => Ok(None) } } -pub fn parse_connection_handles(conn_handles: Vec) -> VcxResult> { +pub fn parse_connection_handles(conn_handles: Vec) -> AgencyClientResult> { trace!("parse_connection_handles >>> conn_handles: {:?}", conn_handles); let codes = conn_handles .iter() .map(|handle| ::serde_json::from_str::(handle) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot parse connection handles: {}", err))) - ).collect::>>()?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot parse connection handles: {}", err))) + ).collect::>>()?; Ok(codes) } -pub fn download_messages_noauth(pairwise_dids: Option>, status_codes: Option>, uids: Option>) -> VcxResult> { +pub fn download_messages_noauth(pairwise_dids: Option>, status_codes: Option>, uids: Option>) -> AgencyClientResult> { trace!("download_messages_noauth >>> pairwise_dids: {:?}, status_codes: {:?}, uids: {:?}", pairwise_dids, status_codes, uids); @@ -370,4 +350,4 @@ pub fn download_messages_noauth(pairwise_dids: Option>, status_codes trace!("message returned: {:?}", response); Ok(response) -} \ No newline at end of file +} diff --git a/libvcx/src/utils/httpclient.rs b/agency_client/src/httpclient.rs similarity index 60% rename from libvcx/src/utils/httpclient.rs rename to agency_client/src/httpclient.rs index 2987174d9a..a29db1163a 100644 --- a/libvcx/src/utils/httpclient.rs +++ b/agency_client/src/httpclient.rs @@ -1,42 +1,14 @@ use std::env; use std::io::Read; -use std::sync::Mutex; use reqwest; use reqwest::header::CONTENT_TYPE; -use agency_comm::agency_settings; -use agency_comm::mocking::{AgencyMock, AgencyMockDecrypted}; -use error::prelude::*; -use settings; -use crate::agency_comm::mocking; +use crate::utils::error::{AgencyClientErrorKind, AgencyClientError, AgencyClientResult}; +use crate::mocking::{AgencyMock, AgencyMockDecrypted, HttpClientMockResponse}; +use crate::mocking; -lazy_static! { - static ref HTTPCLIENT_MOCK_RESPONSES: Mutex = Mutex::new(HttpClientMockResponse::default()); -} - -#[derive(Default)] -pub struct HttpClientMockResponse { - responses: Vec>> -} - -impl HttpClientMockResponse { - pub fn set_next_response(response: VcxResult>) { - if mocking::agency_mocks_enabled() { - HTTPCLIENT_MOCK_RESPONSES.lock().unwrap().responses.push(response); - } - } - - pub fn has_response() -> bool { - HTTPCLIENT_MOCK_RESPONSES.lock().unwrap().responses.len() > 0 - } - - pub fn get_response() -> VcxResult> { - HTTPCLIENT_MOCK_RESPONSES.lock().unwrap().responses.pop().unwrap() - } -} - -pub fn post_message(body_content: &Vec, url: &str) -> VcxResult> { +pub fn post_message(body_content: &Vec, url: &str) -> AgencyClientResult> { // todo: this function should be general, not knowing that agency exists -> move agency mocks to agency module if mocking::agency_mocks_enabled() { if HttpClientMockResponse::has_response() { @@ -57,9 +29,9 @@ pub fn post_message(body_content: &Vec, url: &str) -> VcxResult> { info!("::Android code"); set_ssl_cert_location(); } - let client = reqwest::ClientBuilder::new().timeout(::utils::timeout::TimeoutUtils::long_timeout()).build().map_err(|err| { + let client = reqwest::ClientBuilder::new().timeout(crate::utils::timeout::TimeoutUtils::long_timeout()).build().map_err(|err| { error!("error: {}", err); - VcxError::from_msg(VcxErrorKind::PostMessageFailed, format!("Building reqwest client failed: {:?}", err)) + AgencyClientError::from_msg(AgencyClientErrorKind::PostMessageFailed, format!("Building reqwest client failed: {:?}", err)) })?; debug!("Posting encrypted bundle to: \"{}\"", url); @@ -70,7 +42,7 @@ pub fn post_message(body_content: &Vec, url: &str) -> VcxResult> { .send() .map_err(|err| { error!("error: {}", err); - VcxError::from_msg(VcxErrorKind::PostMessageFailed, format!("Could not connect {:?}", err)) + AgencyClientError::from_msg(AgencyClientErrorKind::PostMessageFailed, format!("Could not connect {:?}", err)) })?; trace!("Response Header: {:?}", response); @@ -80,12 +52,12 @@ pub fn post_message(body_content: &Vec, url: &str) -> VcxResult> { Ok(_) => info!("Request failed: {}", content), Err(_) => info!("could not read response"), }; - return Err(VcxError::from_msg(VcxErrorKind::PostMessageFailed, format!("POST failed with: {}", content))); + return Err(AgencyClientError::from_msg(AgencyClientErrorKind::PostMessageFailed, format!("POST failed with: {}", content))); } let mut content = Vec::new(); response.read_to_end(&mut content) - .or(Err(VcxError::from_msg(VcxErrorKind::PostMessageFailed, "could not read response")))?; + .or(Err(AgencyClientError::from_msg(AgencyClientErrorKind::PostMessageFailed, "could not read response")))?; Ok(content) } diff --git a/libvcx/src/agency_comm/mod.rs b/agency_client/src/lib.rs similarity index 84% rename from libvcx/src/agency_comm/mod.rs rename to agency_client/src/lib.rs index 509ef904a1..7f93e76b56 100644 --- a/libvcx/src/agency_comm/mod.rs +++ b/agency_client/src/lib.rs @@ -1,34 +1,49 @@ +#![crate_name = "agency_client"] +extern crate failure; +extern crate futures; +extern crate indyrs as indy; +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +extern crate libc; +extern crate reqwest; +extern crate rmp_serde; +extern crate serde; +#[macro_use] +extern crate serde_derive; +#[macro_use] +extern crate serde_json; +extern crate url; + use std::u8; use serde::{de, Deserialize, Deserializer, ser, Serialize, Serializer}; use serde_json::Value; -use ::{log, settings}; -use error::prelude::*; -use libindy::utils::crypto; -use utils::validation; +use self::utils::error::prelude::*; +use self::utils::libindy::crypto; use self::utils::agent_utils::{ComMethodUpdated, Connect, ConnectResponse, CreateAgent, CreateAgentResponse, SignUp, SignUpResponse, UpdateComMethod}; -use self::create_key::{CreateKey, CreateKeyBuilder, CreateKeyResponse}; +use self::utils::validation; +use self::utils::create_key::{CreateKey, CreateKeyBuilder, CreateKeyResponse}; use self::get_message::{GetMessages, GetMessagesBuilder, GetMessagesResponse, MessagesByConnections}; use self::message_type::*; use self::update_connection::{DeleteConnectionBuilder, UpdateConnection, UpdateConnectionResponse}; use self::update_message::{UpdateMessageStatusByConnections, UpdateMessageStatusByConnectionsResponse}; -use self::update_profile::{UpdateConfigs, UpdateConfigsResponse, UpdateProfileDataBuilder}; -use agency_comm::mocking::AgencyMockDecrypted; +use self::utils::update_profile::{UpdateConfigs, UpdateConfigsResponse, UpdateProfileDataBuilder}; +use self::mocking::AgencyMockDecrypted; -pub mod create_key; pub mod get_message; -pub mod update_profile; pub mod utils; pub mod update_connection; pub mod update_message; pub mod message_type; pub mod payload; #[macro_use] -pub mod thread; pub mod agency_settings; pub mod mocking; +pub mod httpclient; #[derive(Debug, Serialize)] #[serde(untagged)] @@ -71,7 +86,7 @@ pub enum A2AMessageV2 { impl<'de> Deserialize<'de> for A2AMessageV2 { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { let value = Value::deserialize(deserializer).map_err(de::Error::custom)?; - let message_type: MessageTypeV2 = serde_json::from_value(value["@type"].clone()).map_err(de::Error::custom)?; + let message_type: MessageType = serde_json::from_value(value["@type"].clone()).map_err(de::Error::custom)?; if log::log_enabled!(log::Level::Trace) { let message_json = serde_json::ser::to_string(&value); @@ -203,6 +218,7 @@ impl<'de> Deserialize<'de> for A2AMessageV2 { } } +// We don't want to use this anymore #[derive(Debug)] pub enum A2AMessage { Version2(A2AMessageV2), @@ -231,7 +247,7 @@ impl<'de> Deserialize<'de> for A2AMessage { } match message_type { - MessageTypes::MessageTypeV2(_) => + MessageTypes::MessageType(_) => A2AMessageV2::deserialize(value) .map(A2AMessage::Version2) .map_err(de::Error::custom) @@ -243,7 +259,7 @@ impl<'de> Deserialize<'de> for A2AMessage { #[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] pub struct ForwardV2 { #[serde(rename = "@type")] - msg_type: MessageTypeV2, + msg_type: MessageType, #[serde(rename = "@fwd")] fwd: String, #[serde(rename = "@msg")] @@ -251,9 +267,9 @@ pub struct ForwardV2 { } impl ForwardV2 { - fn new(fwd: String, msg: Vec) -> VcxResult { + fn new(fwd: String, msg: Vec) -> AgencyClientResult { let msg = serde_json::from_slice(msg.as_slice()) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidState, err))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidState, err))?; Ok(A2AMessage::Version2(A2AMessageV2::Forward( ForwardV2 { @@ -269,7 +285,7 @@ impl ForwardV2 { #[serde(rename_all = "camelCase")] pub struct SendRemoteMessage { #[serde(rename = "@type")] - pub msg_type: MessageTypeV2, + pub msg_type: MessageType, #[serde(rename = "@id")] pub id: String, pub mtype: RemoteMessageType, @@ -497,36 +513,37 @@ impl A2AMessageKinds { } } -pub fn prepare_message_for_agency(message: &A2AMessage, agency_did: &str) -> VcxResult> { +pub fn prepare_message_for_agency(message: &A2AMessage, agency_did: &str) -> AgencyClientResult> { pack_for_agency_v2(message, agency_did) } -fn pack_for_agency_v2(message: &A2AMessage, agency_did: &str) -> VcxResult> { +fn pack_for_agency_v2(message: &A2AMessage, agency_did: &str) -> AgencyClientResult> { + trace!("pack_for_agency_v2 >>>"); let agent_vk = agency_settings::get_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_VERKEY)?; let my_vk = agency_settings::get_config_value(agency_settings::CONFIG_SDK_TO_REMOTE_VERKEY)?; let message = ::serde_json::to_string(&message) - .map_err(|err| VcxError::from_msg(VcxErrorKind::SerializationError, format!("Cannot serialize A2A message: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, format!("Cannot serialize A2A message: {}", err)))?; let receiver_keys = ::serde_json::to_string(&vec![&agent_vk]) - .map_err(|err| VcxError::from_msg(VcxErrorKind::SerializationError, format!("Cannot serialize receiver keys: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, format!("Cannot serialize receiver keys: {}", err)))?; let message = crypto::pack_message(Some(&my_vk), &receiver_keys, message.as_bytes())?; prepare_forward_message(message, agency_did) } -pub fn parse_message_from_response(response: &Vec) -> VcxResult { +pub fn parse_message_from_response(response: &Vec) -> AgencyClientResult { let unpacked_msg = crypto::unpack_message(&response[..])?; let message: Value = ::serde_json::from_slice(unpacked_msg.as_slice()) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot deserialize response: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot deserialize response: {}", err)))?; Ok(message["message"].as_str() - .ok_or(VcxError::from_msg(VcxErrorKind::InvalidJson, "Cannot find `message` field on response"))?.to_string()) + .ok_or(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, "Cannot find `message` field on response"))?.to_string()) } -fn parse_response_from_agency(response: &Vec) -> VcxResult> { +fn parse_response_from_agency(response: &Vec) -> AgencyClientResult> { trace!("parse_response_from_agency >>> processing payload of {} bytes", response.len()); let message: String = if AgencyMockDecrypted::has_decrypted_mock_responses() { @@ -539,7 +556,7 @@ fn parse_response_from_agency(response: &Vec) -> VcxResult> trace!("AgencyComm Inbound V2 A2AMessage: {}", message); let message: A2AMessage = serde_json::from_str(&message) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot deserialize A2A message: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot deserialize A2A message: {}", err)))?; Ok(vec![message]) } @@ -558,21 +575,21 @@ impl Bundled { } } - pub fn encode(&self) -> VcxResult> where T: serde::Serialize { + pub fn encode(&self) -> AgencyClientResult> where T: serde::Serialize { rmp_serde::to_vec_named(self) .map_err(|err| { error!("Could not convert bundle to messagepack: {}", err); - VcxError::from_msg(VcxErrorKind::InvalidMessagePack, format!("Could not encode bundle: {}", err)) + AgencyClientError::from_msg(AgencyClientErrorKind::InvalidMessagePack, format!("Could not encode bundle: {}", err)) }) } } -pub fn try_i8_bundle(data: Vec) -> VcxResult>> { +pub fn try_i8_bundle(data: Vec) -> AgencyClientResult>> { let bundle: Bundled> = rmp_serde::from_slice(&data[..]) .map_err(|_| { trace!("could not deserialize bundle with i8, will try u8"); - VcxError::from_msg(VcxErrorKind::InvalidMessagePack, "Could not deserialize bundle with i8") + AgencyClientError::from_msg(AgencyClientErrorKind::InvalidMessagePack, "Could not deserialize bundle with i8") })?; let mut new_bundle: Bundled> = Bundled { bundled: Vec::new() }; @@ -592,46 +609,47 @@ pub fn to_i8(bytes: &Vec) -> Vec { bytes.iter().map(|i| *i as i8).collect() } -pub fn bundle_from_u8(data: Vec) -> VcxResult>> { +pub fn bundle_from_u8(data: Vec) -> AgencyClientResult>> { try_i8_bundle(data.clone()) .or_else(|_| rmp_serde::from_slice::>>(&data[..])) .map_err(|err| { error!("could not deserialize bundle with i8 or u8: {}", err); - VcxError::from_msg(VcxErrorKind::InvalidMessagePack, "Could not deserialize bundle with i8 or u8") + AgencyClientError::from_msg(AgencyClientErrorKind::InvalidMessagePack, "Could not deserialize bundle with i8 or u8") }) } -fn prepare_forward_message(message: Vec, did: &str) -> VcxResult> { +fn prepare_forward_message(message: Vec, did: &str) -> AgencyClientResult> { + trace!("prepare_forward_message >>>"); let agency_vk = agency_settings::get_config_value(agency_settings::CONFIG_AGENCY_VERKEY)?; let message = ForwardV2::new(did.to_string(), message)?; match message { A2AMessage::Version2(A2AMessageV2::Forward(msg)) => prepare_forward_message_for_agency_v2(&msg, &agency_vk), - _ => Err(VcxError::from_msg(VcxErrorKind::InvalidState, "Invalid message type")) + _ => Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidState, "Invalid message type")) } } -fn prepare_forward_message_for_agency_v2(message: &ForwardV2, agency_vk: &str) -> VcxResult> { +fn prepare_forward_message_for_agency_v2(message: &ForwardV2, agency_vk: &str) -> AgencyClientResult> { let message = serde_json::to_string(message) - .map_err(|err| VcxError::from_msg(VcxErrorKind::SerializationError, format!("Cannot serialize Forward message: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, format!("Cannot serialize Forward message: {}", err)))?; let receiver_keys = serde_json::to_string(&vec![agency_vk]) - .map_err(|err| VcxError::from_msg(VcxErrorKind::SerializationError, format!("Cannot serialize receiver keys: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, format!("Cannot serialize receiver keys: {}", err)))?; crypto::pack_message(None, &receiver_keys, message.as_bytes()) } -fn prepare_message_for_agent(messages: Vec, pw_vk: &str, agent_did: &str, agent_vk: &str) -> VcxResult> { +fn prepare_message_for_agent(messages: Vec, pw_vk: &str, agent_did: &str, agent_vk: &str) -> AgencyClientResult> { debug!("prepare_message_for_agent >> {:?}", messages); let message = messages.get(0) - .ok_or(VcxError::from_msg(VcxErrorKind::SerializationError, "Cannot get message"))?; + .ok_or(AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, "Cannot get message"))?; let message = serde_json::to_string(message) - .map_err(|err| VcxError::from_msg(VcxErrorKind::SerializationError, format!("Cannot serialize A2A message: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, format!("Cannot serialize A2A message: {}", err)))?; let receiver_keys = serde_json::to_string(&vec![&agent_vk]) - .map_err(|err| VcxError::from_msg(VcxErrorKind::SerializationError, format!("Cannot receiver keys: {}", err)))?; + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::SerializationError, format!("Cannot receiver keys: {}", err)))?; let message = crypto::pack_message(Some(pw_vk), &receiver_keys, message.as_bytes())?; @@ -648,25 +666,25 @@ pub trait GeneralMessage { //todo: deserialize_message - fn to(&mut self, to_did: &str) -> VcxResult<&mut Self> { + fn to(&mut self, to_did: &str) -> AgencyClientResult<&mut Self> { validation::validate_did(to_did)?; self.set_to_did(to_did.to_string()); Ok(self) } - fn to_vk(&mut self, to_vk: &str) -> VcxResult<&mut Self> { + fn to_vk(&mut self, to_vk: &str) -> AgencyClientResult<&mut Self> { validation::validate_verkey(to_vk)?; self.set_to_vk(to_vk.to_string()); Ok(self) } - fn agent_did(&mut self, did: &str) -> VcxResult<&mut Self> { + fn agent_did(&mut self, did: &str) -> AgencyClientResult<&mut Self> { validation::validate_did(did)?; self.set_agent_did(did.to_string()); Ok(self) } - fn agent_vk(&mut self, to_vk: &str) -> VcxResult<&mut Self> { + fn agent_vk(&mut self, to_vk: &str) -> AgencyClientResult<&mut Self> { validation::validate_verkey(to_vk)?; self.set_agent_vk(to_vk.to_string()); Ok(self) @@ -677,7 +695,7 @@ pub trait GeneralMessage { fn set_agent_did(&mut self, did: String); fn set_agent_vk(&mut self, vk: String); - fn prepare_request(&mut self) -> VcxResult>; + fn prepare_request(&mut self) -> AgencyClientResult>; } #[derive(Debug, Serialize, Deserialize)] @@ -691,14 +709,14 @@ impl<'a, 'de, T> ObjectWithVersion<'a, T> where T: ::serde::Serialize + ::serde: ObjectWithVersion { version, data } } - pub fn serialize(&self) -> VcxResult { + pub fn serialize(&self) -> AgencyClientResult { ::serde_json::to_string(self) - .to_vcx(VcxErrorKind::InvalidState, "Cannot serialize object") + .to_vcx(AgencyClientErrorKind::InvalidState, "Cannot serialize object") } - pub fn deserialize(data: &str) -> VcxResult> where T: ::serde::de::DeserializeOwned { + pub fn deserialize(data: &str) -> AgencyClientResult> where T: ::serde::de::DeserializeOwned { ::serde_json::from_str(data) - .to_vcx(VcxErrorKind::InvalidJson, "Cannot deserialize object") + .to_vcx(AgencyClientErrorKind::InvalidJson, "Cannot deserialize object") } } @@ -706,11 +724,7 @@ impl<'a, 'de, T> ObjectWithVersion<'a, T> where T: ::serde::Serialize + ::serde: #[serde(tag = "version")] pub enum SerializableObjectWithState { #[serde(rename = "1.0")] - V1 { data: T }, - #[serde(rename = "2.0")] - V2 { data: T, state: P }, - #[serde(rename = "3.0")] - V3 { data: T, state: P, source_id: String }, + V1 { data: T, state: P, source_id: String }, } pub fn create_keys() -> CreateKeyBuilder { CreateKeyBuilder::create() } @@ -723,15 +737,11 @@ pub fn get_messages() -> GetMessagesBuilder { GetMessagesBuilder::create() } #[cfg(test)] pub mod tests { - use utils::devsetup::*; - use super::*; #[test] #[cfg(feature = "general_test")] fn test_to_u8() { - let _setup = SetupDefaults::init(); - let vec: Vec = vec![-127, -89, 98, 117, 110, 100, 108, 101, 100, -111, -36, 5, -74]; let buf = to_u8(&vec); @@ -741,8 +751,6 @@ pub mod tests { #[test] #[cfg(feature = "general_test")] fn test_to_i8() { - let _setup = SetupDefaults::init(); - let vec: Vec = vec![129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 19, 13]; let buf = to_i8(&vec); info!("new bundle: {:?}", buf); diff --git a/libvcx/src/agency_comm/message_type.rs b/agency_client/src/message_type.rs similarity index 80% rename from libvcx/src/agency_comm/message_type.rs rename to agency_client/src/message_type.rs index 40e060666e..f93bf27b73 100644 --- a/libvcx/src/agency_comm/message_type.rs +++ b/agency_client/src/message_type.rs @@ -2,9 +2,8 @@ use regex::{Match, Regex}; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value; -use agency_comm::A2AMessageKinds; -use error::prelude::*; -use settings; +use crate::utils::error::{AgencyClientErrorKind, AgencyClientError, AgencyClientResult}; +use crate::A2AMessageKinds; pub const MESSAGE_VERSION_V1: &str = "1.0"; pub const DID: &str = "did:sov:123456789abcdefghi1234"; @@ -12,19 +11,12 @@ pub const DID: &str = "did:sov:123456789abcdefghi1234"; #[derive(Debug, Deserialize, Serialize, Clone, PartialEq)] #[serde(untagged)] pub enum MessageTypes { - MessageTypeV2(MessageTypeV2), + MessageType(MessageType), } impl MessageTypes { - pub fn build_v1(kind: A2AMessageKinds) -> MessageTypeV1 { - MessageTypeV1 { - name: kind.name(), - ver: MESSAGE_VERSION_V1.to_string(), - } - } - - pub fn build_v2(kind: A2AMessageKinds) -> MessageTypeV2 { - MessageTypeV2 { + pub fn build_v2(kind: A2AMessageKinds) -> MessageType { + MessageType { did: DID.to_string(), family: kind.family(), version: kind.family().version().to_string(), @@ -33,24 +25,18 @@ impl MessageTypes { } pub fn build(kind: A2AMessageKinds) -> MessageTypes { - MessageTypes::MessageTypeV2(MessageTypes::build_v2(kind)) + MessageTypes::MessageType(MessageTypes::build_v2(kind)) } pub fn name<'a>(&'a self) -> &'a str { match self { - MessageTypes::MessageTypeV2(type_) => type_.type_.as_str(), + MessageTypes::MessageType(type_) => type_.type_.as_str(), } } } -#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] -pub struct MessageTypeV1 { - pub name: String, - pub ver: String, -} - #[derive(Debug, Clone, PartialEq)] -pub struct MessageTypeV2 { +pub struct MessageType { pub did: String, pub family: MessageFamilies, pub version: String, @@ -107,7 +93,7 @@ impl ::std::string::ToString for MessageFamilies { } -pub fn parse_message_type(message_type: &str) -> VcxResult<(String, String, String, String)> { +pub fn parse_message_type(message_type: &str) -> AgencyClientResult<(String, String, String, String)> { lazy_static! { static ref RE: Regex = Regex::new(r"(?x) (?P[\d\w:]*); @@ -129,17 +115,17 @@ pub fn parse_message_type(message_type: &str) -> VcxResult<(String, String, Stri Some((did.to_string(), family.to_string(), version.to_string(), type_.to_string())), _ => None } - }).ok_or(VcxError::from_msg(VcxErrorKind::InvalidOption, "Cannot parse @type")) + }).ok_or(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidOption, "Cannot parse @type")) } -impl<'de> Deserialize<'de> for MessageTypeV2 { +impl<'de> Deserialize<'de> for MessageType { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { let value = Value::deserialize(deserializer).map_err(de::Error::custom)?; match value.as_str() { Some(type_) => { let (did, family, version, type_) = parse_message_type(type_).map_err(de::Error::custom)?; - Ok(MessageTypeV2 { + Ok(MessageType { did, family: MessageFamilies::from(family), version, @@ -151,9 +137,9 @@ impl<'de> Deserialize<'de> for MessageTypeV2 { } } -impl Serialize for MessageTypeV2 { +impl Serialize for MessageType { fn serialize(&self, serializer: S) -> Result where S: Serializer { let value = Value::String(format!("{};spec/{}/{}/{}", self.did, self.family.to_string(), self.version, self.type_)); value.serialize(serializer) } -} \ No newline at end of file +} diff --git a/libvcx/src/agency_comm/mocking.rs b/agency_client/src/mocking.rs similarity index 69% rename from libvcx/src/agency_comm/mocking.rs rename to agency_client/src/mocking.rs index 16d790fbe9..d34e460555 100644 --- a/libvcx/src/agency_comm/mocking.rs +++ b/agency_client/src/mocking.rs @@ -1,8 +1,7 @@ use std::sync::Mutex; -use agency_comm::agency_settings; -use settings; -use settings::CONFIG_ENABLE_TEST_MODE; +use crate::utils::error::AgencyClientResult; +use crate::agency_settings; lazy_static! { static ref AGENCY_MOCK: Mutex = Mutex::new(AgencyMock::default()); @@ -10,6 +9,31 @@ lazy_static! { static ref AGENCY_MOCK_DECRYPTED_MESSAGES: Mutex = Mutex::new(AgencyMockDecryptedMessages::default()); } +lazy_static! { + static ref HTTPCLIENT_MOCK_RESPONSES: Mutex = Mutex::new(HttpClientMockResponse::default()); +} + +#[derive(Default)] +pub struct HttpClientMockResponse { + responses: Vec>> +} + +impl HttpClientMockResponse { + pub fn set_next_response(response: AgencyClientResult>) { + if agency_mocks_enabled() { + HTTPCLIENT_MOCK_RESPONSES.lock().unwrap().responses.push(response); + } + } + + pub fn has_response() -> bool { + HTTPCLIENT_MOCK_RESPONSES.lock().unwrap().responses.len() > 0 + } + + pub fn get_response() -> AgencyClientResult> { + HTTPCLIENT_MOCK_RESPONSES.lock().unwrap().responses.pop().unwrap() + } +} + #[derive(Default)] pub struct AgencyMockDecryptedMessages { messages: Vec @@ -82,16 +106,23 @@ impl AgencyMockDecrypted { } pub fn agency_mocks_enabled() -> bool { - match agency_settings::get_config_value(CONFIG_ENABLE_TEST_MODE).ok() { + match agency_settings::get_config_value(agency_settings::CONFIG_ENABLE_TEST_MODE).ok() { None => false, Some(value) => value == "true" || value == "agency" } } pub fn agency_decrypted_mocks_enabled() -> bool { - match agency_settings::get_config_value(CONFIG_ENABLE_TEST_MODE).ok() { + match agency_settings::get_config_value(agency_settings::CONFIG_ENABLE_TEST_MODE).ok() { None => false, Some(value) => value == "true" } } +pub fn enable_agency_mocks() { + agency_settings::set_config_value(agency_settings::CONFIG_ENABLE_TEST_MODE, "true"); +} + +pub fn disable_agency_mocks() { + agency_settings::set_config_value(agency_settings::CONFIG_ENABLE_TEST_MODE, "false"); +} diff --git a/agency_client/src/payload.rs b/agency_client/src/payload.rs new file mode 100644 index 0000000000..b9a7fdb47a --- /dev/null +++ b/agency_client/src/payload.rs @@ -0,0 +1,17 @@ +use crate::message_type::MessageType; + +#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)] +#[serde(untagged)] +pub enum PayloadTypes { + PayloadTypeV2(MessageType), +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +pub enum PayloadKinds { + CredOffer, + CredReq, + Cred, + Proof, + ProofRequest, + Other(String), +} diff --git a/libvcx/src/agency_comm/update_connection.rs b/agency_client/src/update_connection.rs similarity index 83% rename from libvcx/src/agency_comm/update_connection.rs rename to agency_client/src/update_connection.rs index 8dd8e31ace..06203a699e 100644 --- a/libvcx/src/agency_comm/update_connection.rs +++ b/agency_client/src/update_connection.rs @@ -1,12 +1,10 @@ use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value; -use agency_comm::{A2AMessage, A2AMessageKinds, A2AMessageV2, delete_connection, GeneralMessage, parse_response_from_agency, prepare_message_for_agent}; -use agency_comm::message_type::MessageTypes; -use agency_comm::utils::comm::post_to_agency; -use error::prelude::*; -use settings; -use utils::httpclient; +use crate::{prepare_message_for_agent, A2AMessageKinds, A2AMessageV2, A2AMessage, GeneralMessage, delete_connection, parse_response_from_agency}; +use crate::message_type::MessageTypes; +use crate::utils::error::{AgencyClientResult, AgencyClientErrorKind, AgencyClientError}; +use crate::utils::comm::post_to_agency; #[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] #[serde(rename_all = "camelCase")] @@ -77,7 +75,7 @@ impl DeleteConnectionBuilder { } } - pub fn send_secure(&mut self) -> VcxResult<()> { + pub fn send_secure(&mut self) -> AgencyClientResult<()> { trace!("DeleteConnection::send >>>"); let data = self.prepare_request()?; @@ -87,19 +85,19 @@ impl DeleteConnectionBuilder { self.parse_response(&response) } - fn parse_response(&self, response: &Vec) -> VcxResult<()> { + fn parse_response(&self, response: &Vec) -> AgencyClientResult<()> { trace!("parse_response >>>"); let mut response = parse_response_from_agency(response)?; match response.remove(0) { A2AMessage::Version2(A2AMessageV2::UpdateConnectionResponse(_)) => Ok(()), - _ => Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of UpdateConnectionResponse")) + _ => Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of UpdateConnectionResponse")) } } } -pub fn send_delete_connection_message(pw_did: &str, pw_verkey: &str, agent_did: &str, agent_vk: &str) -> VcxResult<()> { +pub fn send_delete_connection_message(pw_did: &str, pw_verkey: &str, agent_did: &str, agent_vk: &str) -> AgencyClientResult<()> { trace!("send_delete_connection_message >>>"); delete_connection() @@ -126,7 +124,7 @@ impl GeneralMessage for DeleteConnectionBuilder { self.agent_vk = vk; } - fn prepare_request(&mut self) -> VcxResult> { + fn prepare_request(&mut self) -> AgencyClientResult> { let message = A2AMessage::Version2( A2AMessageV2::UpdateConnection( UpdateConnection { @@ -142,15 +140,12 @@ impl GeneralMessage for DeleteConnectionBuilder { #[cfg(test)] mod tests { - use utils::constants::DELETE_CONNECTION_DECRYPTED_RESPONSE; - use utils::devsetup::SetupDefaults; - use super::*; + use crate::utils::constants::DELETE_CONNECTION_DECRYPTED_RESPONSE; #[test] #[cfg(feature = "general_test")] fn test_deserialize_delete_connection_payload() { - let _setup = SetupDefaults::init(); let delete_connection_payload: UpdateConnectionResponse = serde_json::from_str(DELETE_CONNECTION_DECRYPTED_RESPONSE).unwrap(); assert_eq!(delete_connection_payload.status_code, ConnectionStatus::Deleted); diff --git a/agency_client/src/update_message.rs b/agency_client/src/update_message.rs new file mode 100644 index 0000000000..721b801c3c --- /dev/null +++ b/agency_client/src/update_message.rs @@ -0,0 +1,143 @@ +use crate::{mocking, MessageStatusCode, A2AMessageV2, A2AMessage, parse_response_from_agency, prepare_message_for_agency, agency_settings, A2AMessageKinds}; +use crate::utils::error::{AgencyClientResult, AgencyClientErrorKind, AgencyClientError}; +use crate::message_type::MessageTypes; +use crate::utils::comm::post_to_agency; +use crate::utils::constants; +use crate::mocking::AgencyMock; + +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct UpdateMessageStatusByConnections { + #[serde(rename = "@type")] + msg_type: MessageTypes, + status_code: Option, + uids_by_conns: Vec, +} + +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct UpdateMessageStatusByConnectionsResponse { + #[serde(rename = "@type")] + msg_type: MessageTypes, + status_code: Option, + updated_uids_by_conns: Vec, +} + +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct UIDsByConn { + #[serde(rename = "pairwiseDID")] + pub pairwise_did: String, + pub uids: Vec, +} + +struct UpdateMessageStatusByConnectionsBuilder { + status_code: Option, + uids_by_conns: Vec, +} + +impl UpdateMessageStatusByConnectionsBuilder { + pub fn create() -> UpdateMessageStatusByConnectionsBuilder { + trace!("UpdateMessageStatusByConnectionsBuilder::create >>>"); + + UpdateMessageStatusByConnectionsBuilder { + status_code: None, + uids_by_conns: Vec::new(), + } + } + + pub fn uids_by_conns(&mut self, uids_by_conns: Vec) -> AgencyClientResult<&mut Self> { + //Todo: validate msg_uid?? + self.uids_by_conns = uids_by_conns; + Ok(self) + } + + pub fn status_code(&mut self, code: MessageStatusCode) -> AgencyClientResult<&mut Self> { + //Todo: validate that it can be parsed to number?? + self.status_code = Some(code.clone()); + Ok(self) + } + + pub fn send_secure(&mut self) -> AgencyClientResult<()> { + trace!("UpdateMessages::send >>>"); + + AgencyMock::set_next_response(constants::UPDATE_MESSAGES_RESPONSE.to_vec()); + + let data = self.prepare_request()?; + + let response = post_to_agency(&data)?; + + self.parse_response(&response) + } + + fn prepare_request(&mut self) -> AgencyClientResult> { + let message = A2AMessage::Version2( + A2AMessageV2::UpdateMessageStatusByConnections( + UpdateMessageStatusByConnections { + msg_type: MessageTypes::build(A2AMessageKinds::UpdateMessageStatusByConnections), + uids_by_conns: self.uids_by_conns.clone(), + status_code: self.status_code.clone(), + } + ) + ); + + let agency_did = agency_settings::get_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_DID)?; + prepare_message_for_agency(&message, &agency_did) + } + + fn parse_response(&self, response: &Vec) -> AgencyClientResult<()> { + trace!("UpdateMessageStatusByConnectionsBuilder::parse_response >>>"); + + let mut response = parse_response_from_agency(response)?; + + match response.remove(0) { + A2AMessage::Version2(A2AMessageV2::UpdateMessageStatusByConnectionsResponse(_)) => Ok(()), + _ => Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of UpdateMessageStatusByConnectionsResponse")) + } + } +} + +pub fn update_agency_messages(status_code: &str, msg_json: &str) -> AgencyClientResult<()> { + trace!("update_agency_messages >>> status_code: {:?}, msg_json: {:?}", status_code, msg_json); + + let status_code: MessageStatusCode = ::serde_json::from_str(&format!("\"{}\"", status_code)) + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot deserialize MessageStatusCode: {}", err)))?; + + debug!("updating agency messages {} to status code: {:?}", msg_json, status_code); + + let uids_by_conns: Vec = serde_json::from_str(msg_json) + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot deserialize UIDsByConn: {}", err)))?; + + update_messages(status_code, uids_by_conns) +} + +pub fn update_messages(status_code: MessageStatusCode, uids_by_conns: Vec) -> AgencyClientResult<()> { + trace!("update_messages >>> "); + + if mocking::agency_mocks_enabled() { + trace!("update_messages >>> agency mocks enabled, returning empty response"); + return Ok(()); + }; + + UpdateMessageStatusByConnectionsBuilder::create() + .uids_by_conns(uids_by_conns)? + .status_code(status_code)? + .send_secure() +} + +#[cfg(test)] +mod tests { + use crate::utils::constants::AGENCY_MSG_STATUS_UPDATED_BY_CONNS; + use crate::utils::test_utils::SetupMocks; + + use crate::update_message::UpdateMessageStatusByConnectionsBuilder; + use crate::mocking; + + #[test] + #[cfg(feature = "general_test")] + fn test_parse_update_messages_response() { + let _setup = SetupMocks::init(); + mocking::AgencyMockDecrypted::set_next_decrypted_response(AGENCY_MSG_STATUS_UPDATED_BY_CONNS); + UpdateMessageStatusByConnectionsBuilder::create().parse_response(&Vec::from("")).unwrap(); + } +} diff --git a/agency_client/src/utils/agent_utils.rs b/agency_client/src/utils/agent_utils.rs new file mode 100644 index 0000000000..190de2fae1 --- /dev/null +++ b/agency_client/src/utils/agent_utils.rs @@ -0,0 +1,281 @@ +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +use serde_json::Value; + +use crate::message_type::MessageTypes; +use crate::{parse_response_from_agency, prepare_message_for_agency, A2AMessage, A2AMessageV2, agency_settings, A2AMessageKinds}; +use crate::utils::{error_utils, constants}; +use crate::utils::error::{AgencyClientErrorKind, AgencyClientResult, AgencyClientError}; +use crate::utils::comm::post_to_agency; +use crate::mocking::{agency_mocks_enabled, AgencyMockDecrypted}; + +#[derive(Serialize, Deserialize, Debug)] +pub struct Connect { + #[serde(rename = "@type")] + msg_type: MessageTypes, + #[serde(rename = "fromDID")] + from_did: String, + #[serde(rename = "fromDIDVerKey")] + from_vk: String, +} + +impl Connect { + fn build(from_did: &str, from_vk: &str) -> Connect { + Connect { + msg_type: MessageTypes::build(A2AMessageKinds::Connect), + from_did: from_did.to_string(), + from_vk: from_vk.to_string(), + } + } +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct ConnectResponse { + #[serde(rename = "@type")] + msg_type: MessageTypes, + #[serde(rename = "withPairwiseDID")] + from_did: String, + #[serde(rename = "withPairwiseDIDVerKey")] + from_vk: String, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct SignUp { + #[serde(rename = "@type")] + msg_type: MessageTypes, +} + +impl SignUp { + fn build() -> SignUp { + SignUp { + msg_type: MessageTypes::build(A2AMessageKinds::SignUp), + } + } +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct SignUpResponse { + #[serde(rename = "@type")] + msg_type: MessageTypes, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct CreateAgent { + #[serde(rename = "@type")] + msg_type: MessageTypes, +} + +impl CreateAgent { + fn build() -> CreateAgent { + CreateAgent { + msg_type: MessageTypes::build(A2AMessageKinds::CreateAgent), + } + } +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct CreateAgentResponse { + #[serde(rename = "@type")] + msg_type: MessageTypes, + #[serde(rename = "withPairwiseDID")] + from_did: String, + #[serde(rename = "withPairwiseDIDVerKey")] + from_vk: String, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct ComMethodUpdated { + #[serde(rename = "@type")] + msg_type: MessageTypes, + id: String, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct UpdateComMethod { + #[serde(rename = "@type")] + msg_type: MessageTypes, + #[serde(rename = "comMethod")] + com_method: ComMethod, +} + +#[derive(Debug, PartialEq)] +pub enum ComMethodType { + A2A, + Webhook, +} + +impl Serialize for ComMethodType { + fn serialize(&self, serializer: S) -> Result where S: Serializer { + let value = match self { + ComMethodType::A2A => "1", + ComMethodType::Webhook => "2", + }; + Value::String(value.to_string()).serialize(serializer) + } +} + +impl<'de> Deserialize<'de> for ComMethodType { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { + let value = Value::deserialize(deserializer).map_err(de::Error::custom)?; + match value.as_str() { + Some("1") => Ok(ComMethodType::A2A), + Some("2") => Ok(ComMethodType::Webhook), + _ => Err(de::Error::custom("Unexpected communication method type.")) + } + } +} + +impl UpdateComMethod { + fn build(com_method: ComMethod) -> UpdateComMethod { + UpdateComMethod { + msg_type: MessageTypes::build(A2AMessageKinds::UpdateComMethod), + com_method, + } + } +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct ComMethod { + id: String, + #[serde(rename = "type")] + e_type: ComMethodType, + value: String, +} + +pub fn connect_v2(my_did: &str, my_vk: &str, agency_did: &str) -> AgencyClientResult<(String, String)> { + /* STEP 1 - CONNECT */ + let message = A2AMessage::Version2( + A2AMessageV2::Connect(Connect::build(my_did, my_vk)) + ); + + let mut response = send_message_to_agency(&message, agency_did)?; + + let ConnectResponse { from_vk: agency_pw_vk, from_did: agency_pw_did, .. } = + match response.remove(0) { + A2AMessage::Version2(A2AMessageV2::ConnectResponse(resp)) => + resp, + _ => return + Err(AgencyClientError::from_msg( + AgencyClientErrorKind::InvalidHttpResponse, + "Message does not match any variant of ConnectResponse") + ) + }; + + agency_settings::set_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_VERKEY, &agency_pw_vk); + Ok((agency_pw_did, agency_pw_vk)) +} + +pub fn onboarding_v2(my_did: &str, my_vk: &str, agency_did: &str) -> AgencyClientResult<(String, String)> { + AgencyMockDecrypted::set_next_decrypted_response(constants::CONNECTED_RESPONSE_DECRYPTED); + let (agency_pw_did, _) = connect_v2(my_did, my_vk, agency_did)?; + + /* STEP 2 - REGISTER */ + let message = A2AMessage::Version2( + A2AMessageV2::SignUp(SignUp::build()) + ); + + AgencyMockDecrypted::set_next_decrypted_response(constants::REGISTER_RESPONSE_DECRYPTED); + let mut response = send_message_to_agency(&message, &agency_pw_did)?; + + let _response: SignUpResponse = + match response.remove(0) { + A2AMessage::Version2(A2AMessageV2::SignUpResponse(resp)) => resp, + _ => return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of SignUpResponse")) + }; + + /* STEP 3 - CREATE AGENT */ + let message = A2AMessage::Version2( + A2AMessageV2::CreateAgent(CreateAgent::build()) + ); + AgencyMockDecrypted::set_next_decrypted_response(constants::AGENT_CREATED_DECRYPTED); + let mut response = send_message_to_agency(&message, &agency_pw_did)?; + + let response: CreateAgentResponse = + match response.remove(0) { + A2AMessage::Version2(A2AMessageV2::CreateAgentResponse(resp)) => resp, + _ => return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of CreateAgentResponse")) + }; + + Ok((response.from_did, response.from_vk)) +} + +pub fn update_agent_webhook(webhook_url: &str) -> AgencyClientResult<()> { + info!("update_agent_webhook >>> webhook_url: {:?}", webhook_url); + + let com_method: ComMethod = ComMethod { + id: String::from("123"), + e_type: ComMethodType::Webhook, + value: String::from(webhook_url), + }; + + match agency_settings::get_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_DID) { + Ok(to_did) => { + update_agent_webhook_v2(&to_did, com_method)?; + } + Err(e) => warn!("Unable to update webhook (did you provide remote did in the config?): {}", e) + } + Ok(()) +} + +fn update_agent_webhook_v2(to_did: &str, com_method: ComMethod) -> AgencyClientResult<()> { + info!("> update_agent_webhook_v2"); + if agency_mocks_enabled() { + warn!("update_agent_webhook_v2 ::: Indy mocks enabled, skipping updating webhook url."); + return Ok(()); + } + + let message = A2AMessage::Version2( + A2AMessageV2::UpdateComMethod(UpdateComMethod::build(com_method)) + ); + send_message_to_agency(&message, &to_did)?; + Ok(()) +} + +pub fn send_message_to_agency(message: &A2AMessage, did: &str) -> AgencyClientResult> { + let data = prepare_message_for_agency(message, &did)?; + + let response = post_to_agency(&data) + .map_err(|err| err.map(AgencyClientErrorKind::InvalidHttpResponse, error_utils::INVALID_HTTP_RESPONSE.message))?; + + parse_response_from_agency(&response) +} + +#[cfg(test)] +mod tests { + use std::env; + use crate::utils::agent_utils::{update_agent_webhook, ComMethodType}; + + // use utils::devsetup::{SetupLibraryAgencyV2, SetupMocks}; + // use agency_client::utils::agent_utils::{ComMethodType, update_agent_webhook}; + + #[test] + #[cfg(feature = "general_test")] + fn test_method_type_serialization() { + assert_eq!("\"1\"", serde_json::to_string::(&ComMethodType::A2A).unwrap()); + assert_eq!("\"2\"", serde_json::to_string::(&ComMethodType::Webhook).unwrap()); + } + + #[test] + #[cfg(feature = "general_test")] + fn test_method_type_deserialization() { + assert_eq!(ComMethodType::A2A, serde_json::from_str::("\"1\"").unwrap()); + assert_eq!(ComMethodType::Webhook, serde_json::from_str::("\"2\"").unwrap()); + } + + #[test] + #[cfg(feature = "to_restore")] + #[cfg(feature = "general_test")] + fn test_update_agent_info() { + let _setup = SetupMocks::init(); + // todo: Need to mock agency v2 response, only agency v1 mocking works + update_agent_info("123", "value").unwrap(); + } + + #[cfg(feature = "agency_pool_tests")] + #[test] + fn test_update_agent_webhook_real() { + let _setup = SetupLibraryAgencyV2::init(); + + ::utils::devsetup::set_consumer(None); + update_agent_webhook("https://example.org").unwrap(); + } +} diff --git a/agency_client/src/utils/comm.rs b/agency_client/src/utils/comm.rs new file mode 100644 index 0000000000..5782582dcf --- /dev/null +++ b/agency_client/src/utils/comm.rs @@ -0,0 +1,7 @@ +use crate::{httpclient, agency_settings}; +use crate::utils::error::AgencyClientResult; + +pub fn post_to_agency(body_content: &Vec) -> AgencyClientResult> { + let endpoint = format!("{}/agency/msg", agency_settings::get_config_value(agency_settings::CONFIG_AGENCY_ENDPOINT)?); + httpclient::post_message(body_content, &endpoint) +} diff --git a/agency_client/src/utils/constants.rs b/agency_client/src/utils/constants.rs new file mode 100644 index 0000000000..c1d1ef835f --- /dev/null +++ b/agency_client/src/utils/constants.rs @@ -0,0 +1,24 @@ +pub const CREATE_KEYS_V2_RESPONSE: &'static [u8; 343] = &[123, 34, 109, 101, 115, 115, 97, 103, 101, 34, 58, 34, 123, 92, 34, 64, 116, 121, 112, 101, 92, 34, 58, 92, 34, 100, 105, 100, 58, 115, 111, 118, 58, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102, 103, 104, 105, 49, 50, 51, 52, 59, 115, 112, 101, 99, 47, 99, 111, 110, 110, 101, 99, 116, 105, 110, 103, 47, 48, 46, 54, 47, 75, 69, 89, 95, 67, 82, 69, 65, 84, 69, 68, 92, 34, 44, 92, 34, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 92, 34, 58, 92, 34, 77, 78, 101, 112, 101, 83, 87, 116, 71, 102, 104, 110, 118, 56, 106, 76, 66, 49, 115, 70, 90, 67, 92, 34, 44, 92, 34, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 86, 101, 114, 75, 101, 121, 92, 34, 58, 92, 34, 67, 55, 51, 77, 82, 110, 110, 115, 52, 113, 85, 106, 82, 53, 78, 52, 76, 82, 119, 84, 121, 105, 88, 86, 80, 75, 80, 114, 65, 53, 113, 52, 76, 67, 84, 56, 80, 90, 122, 120, 86, 100, 116, 57, 92, 34, 125, 34, 44, 34, 114, 101, 99, 105, 112, 105, 101, 110, 116, 95, 118, 101, 114, 107, 101, 121, 34, 58, 34, 50, 112, 70, 109, 113, 97, 98, 119, 75, 82, 82, 109, 80, 54, 76, 117, 67, 99, 121, 65, 70, 101, 107, 56, 77, 109, 68, 75, 107, 107, 102, 100, 72, 111, 100, 116, 57, 103, 90, 49, 67, 88, 74, 52, 34, 44, 34, 115, 101, 110, 100, 101, 114, 95, 118, 101, 114, 107, 101, 121, 34, 58, 34, 65, 66, 117, 89, 121, 84, 87, 90, 120, 113, 53, 88, 98, 105, 54, 90, 69, 119, 119, 121, 49, 97, 51, 69, 88, 51, 90, 68, 56, 100, 105, 112, 115, 109, 102, 106, 81, 53, 75, 116, 71, 116, 115, 120, 34, 125]; +pub const UPDATE_MESSAGES_RESPONSE: &'static [u8; 147] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 119, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 187, 77, 83, 71, 95, 83, 84, 65, 84, 85, 83, 95, 85, 80, 68, 65, 84, 69, 68, 95, 66, 89, 95, 67, 79, 78, 78, 83, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 178, 117, 112, 100, 97, 116, 101, 100, 85, 105, 100, 115, 66, 121, 67, 111, 110, 110, 115, 208, 145, 208, 130, 208, 171, 112, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 208, 182, 55, 57, 82, 78, 82, 113, 77, 87, 52, 72, 106, 107, 97, 111, 98, 101, 72, 105, 69, 77, 110, 101, 208, 164, 117, 105, 100, 115, 208, 145, 208, 167, 111, 103, 109, 49, 121, 50, 102]; +pub const UPDATE_PROFILE_RESPONSE: &'static [u8; 57] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 37, 208, 129, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 175, 67, 79, 78, 70, 73, 71, 83, 95, 85, 80, 68, 65, 84, 69, 68, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48]; +pub const CONNECTED_RESPONSE_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/onboarding/1.0/CONNECTED","withPairwiseDID":"XSasL1cESeSJ2v9wMYeXBf","withPairwiseDIDVerKey":"HbJb8uKp4mtjhnNknP66GgmUMYta6XArNaA4WJDEyyv9"}"#; +pub const REGISTER_RESPONSE_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/onboarding/1.0/SIGNED_UP"}"#; +pub const AGENT_CREATED_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/onboarding/1.0/AGENT_CREATED","withPairwiseDID":"DnEpUQJLupa5rKPkrKUpFd","withPairwiseDIDVerKey":"7y118tRW2EMJn18qs9MY5NJWYW2PLwV5QpaLyfoLHtgF"}"#; +pub const DELETE_CONNECTION_DECRYPTED_RESPONSE: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/pairwise/1.0/CONN_STATUS_UPDATED","statusCode":"CS-103"}"#; +pub const AGENCY_MSG_STATUS_UPDATED_BY_CONNS: &str = r#" +{ + "@type": "did:sov:123456789abcdefghi1234;spec/pairwise/1.0/MSG_STATUS_UPDATED_BY_CONNS", + "failed": [], + "updatedUidsByConns": [ + { + "pairwiseDID": "6FRuB95abcmzz1nURoHyWE", + "uids": [ + "Br4CoNP4TU" + ] + } + ] +}"#; +pub const AGENCY_CONFIGS_UPDATED: &str = r#" +{ + "@type": "did:sov:123456789abcdefghi1234;spec/configs/1.0/CONFIGS_UPDATED" +}"#; diff --git a/libvcx/src/agency_comm/create_key.rs b/agency_client/src/utils/create_key.rs similarity index 55% rename from libvcx/src/agency_comm/create_key.rs rename to agency_client/src/utils/create_key.rs index 834d859b7c..87594050e9 100644 --- a/libvcx/src/agency_comm/create_key.rs +++ b/agency_client/src/utils/create_key.rs @@ -1,10 +1,9 @@ -use agency_comm::{A2AMessage, A2AMessageKinds, A2AMessageV2, agency_settings, parse_response_from_agency, prepare_message_for_agency}; -use agency_comm::message_type::MessageTypes; -use agency_comm::mocking::AgencyMock; -use agency_comm::utils::comm::post_to_agency; -use error::prelude::*; -use utils::{constants, httpclient, validation}; -use crate::agency_comm::mocking; +use crate::utils::error::{AgencyClientErrorKind, AgencyClientResult, AgencyClientError}; +use crate::{A2AMessageV2, A2AMessage, parse_response_from_agency, prepare_message_for_agency, agency_settings, A2AMessageKinds, mocking}; +use crate::message_type::MessageTypes; +use crate::utils::comm::post_to_agency; +use crate::utils::{constants, validation}; +use crate::mocking::AgencyMock; #[derive(Deserialize, Serialize, Debug, PartialEq)] #[serde(rename_all = "camelCase")] @@ -43,22 +42,23 @@ impl CreateKeyBuilder { } } - pub fn for_did(&mut self, did: &str) -> VcxResult<&mut Self> { + pub fn for_did(&mut self, did: &str) -> AgencyClientResult<&mut Self> { validation::validate_did(did)?; self.for_did = did.to_string(); Ok(self) } - pub fn for_verkey(&mut self, verkey: &str) -> VcxResult<&mut Self> { + pub fn for_verkey(&mut self, verkey: &str) -> AgencyClientResult<&mut Self> { validation::validate_verkey(verkey)?; self.for_verkey = verkey.to_string(); Ok(self) } - pub fn send_secure(&self) -> VcxResult<(String, String)> { + pub fn send_secure(&self) -> AgencyClientResult<(String, String)> { trace!("CreateKeyBuilder::send_secure >>>"); if mocking::agency_mocks_enabled() { + warn!("CreateKeyBuilder::send_secure >>> agency mocks enabled, setting next mocked response"); AgencyMock::set_next_response(constants::CREATE_KEYS_V2_RESPONSE.to_vec()); } @@ -69,10 +69,11 @@ impl CreateKeyBuilder { self.parse_response(&response) } - fn prepare_request(&self) -> VcxResult> { + fn prepare_request(&self) -> AgencyClientResult> { + trace!("CreateKeyBuilder::prepare_request >>>"); let message = A2AMessage::Version2( A2AMessageV2::CreateKey(CreateKey { - msg_type: MessageTypes::MessageTypeV2(MessageTypes::build_v2(A2AMessageKinds::CreateKey)), + msg_type: MessageTypes::MessageType(MessageTypes::build_v2(A2AMessageKinds::CreateKey)), for_did: self.for_did.to_string(), for_verkey: self.for_verkey.to_string(), }) @@ -83,55 +84,45 @@ impl CreateKeyBuilder { prepare_message_for_agency(&message, &agency_did) } - fn parse_response(&self, response: &Vec) -> VcxResult<(String, String)> { + fn parse_response(&self, response: &Vec) -> AgencyClientResult<(String, String)> { let mut response = parse_response_from_agency(response)?; match response.remove(0) { A2AMessage::Version2(A2AMessageV2::CreateKeyResponse(res)) => Ok((res.for_did, res.for_verkey)), - _ => Err(VcxError::from(VcxErrorKind::InvalidHttpResponse)) + _ => Err(AgencyClientError::from(AgencyClientErrorKind::InvalidHttpResponse)) } } } #[cfg(test)] mod tests { - use agency_comm::create_keys; - use libindy::utils::signus::create_and_store_my_did; - use utils::constants::{CREATE_KEYS_V2_RESPONSE, MY1_SEED, MY2_SEED, MY3_SEED}; - use utils::devsetup::*; - use super::*; + use crate::utils::error::AgencyClientErrorKind; + use crate::create_keys; + use crate::utils::constants; + use crate::utils::test_utils::SetupMocks; #[test] #[cfg(feature = "general_test")] fn test_create_key_set_values() { - let _setup = SetupDefaults::init(); - let for_did = "11235yBzrpJQmNyZzgoTqB"; let for_verkey = "EkVTa7SCJ5SntpYyX7CSb2pcBhiVGT9kWSagA8a9T69A"; - create_keys() + CreateKeyBuilder::create() .for_did(for_did).unwrap() .for_verkey(for_verkey).unwrap(); } - #[test] - #[cfg(feature = "general_test")] - fn test_create_key_set_values_and_serialize() { - let _setup = SetupLibraryWallet::init(); - - let (_agent_did, agent_vk) = create_and_store_my_did(Some(MY2_SEED), None).unwrap(); - let (my_did, my_vk) = create_and_store_my_did(Some(MY1_SEED), None).unwrap(); - let (_agency_did, agency_vk) = create_and_store_my_did(Some(MY3_SEED), None).unwrap(); - - agency_settings::set_config_value(agency_settings::CONFIG_AGENCY_VERKEY, &agency_vk); - agency_settings::set_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_VERKEY, &agent_vk); - agency_settings::set_config_value(agency_settings::CONFIG_SDK_TO_REMOTE_VERKEY, &my_vk); - - let bytes = create_keys() - .for_did(&my_did).unwrap() - .for_verkey(&my_vk).unwrap() - .prepare_request().unwrap(); - assert!(bytes.len() > 0); + #[test] + #[cfg(feature = "general_test")] + fn test_create_key_set_values_and_serialize() { + let _setup = SetupMocks::init(); + let to_did = "8XFh8yBzrpJQmNyZzgoTqB"; + let my_vk = "C73MRnns4qUjR5N4LRwTyiXVPKPrA5q4LCT8PZzxVdt9"; + let bytes = CreateKeyBuilder::create() + .for_did(&to_did).unwrap() + .for_verkey(&my_vk).unwrap() + .prepare_request().unwrap(); + assert!(bytes.len() > 0); } #[test] @@ -139,9 +130,9 @@ mod tests { fn test_parse_create_keys_v2_response() { let _setup = SetupMocks::init(); - let mut builder = create_keys(); + let mut builder = CreateKeyBuilder::create(); - let (for_did, for_verkey) = builder.parse_response(&CREATE_KEYS_V2_RESPONSE.to_vec()).unwrap(); + let (for_did, for_verkey) = builder.parse_response(&constants::CREATE_KEYS_V2_RESPONSE.to_vec()).unwrap(); assert_eq!(for_did, "MNepeSWtGfhnv8jLB1sFZC"); assert_eq!(for_verkey, "C73MRnns4qUjR5N4LRwTyiXVPKPrA5q4LCT8PZzxVdt9"); @@ -150,13 +141,11 @@ mod tests { #[test] #[cfg(feature = "general_test")] fn test_create_key_set_invalid_did_errors() { - let _setup = SetupDefaults::init(); - let for_did = "11235yBzrpJQmNyZzgoT"; - let res = create_keys() + let res = CreateKeyBuilder::create() .for_did(for_did) .unwrap_err(); - assert_eq!(res.kind(), VcxErrorKind::InvalidDid); + assert_eq!(res.kind(), AgencyClientErrorKind::InvalidDid); } } diff --git a/agency_client/src/utils/encryption_envelope.rs b/agency_client/src/utils/encryption_envelope.rs new file mode 100755 index 0000000000..cfb6f13970 --- /dev/null +++ b/agency_client/src/utils/encryption_envelope.rs @@ -0,0 +1,70 @@ +use crate::utils::error::{AgencyClientErrorKind, AgencyClientError, AgencyClientResult}; +use crate::mocking::AgencyMockDecrypted; +use crate::utils::libindy::crypto; + +#[derive(Debug)] +pub struct EncryptionEnvelope(pub Vec); + +impl EncryptionEnvelope { + fn _unpack_a2a_message(payload: Vec) -> AgencyClientResult<(String, Option)> { + trace!("EncryptionEnvelope::_unpack_a2a_message >>> processing payload of {} bytes", payload.len()); + + let unpacked_msg = crypto::unpack_message(&payload)?; + + let msg_value: ::serde_json::Value = ::serde_json::from_slice(unpacked_msg.as_slice()) + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, format!("Cannot deserialize message: {}", err)))?; + trace!("EncryptionEnvelope::_unpack_a2a_message >>> msg_value: {:?}", msg_value); + + let sender_vk = msg_value["sender_verkey"].as_str().map(String::from); + trace!("EncryptionEnvelope::_unpack_a2a_message >>> sender_vk: {:?}", sender_vk); + + let msg_string = msg_value["message"].as_str() + .ok_or(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, "Cannot find `message` field"))?.to_string(); + + trace!("EncryptionEnvelope::_unpack_a2a_message >>> msg_string: {:?}", msg_string); + + Ok((msg_string, sender_vk)) + } + + // todo: we should use auth_unpack wherever possible + pub fn anon_unpack(payload: Vec) -> AgencyClientResult { + trace!("EncryptionEnvelope::anon_unpack >>> processing payload of {} bytes", payload.len()); + if AgencyMockDecrypted::has_decrypted_mock_messages() { + trace!("EncryptionEnvelope::anon_unpack >>> returning decrypted mock message"); + Ok(AgencyMockDecrypted::get_next_decrypted_message()) + } else { + let (a2a_message, _sender_vk) = Self::_unpack_a2a_message(payload)?; + trace!("EncryptionEnvelope::anon_unpack >>> a2a_message: {:?}", a2a_message); + Ok(a2a_message) + } + } + + pub fn auth_unpack(payload: Vec, expected_vk: &str) -> AgencyClientResult { + trace!("EncryptionEnvelope::auth_unpack >>> processing payload of {} bytes, expected_vk={}", payload.len(), expected_vk); + + if AgencyMockDecrypted::has_decrypted_mock_messages() { + trace!("EncryptionEnvelope::auth_unpack >>> returning decrypted mock message"); + Ok(AgencyMockDecrypted::get_next_decrypted_message()) + } else { + let (a2a_message, sender_vk) = Self::_unpack_a2a_message(payload)?; + trace!("EncryptionEnvelope::auth_unpack >>> a2a_message: {:?}, sender_vk: {:?}", a2a_message, sender_vk); + + match sender_vk { + Some(sender_vk) => { + if sender_vk != expected_vk { + error!("auth_unpack :: sender_vk != expected_vk.... sender_vk={}, expected_vk={}", sender_vk, expected_vk); + return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, + format!("Message did not pass authentication check. Expected sender verkey was {}, but actually was {}", expected_vk, sender_vk)) + ); + } + } + None => { + error!("auth_unpack :: message was authcrypted"); + return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidJson, "Can't authenticate message because it was anoncrypted.")); + } + } + trace!("EncryptionEnvelope::auth_unpack >>> a2a_message: {:?}", a2a_message); + Ok(a2a_message) + } + } +} diff --git a/agency_client/src/utils/error.rs b/agency_client/src/utils/error.rs new file mode 100644 index 0000000000..838413d070 --- /dev/null +++ b/agency_client/src/utils/error.rs @@ -0,0 +1,316 @@ +use std::cell::RefCell; +use std::ffi::CString; +use std::fmt; + +use failure::{Backtrace, Context, Fail}; + +use indy::IndyError; + +use crate::utils::error_utils; + +pub mod prelude { + pub use super::*; +} + +#[derive(Copy, Clone, Eq, PartialEq, Debug, Fail)] +pub enum AgencyClientErrorKind { + // Common + #[fail(display = "Object is in invalid state for requested operation")] + InvalidState, + #[fail(display = "Invalid Configuration")] + InvalidConfiguration, + #[fail(display = "Obj was not found with handle")] + InvalidHandle, + #[fail(display = "Invalid JSON string")] + InvalidJson, + #[fail(display = "Invalid Option")] + InvalidOption, + #[fail(display = "Invalid MessagePack")] + InvalidMessagePack, + #[fail(display = "IO Error, possibly creating a backup wallet")] + IOError, + #[fail(display = "Object (json, config, key, credential and etc...) passed to libindy has invalid structure")] + LibindyInvalidStructure, + #[fail(display = "Waiting for callback timed out")] + TimeoutLibindy, + #[fail(display = "Parameter passed to libindy was invalid")] + InvalidLibindyParam, + + // Payment + #[fail(display = "Insufficient amount of tokens to process request")] + InsufficientTokenAmount, + + #[fail(display = "Can't create, Credential Def already on ledger")] + CredDefAlreadyCreated, + + // Pool + #[fail(display = "Formatting for Pool Config are incorrect.")] + CreatePoolConfig, + #[fail(display = "Message failed in post")] + PostMessageFailed, + + // Wallet + #[fail(display = "Invalid Wallet or Search Handle")] + InvalidWalletHandle, + #[fail(display = "Indy wallet already exists")] + DuplicationWallet, + #[fail(display = "Wallet record not found")] + WalletRecordNotFound, + #[fail(display = "Record already exists in the wallet")] + DuplicationWalletRecord, + #[fail(display = "Wallet not found")] + WalletNotFound, + #[fail(display = "Indy wallet already open")] + WalletAlreadyOpen, + #[fail(display = "Configuration is missing wallet key")] + MissingWalletKey, + #[fail(display = "Attempted to add a Master Secret that already existed in wallet")] + DuplicationMasterSecret, + #[fail(display = "Attempted to add a DID to wallet when that DID already exists in wallet")] + DuplicationDid, + + // Validation + #[fail(display = "Unknown Error")] + UnknownError, + #[fail(display = "Invalid DID")] + InvalidDid, + #[fail(display = "Invalid VERKEY")] + InvalidVerkey, + #[fail(display = "Invalid URL")] + InvalidUrl, + #[fail(display = "Unable to serialize")] + SerializationError, + #[fail(display = "Value needs to be base58")] + NotBase58, + + // A2A + #[fail(display = "Invalid HTTP response.")] + InvalidHttpResponse, + + #[fail(display = "Common error {}", 0)] + Common(u32), + #[fail(display = "Libndy error {}", 0)] + LibndyError(u32), + #[fail(display = "Unknown libindy error")] + UnknownLibndyError, +} + +#[derive(Debug)] +pub struct AgencyClientError { + inner: Context +} + +impl Fail for AgencyClientError { + fn cause(&self) -> Option<&dyn Fail> { + self.inner.cause() + } + + fn backtrace(&self) -> Option<&Backtrace> { + self.inner.backtrace() + } +} + +impl fmt::Display for AgencyClientError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut first = true; + + for cause in Fail::iter_chain(&self.inner) { + if first { + first = false; + writeln!(f, "Error: {}", cause)?; + } else { + writeln!(f, " Caused by: {}", cause)?; + } + } + + Ok(()) + } +} + +impl AgencyClientError { + pub fn from_msg(kind: AgencyClientErrorKind, msg: D) -> AgencyClientError + where D: fmt::Display + fmt::Debug + Send + Sync + 'static { + AgencyClientError { inner: Context::new(msg).context(kind) } + } + + pub fn kind(&self) -> AgencyClientErrorKind { + *self.inner.get_context() + } + + pub fn extend(self, msg: D) -> AgencyClientError + where D: fmt::Display + fmt::Debug + Send + Sync + 'static { + let kind = self.kind(); + AgencyClientError { inner: self.inner.map(|_| msg).context(kind) } + } + + pub fn map(self, kind: AgencyClientErrorKind, msg: D) -> AgencyClientError + where D: fmt::Display + fmt::Debug + Send + Sync + 'static { + AgencyClientError { inner: self.inner.map(|_| msg).context(kind) } + } +} + +impl From for AgencyClientError { + fn from(kind: AgencyClientErrorKind) -> AgencyClientError { + AgencyClientError::from_msg(kind, error_utils::error_message(&kind.clone().into())) + } +} + +impl From> for AgencyClientError { + fn from(inner: Context) -> AgencyClientError { + AgencyClientError { inner } + } +} + +impl From for u32 { + fn from(code: AgencyClientError) -> u32 { + set_current_error(&code); + code.kind().into() + } +} + +impl From for u32 { + fn from(code: AgencyClientErrorKind) -> u32 { + match code { + AgencyClientErrorKind::InvalidState => error_utils::INVALID_STATE.code_num, + AgencyClientErrorKind::InvalidConfiguration => error_utils::INVALID_CONFIGURATION.code_num, + AgencyClientErrorKind::InvalidHandle => error_utils::INVALID_OBJ_HANDLE.code_num, + AgencyClientErrorKind::InvalidJson => error_utils::INVALID_JSON.code_num, + AgencyClientErrorKind::InvalidOption => error_utils::INVALID_OPTION.code_num, + AgencyClientErrorKind::InvalidMessagePack => error_utils::INVALID_MSGPACK.code_num, + AgencyClientErrorKind::IOError => error_utils::IOERROR.code_num, + AgencyClientErrorKind::LibindyInvalidStructure => error_utils::LIBINDY_INVALID_STRUCTURE.code_num, + AgencyClientErrorKind::InsufficientTokenAmount => error_utils::INSUFFICIENT_TOKEN_AMOUNT.code_num, + AgencyClientErrorKind::CredDefAlreadyCreated => error_utils::CREDENTIAL_DEF_ALREADY_CREATED.code_num, + AgencyClientErrorKind::TimeoutLibindy => error_utils::TIMEOUT_LIBINDY_ERROR.code_num, + AgencyClientErrorKind::InvalidLibindyParam => error_utils::INVALID_LIBINDY_PARAM.code_num, + AgencyClientErrorKind::InvalidWalletHandle => error_utils::INVALID_WALLET_HANDLE.code_num, + AgencyClientErrorKind::DuplicationWallet => error_utils::WALLET_ALREADY_EXISTS.code_num, + AgencyClientErrorKind::WalletNotFound => error_utils::WALLET_NOT_FOUND.code_num, + AgencyClientErrorKind::WalletRecordNotFound => error_utils::WALLET_RECORD_NOT_FOUND.code_num, + AgencyClientErrorKind::CreatePoolConfig => error_utils::CREATE_POOL_CONFIG.code_num, + AgencyClientErrorKind::DuplicationWalletRecord => error_utils::DUPLICATE_WALLET_RECORD.code_num, + AgencyClientErrorKind::WalletAlreadyOpen => error_utils::WALLET_ALREADY_OPEN.code_num, + AgencyClientErrorKind::DuplicationMasterSecret => error_utils::DUPLICATE_MASTER_SECRET.code_num, + AgencyClientErrorKind::DuplicationDid => error_utils::DID_ALREADY_EXISTS_IN_WALLET.code_num, + AgencyClientErrorKind::PostMessageFailed => error_utils::POST_MSG_FAILURE.code_num, + AgencyClientErrorKind::UnknownError => error_utils::UNKNOWN_ERROR.code_num, + AgencyClientErrorKind::InvalidDid => error_utils::INVALID_DID.code_num, + AgencyClientErrorKind::InvalidVerkey => error_utils::INVALID_VERKEY.code_num, + AgencyClientErrorKind::InvalidUrl => error_utils::INVALID_URL.code_num, + AgencyClientErrorKind::MissingWalletKey => error_utils::MISSING_WALLET_KEY.code_num, + AgencyClientErrorKind::SerializationError => error_utils::SERIALIZATION_ERROR.code_num, + AgencyClientErrorKind::NotBase58 => error_utils::NOT_BASE58.code_num, + AgencyClientErrorKind::InvalidHttpResponse => error_utils::INVALID_HTTP_RESPONSE.code_num, + AgencyClientErrorKind::UnknownLibndyError => error_utils::UNKNOWN_LIBINDY_ERROR.code_num, + AgencyClientErrorKind::Common(num) => num, + AgencyClientErrorKind::LibndyError(num) => num, + } + } +} + +impl From for AgencyClientErrorKind { + fn from(code: u32) -> AgencyClientErrorKind { + match code { + _ if { error_utils::INVALID_STATE.code_num == code } => AgencyClientErrorKind::InvalidState, + _ if { error_utils::INVALID_CONFIGURATION.code_num == code } => AgencyClientErrorKind::InvalidConfiguration, + _ if { error_utils::INVALID_OBJ_HANDLE.code_num == code } => AgencyClientErrorKind::InvalidHandle, + _ if { error_utils::INVALID_JSON.code_num == code } => AgencyClientErrorKind::InvalidJson, + _ if { error_utils::INVALID_OPTION.code_num == code } => AgencyClientErrorKind::InvalidOption, + _ if { error_utils::INVALID_MSGPACK.code_num == code } => AgencyClientErrorKind::InvalidMessagePack, + _ if { error_utils::IOERROR.code_num == code } => AgencyClientErrorKind::IOError, + _ if { error_utils::LIBINDY_INVALID_STRUCTURE.code_num == code } => AgencyClientErrorKind::LibindyInvalidStructure, + _ if { error_utils::TIMEOUT_LIBINDY_ERROR.code_num == code } => AgencyClientErrorKind::TimeoutLibindy, + _ if { error_utils::INVALID_LIBINDY_PARAM.code_num == code } => AgencyClientErrorKind::InvalidLibindyParam, + _ if { error_utils::CREDENTIAL_DEF_ALREADY_CREATED.code_num == code } => AgencyClientErrorKind::CredDefAlreadyCreated, + _ if { error_utils::INVALID_WALLET_HANDLE.code_num == code } => AgencyClientErrorKind::InvalidWalletHandle, + _ if { error_utils::WALLET_ALREADY_EXISTS.code_num == code } => AgencyClientErrorKind::DuplicationWallet, + _ if { error_utils::WALLET_NOT_FOUND.code_num == code } => AgencyClientErrorKind::WalletNotFound, + _ if { error_utils::WALLET_RECORD_NOT_FOUND.code_num == code } => AgencyClientErrorKind::WalletRecordNotFound, + _ if { error_utils::CREATE_POOL_CONFIG.code_num == code } => AgencyClientErrorKind::CreatePoolConfig, + _ if { error_utils::DUPLICATE_WALLET_RECORD.code_num == code } => AgencyClientErrorKind::DuplicationWalletRecord, + _ if { error_utils::WALLET_ALREADY_OPEN.code_num == code } => AgencyClientErrorKind::WalletAlreadyOpen, + _ if { error_utils::DUPLICATE_MASTER_SECRET.code_num == code } => AgencyClientErrorKind::DuplicationMasterSecret, + _ if { error_utils::DID_ALREADY_EXISTS_IN_WALLET.code_num == code } => AgencyClientErrorKind::DuplicationDid, + _ if { error_utils::POST_MSG_FAILURE.code_num == code } => AgencyClientErrorKind::PostMessageFailed, + _ if { error_utils::UNKNOWN_ERROR.code_num == code } => AgencyClientErrorKind::UnknownError, + _ if { error_utils::INVALID_DID.code_num == code } => AgencyClientErrorKind::InvalidDid, + _ if { error_utils::INVALID_VERKEY.code_num == code } => AgencyClientErrorKind::InvalidVerkey, + _ if { error_utils::INVALID_URL.code_num == code } => AgencyClientErrorKind::InvalidUrl, + _ if { error_utils::MISSING_WALLET_KEY.code_num == code } => AgencyClientErrorKind::MissingWalletKey, + _ if { error_utils::SERIALIZATION_ERROR.code_num == code } => AgencyClientErrorKind::SerializationError, + _ if { error_utils::NOT_BASE58.code_num == code } => AgencyClientErrorKind::NotBase58, + _ if { error_utils::INVALID_HTTP_RESPONSE.code_num == code } => AgencyClientErrorKind::InvalidHttpResponse, + _ if { error_utils::UNKNOWN_LIBINDY_ERROR.code_num == code } => AgencyClientErrorKind::UnknownLibndyError, + _ => AgencyClientErrorKind::UnknownError, + } + } +} + +impl From for AgencyClientError { + fn from(error: IndyError) -> Self { + match error.error_code as u32 { + 100..=111 => AgencyClientError::from_msg(AgencyClientErrorKind::InvalidLibindyParam, error.message), + 113 => AgencyClientError::from_msg(AgencyClientErrorKind::LibindyInvalidStructure, error.message), + 114 => AgencyClientError::from_msg(AgencyClientErrorKind::IOError, error.message), + 200 => AgencyClientError::from_msg(AgencyClientErrorKind::InvalidWalletHandle, error.message), + 203 => AgencyClientError::from_msg(AgencyClientErrorKind::DuplicationWallet, error.message), + 204 => AgencyClientError::from_msg(AgencyClientErrorKind::WalletNotFound, error.message), + 206 => AgencyClientError::from_msg(AgencyClientErrorKind::WalletAlreadyOpen, error.message), + 212 => AgencyClientError::from_msg(AgencyClientErrorKind::WalletRecordNotFound, error.message), + 213 => AgencyClientError::from_msg(AgencyClientErrorKind::DuplicationWalletRecord, error.message), + 306 => AgencyClientError::from_msg(AgencyClientErrorKind::CreatePoolConfig, error.message), + 404 => AgencyClientError::from_msg(AgencyClientErrorKind::DuplicationMasterSecret, error.message), + 407 => AgencyClientError::from_msg(AgencyClientErrorKind::CredDefAlreadyCreated, error.message), + 600 => AgencyClientError::from_msg(AgencyClientErrorKind::DuplicationDid, error.message), + 702 => AgencyClientError::from_msg(AgencyClientErrorKind::InsufficientTokenAmount, error.message), + error_code => AgencyClientError::from_msg(AgencyClientErrorKind::LibndyError(error_code), error.message) + } + } +} + +pub type AgencyClientResult = Result; + +/// Extension methods for `Result`. +pub trait VcxResultExt { + fn to_vcx(self, kind: AgencyClientErrorKind, msg: D) -> AgencyClientResult where D: fmt::Display + Send + Sync + 'static; +} + +impl VcxResultExt for Result where E: Fail +{ + fn to_vcx(self, kind: AgencyClientErrorKind, msg: D) -> AgencyClientResult where D: fmt::Display + Send + Sync + 'static { + self.map_err(|err| err.context(msg).context(kind).into()) + } +} + +/// Extension methods for `Error`. +pub trait VcxErrorExt { + fn to_vcx(self, kind: AgencyClientErrorKind, msg: D) -> AgencyClientError where D: fmt::Display + Send + Sync + 'static; +} + +impl VcxErrorExt for E where E: Fail +{ + fn to_vcx(self, kind: AgencyClientErrorKind, msg: D) -> AgencyClientError where D: fmt::Display + Send + Sync + 'static { + self.context(format!("\n{}: {}", std::any::type_name::(), msg)).context(kind).into() + } +} + +thread_local! { + pub static CURRENT_ERROR_C_JSON: RefCell> = RefCell::new(None); +} + +fn string_to_cstring(s: String) -> CString { + CString::new(s).unwrap() +} + +pub fn set_current_error(err: &AgencyClientError) { + CURRENT_ERROR_C_JSON.try_with(|error| { + let error_json = json!({ + "error": err.kind().to_string(), + "message": err.to_string(), + "cause": Fail::find_root_cause(err).to_string(), + "backtrace": err.backtrace().map(|bt| bt.to_string()) + }).to_string(); + error.replace(Some(string_to_cstring(error_json))); + }) + .map_err(|err| error!("Thread local variable access failed with: {:?}", err)).ok(); +} diff --git a/agency_client/src/utils/error_utils.rs b/agency_client/src/utils/error_utils.rs new file mode 100644 index 0000000000..55c0e38e32 --- /dev/null +++ b/agency_client/src/utils/error_utils.rs @@ -0,0 +1,116 @@ +use std::collections::HashMap; +use std::ffi::CString; +use std::fmt; + +pub static SUCCESS: Error = Error { code_num: 0, message: "Success" }; +pub static UNKNOWN_ERROR: Error = Error { code_num: 1001, message: "Unknown Error" }; +pub static INVALID_CONFIGURATION: Error = Error { code_num: 1004, message: "Invalid Configuration" }; +pub static NOT_READY: Error = Error { code_num: 1005, message: "Object not ready for specified action" }; +pub static INVALID_OPTION: Error = Error { code_num: 1007, message: "Invalid Option" }; +pub static INVALID_DID: Error = Error { code_num: 1008, message: "Invalid DID" }; +pub static INVALID_VERKEY: Error = Error { code_num: 1009, message: "Invalid VERKEY" }; +pub static POST_MSG_FAILURE: Error = Error { code_num: 1010, message: "Message failed in post" }; +pub static INVALID_URL: Error = Error { code_num: 1013, message: "Invalid URL" }; +pub static NOT_BASE58: Error = Error { code_num: 1014, message: "Value needs to be base58" }; +pub static INVALID_JSON: Error = Error { code_num: 1016, message: "Invalid JSON string" }; +pub static CREATE_POOL_CONFIG: Error = Error { code_num: 1026, message: "Formatting for Pool Config are incorrect." }; +pub static INVALID_HTTP_RESPONSE: Error = Error { code_num: 1033, message: "Invalid HTTP response." }; +pub static UNKNOWN_LIBINDY_ERROR: Error = Error { code_num: 1035, message: "Unknown libindy error" }; +pub static TIMEOUT_LIBINDY_ERROR: Error = Error { code_num: 1038, message: "Waiting for callback timed out" }; +pub static CREDENTIAL_DEF_ALREADY_CREATED: Error = Error { code_num: 1039, message: "Can't create, Credential Def already exists in wallet" }; +pub static INVALID_OBJ_HANDLE: Error = Error { code_num: 1048, message: "Obj was not found with handle" }; +pub static SERIALIZATION_ERROR: Error = Error { code_num: 1050, message: "Unable to serialize" }; +pub static WALLET_ALREADY_EXISTS: Error = Error { code_num: 1051, message: "Indy wallet already exists" }; +pub static WALLET_ALREADY_OPEN: Error = Error { code_num: 1052, message: "Indy wallet already open" }; +pub static INVALID_WALLET_HANDLE: Error = Error { code_num: 1057, message: "Invalid Wallet or Search Handle" }; +pub static CANNOT_DELETE_CONNECTION: Error = Error { code_num: 1060, message: "Cannot Delete Connection. Check status of connection is appropriate to be deleted from agency." }; +pub static INSUFFICIENT_TOKEN_AMOUNT: Error = Error { code_num: 1064, message: "Insufficient amount of tokens to process request" }; +pub static INVALID_LIBINDY_PARAM: Error = Error { code_num: 1067, message: "Parameter passed to libindy was invalid" }; +pub static MISSING_WALLET_KEY: Error = Error { code_num: 1069, message: "Configuration is missing wallet key" }; +pub static DUPLICATE_WALLET_RECORD: Error = Error { code_num: 1072, message: "Record already exists in the wallet" }; +pub static WALLET_RECORD_NOT_FOUND: Error = Error { code_num: 1073, message: "Wallet record not found" }; +pub static IOERROR: Error = Error { code_num: 1074, message: "IO Error, possibly creating a backup wallet" }; +pub static WALLET_NOT_FOUND: Error = Error { code_num: 1079, message: "Wallet Not Found" }; +pub static LIBINDY_INVALID_STRUCTURE: Error = Error { code_num: 1080, message: "Object (json, config, key, credential and etc...) passed to libindy has invalid structure" }; +pub static INVALID_STATE: Error = Error { code_num: 1081, message: "Object is in invalid state for requested operation" }; +pub static INVALID_MSGPACK: Error = Error { code_num: 1019, message: "Invalid MessagePack" }; +pub static DUPLICATE_MASTER_SECRET: Error = Error { code_num: 1084, message: "Attempted to add a Master Secret that already existed in wallet" }; +pub static DID_ALREADY_EXISTS_IN_WALLET: Error = Error { code_num: 1083, message: "Attempted to add a DID to wallet when that DID already exists in wallet" }; + +lazy_static! { + static ref ERROR_C_MESSAGES: HashMap = { + let mut m = HashMap::new(); + insert_c_message(&mut m, &UNKNOWN_ERROR); + insert_c_message(&mut m, &INVALID_CONFIGURATION); + insert_c_message(&mut m, &NOT_READY); + insert_c_message(&mut m, &INVALID_OPTION); + insert_c_message(&mut m, &INVALID_DID); + insert_c_message(&mut m, &INVALID_VERKEY); + insert_c_message(&mut m, &POST_MSG_FAILURE); + insert_c_message(&mut m, &INVALID_URL); + insert_c_message(&mut m, &NOT_BASE58); + insert_c_message(&mut m, &INVALID_JSON); + insert_c_message(&mut m, &INVALID_MSGPACK); + insert_c_message(&mut m, &CREATE_POOL_CONFIG); + insert_c_message(&mut m, &INVALID_HTTP_RESPONSE); + insert_c_message(&mut m, &UNKNOWN_LIBINDY_ERROR); + insert_c_message(&mut m, &TIMEOUT_LIBINDY_ERROR); + insert_c_message(&mut m, &CREDENTIAL_DEF_ALREADY_CREATED); + insert_c_message(&mut m, &INVALID_OBJ_HANDLE); + insert_c_message(&mut m, &SERIALIZATION_ERROR); + insert_c_message(&mut m, &WALLET_ALREADY_EXISTS); + insert_c_message(&mut m, &WALLET_ALREADY_OPEN); + insert_c_message(&mut m, &INVALID_WALLET_HANDLE); + insert_c_message(&mut m, &CANNOT_DELETE_CONNECTION); + insert_c_message(&mut m, &INSUFFICIENT_TOKEN_AMOUNT); + insert_c_message(&mut m, &INVALID_LIBINDY_PARAM); + insert_c_message(&mut m, &MISSING_WALLET_KEY); + insert_c_message(&mut m, &DUPLICATE_WALLET_RECORD); + insert_c_message(&mut m, &WALLET_RECORD_NOT_FOUND); + insert_c_message(&mut m, &IOERROR); + insert_c_message(&mut m, &WALLET_NOT_FOUND); + insert_c_message(&mut m, &LIBINDY_INVALID_STRUCTURE); + insert_c_message(&mut m, &INVALID_STATE); + insert_c_message(&mut m, &DID_ALREADY_EXISTS_IN_WALLET); + insert_c_message(&mut m, &DUPLICATE_MASTER_SECRET); + + m + }; +} + +// ******* END ******* + +// Helper function for static defining of error messages. Does limited checking that it can. +fn insert_c_message(map: &mut HashMap, error: &Error) { + if map.contains_key(&error.code_num) { + panic!("Error Code number was repeated which is not allowed! (likely a copy/paste error)") + } + map.insert(error.code_num, CString::new(error.message).unwrap()); +} + +#[derive(Clone, Copy)] +pub struct Error { + pub code_num: u32, + pub message: &'static str, +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let msg = error_message(&self.code_num); + write!(f, "{}: (Error Num:{})", msg, &self.code_num) + } +} + +pub fn error_c_message(code_num: &u32) -> &CString { + match ERROR_C_MESSAGES.get(code_num) { + Some(msg) => &msg, + None => error_c_message(&UNKNOWN_ERROR.code_num), + } +} + +pub fn error_message(code_num: &u32) -> String { + match ERROR_C_MESSAGES.get(code_num) { + Some(msg) => msg.to_str().unwrap().to_string(), + None => error_message(&UNKNOWN_ERROR.code_num), + } +} diff --git a/agency_client/src/utils/libindy/crypto.rs b/agency_client/src/utils/libindy/crypto.rs new file mode 100644 index 0000000000..6d301c4212 --- /dev/null +++ b/agency_client/src/utils/libindy/crypto.rs @@ -0,0 +1,20 @@ +use indy::crypto; +use futures::Future; +use crate::mocking::agency_mocks_enabled; +use crate::utils::error::AgencyClientResult; + +pub fn pack_message(sender_vk: Option<&str>, receiver_keys: &str, msg: &[u8]) -> AgencyClientResult> { + if agency_mocks_enabled() { return Ok(msg.to_vec()); } + + crypto::pack_message(crate::utils::wallet::get_wallet_handle(), msg, receiver_keys, sender_vk) + .wait() + .map_err(|err| err.into()) +} + +pub fn unpack_message(msg: &[u8]) -> AgencyClientResult> { + if agency_mocks_enabled() { return Ok(msg.to_vec()); } + + crypto::unpack_message(crate::utils::wallet::get_wallet_handle(), msg) + .wait() + .map_err(|err| err.into()) +} diff --git a/agency_client/src/utils/libindy/mod.rs b/agency_client/src/utils/libindy/mod.rs new file mode 100644 index 0000000000..5ec0ee8dd4 --- /dev/null +++ b/agency_client/src/utils/libindy/mod.rs @@ -0,0 +1,2 @@ +pub mod crypto; +pub mod signus; diff --git a/agency_client/src/utils/libindy/signus.rs b/agency_client/src/utils/libindy/signus.rs new file mode 100644 index 0000000000..c0eddee5f1 --- /dev/null +++ b/agency_client/src/utils/libindy/signus.rs @@ -0,0 +1,13 @@ +use futures::Future; +use indy::did; + +use crate::utils::error::prelude::*; +use crate::utils::wallet::get_wallet_handle; + +pub fn create_and_store_my_did(seed: Option<&str>, method_name: Option<&str>) -> AgencyClientResult<(String, String)> { + let my_did_json = json!({"seed": seed, "method_name": method_name}); + + did::create_and_store_my_did(get_wallet_handle(), &my_did_json.to_string()) + .wait() + .map_err(AgencyClientError::from) +} diff --git a/agency_client/src/utils/mod.rs b/agency_client/src/utils/mod.rs new file mode 100644 index 0000000000..3464a0a820 --- /dev/null +++ b/agency_client/src/utils/mod.rs @@ -0,0 +1,14 @@ +pub mod agent_utils; +pub mod validation; +pub mod constants; +pub mod error; +pub mod error_utils; +pub mod libindy; +pub mod option_util; +pub mod encryption_envelope; +pub mod wallet; +pub mod timeout; +pub mod test_utils; +pub mod create_key; +pub mod update_profile; +pub(super) mod comm; diff --git a/agency_client/src/utils/option_util.rs b/agency_client/src/utils/option_util.rs new file mode 100644 index 0000000000..5ff32a0a34 --- /dev/null +++ b/agency_client/src/utils/option_util.rs @@ -0,0 +1,10 @@ +use crate::utils::error::{AgencyClientErrorKind, AgencyClientResult, AgencyClientError}; + +pub fn get_or_default(config: &Option, default: &str) -> String { + config.to_owned().unwrap_or(default.to_string()) +} + +pub fn get_or_err(config: &Option, err: Option) -> AgencyClientResult { + let e = AgencyClientError::from(err.unwrap_or(AgencyClientErrorKind::InvalidOption)); + config.to_owned().ok_or(e) +} diff --git a/agency_client/src/utils/test_utils.rs b/agency_client/src/utils/test_utils.rs new file mode 100644 index 0000000000..6bb7a6cf4c --- /dev/null +++ b/agency_client/src/utils/test_utils.rs @@ -0,0 +1,55 @@ +use env_logger; +use std::sync::Once; + +use crate::agency_settings; +use crate::mocking; +use crate::mocking::AgencyMockDecrypted; +use crate::utils::wallet::reset_wallet_handle; + +pub struct SetupMocks; + +pub struct SetupWallet; + +lazy_static! { + static ref TEST_LOGGING_INIT: Once = Once::new(); +} + +pub fn init_test_logging() { + TEST_LOGGING_INIT.call_once(|| { + env_logger::init(); + }) +} + +fn setup() { + init_test_logging(); + agency_settings::clear_config_agency(); + agency_settings::set_testing_defaults_agency(); +} + +impl SetupMocks { + pub fn init() -> SetupMocks { + setup(); + mocking::enable_agency_mocks(); + SetupMocks + } +} + +impl Drop for SetupMocks { + fn drop(&mut self) { + AgencyMockDecrypted::clear_mocks(); + reset_wallet_handle(); + mocking::disable_agency_mocks(); + } +} + +impl SetupWallet { + pub fn init() -> SetupWallet { + SetupWallet + } +} + +impl Drop for SetupWallet { + fn drop(&mut self) { + } +} + diff --git a/agency_client/src/utils/timeout.rs b/agency_client/src/utils/timeout.rs new file mode 100644 index 0000000000..99b99a56d6 --- /dev/null +++ b/agency_client/src/utils/timeout.rs @@ -0,0 +1,29 @@ +use std::time::Duration; + +pub struct TimeoutUtils {} + +impl TimeoutUtils { + pub fn custom_timeout(secs: u64) -> Duration { + Duration::from_secs(secs) + } + + pub fn short_timeout() -> Duration { + Duration::from_secs(5) + } + + pub fn medium_timeout() -> Duration { + Duration::from_secs(15) + } + + pub fn long_timeout() -> Duration { + Duration::from_secs(50) + } + + pub fn some_long() -> Option { Some(TimeoutUtils::long_timeout()) } + + pub fn some_medium() -> Option { Some(TimeoutUtils::medium_timeout()) } + + pub fn some_short() -> Option { Some(TimeoutUtils::short_timeout()) } + + pub fn some_custom(secs: u64) -> Option { Some(TimeoutUtils::custom_timeout(secs)) } +} diff --git a/libvcx/src/agency_comm/update_profile.rs b/agency_client/src/utils/update_profile.rs similarity index 57% rename from libvcx/src/agency_comm/update_profile.rs rename to agency_client/src/utils/update_profile.rs index b09836fd35..ba1e84f1ad 100644 --- a/libvcx/src/agency_comm/update_profile.rs +++ b/agency_client/src/utils/update_profile.rs @@ -1,11 +1,9 @@ -use agency_comm::{A2AMessage, A2AMessageKinds, A2AMessageV2, agency_settings, parse_response_from_agency, prepare_message_for_agency}; -use agency_comm::message_type::MessageTypes; -use agency_comm::mocking::AgencyMock; -use agency_comm::utils::comm::post_to_agency; -use error::{VcxError, VcxErrorKind, VcxResult}; -use settings; -use utils::{httpclient, validation}; -use utils::constants::UPDATE_PROFILE_RESPONSE; +use crate::utils::error::{AgencyClientErrorKind, AgencyClientError, AgencyClientResult}; +use crate::{A2AMessageV2, A2AMessage, parse_response_from_agency, prepare_message_for_agency, agency_settings, A2AMessageKinds}; +use crate::message_type::MessageTypes; +use crate::utils::comm::post_to_agency; +use crate::utils::{constants, validation}; +use crate::mocking::AgencyMock; #[derive(Debug)] pub struct UpdateProfileDataBuilder { @@ -44,19 +42,19 @@ impl UpdateProfileDataBuilder { } } - pub fn to(&mut self, did: &str) -> VcxResult<&mut Self> { + pub fn to(&mut self, did: &str) -> AgencyClientResult<&mut Self> { validation::validate_did(did)?; self.to_did = did.to_string(); Ok(self) } - pub fn name(&mut self, name: &str) -> VcxResult<&mut Self> { + pub fn name(&mut self, name: &str) -> AgencyClientResult<&mut Self> { let config = ConfigOption { name: "name".to_string(), value: name.to_string() }; self.configs.push(config); Ok(self) } - pub fn webhook_url(&mut self, url: &Option) -> VcxResult<&mut Self> { + pub fn webhook_url(&mut self, url: &Option) -> AgencyClientResult<&mut Self> { if let Some(x) = url { validation::validate_url(x)?; let config = ConfigOption { name: "notificationWebhookUrl".to_string(), value: x.to_string() }; @@ -65,7 +63,7 @@ impl UpdateProfileDataBuilder { Ok(self) } - pub fn use_public_did(&mut self, did: &Option) -> VcxResult<&mut Self> { + pub fn use_public_did(&mut self, did: &Option) -> AgencyClientResult<&mut Self> { if let Some(x) = did { let config = ConfigOption { name: "publicDid".to_string(), value: x.to_string() }; self.configs.push(config); @@ -73,10 +71,10 @@ impl UpdateProfileDataBuilder { Ok(self) } - pub fn send_secure(&mut self) -> VcxResult<()> { + pub fn send_secure(&mut self) -> AgencyClientResult<()> { trace!("UpdateProfileData::send_secure >>>"); - AgencyMock::set_next_response(UPDATE_PROFILE_RESPONSE.to_vec()); + AgencyMock::set_next_response(constants::UPDATE_PROFILE_RESPONSE.to_vec()); let data = self.prepare_request()?; @@ -85,7 +83,7 @@ impl UpdateProfileDataBuilder { self.parse_response(response) } - fn prepare_request(&self) -> VcxResult> { + fn prepare_request(&self) -> AgencyClientResult> { let message = A2AMessage::Version2( A2AMessageV2::UpdateConfigs( UpdateConfigs { @@ -100,26 +98,23 @@ impl UpdateProfileDataBuilder { prepare_message_for_agency(&message, &agency_did) } - fn parse_response(&self, response: Vec) -> VcxResult<()> { + fn parse_response(&self, response: Vec) -> AgencyClientResult<()> { let mut response = parse_response_from_agency(&response)?; match response.remove(0) { A2AMessage::Version2(A2AMessageV2::UpdateConfigsResponse(_)) => Ok(()), - _ => Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of UpdateConfigsResponse")) + _ => Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidHttpResponse, "Message does not match any variant of UpdateConfigsResponse")) } } } #[cfg(test)] mod tests { - use agency_comm::{agency_settings, update_data}; - use agency_comm::mocking::AgencyMockDecrypted; - use libindy::utils::signus::create_and_store_my_did; - use utils::constants::{MY1_SEED, MY2_SEED, MY3_SEED}; - use utils::devsetup::*; - use utils::mockdata::mockdata_agency::AGENCY_CONFIGS_UPDATED; - - use super::*; + use crate::utils::constants::AGENCY_CONFIGS_UPDATED; + use crate::utils::update_profile::UpdateProfileDataBuilder; + use crate::mocking::AgencyMockDecrypted; + use crate::utils::test_utils::SetupMocks; + use crate::{update_data, agency_settings}; #[test] #[cfg(feature = "general_test")] @@ -135,26 +130,6 @@ mod tests { .prepare_request().unwrap(); } - #[test] - #[cfg(feature = "general_test")] - fn test_update_data_set_values_and_post() { - let _setup = SetupLibraryWallet::init(); - - let (agent_did, agent_vk) = create_and_store_my_did(Some(MY2_SEED), None).unwrap(); - let (_my_did, my_vk) = create_and_store_my_did(Some(MY1_SEED), None).unwrap(); - let (_agency_did, agency_vk) = create_and_store_my_did(Some(MY3_SEED), None).unwrap(); - - agency_settings::set_config_value(agency_settings::CONFIG_AGENCY_VERKEY, &agency_vk); - agency_settings::set_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_VERKEY, &agent_vk); - agency_settings::set_config_value(agency_settings::CONFIG_SDK_TO_REMOTE_VERKEY, &my_vk); - - let msg = update_data() - .to(agent_did.as_ref()).unwrap() - .name("name").unwrap() - .prepare_request().unwrap(); - assert!(msg.len() > 0); - } - #[test] #[cfg(feature = "general_test")] fn test_parse_update_profile_response() { diff --git a/agency_client/src/utils/validation.rs b/agency_client/src/utils/validation.rs new file mode 100644 index 0000000000..f2e6c69b2d --- /dev/null +++ b/agency_client/src/utils/validation.rs @@ -0,0 +1,117 @@ +extern crate rust_base58; + +use regex::Regex; +use url::Url; +use self::rust_base58::FromBase58; + +use crate::utils::error::{AgencyClientErrorKind, AgencyClientError, AgencyClientResult}; + +lazy_static! { + pub static ref REGEX: Regex = Regex::new("did:([a-z0-9]+):([a-zA-Z0-9:.-_]*)").unwrap(); +} + +pub fn is_fully_qualified(entity: &str) -> bool { + REGEX.is_match(&entity) +} + +pub fn validate_did(did: &str) -> AgencyClientResult { + if is_fully_qualified(did) { + Ok(did.to_string()) + } else { + let check_did = String::from(did); + match check_did.from_base58() { + Ok(ref x) if x.len() == 16 => Ok(check_did), + Ok(_) => { + warn!("ok(_)"); + return Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidDid, "Invalid DID length")); + } + Err(x) => { + warn!("Err(x)"); + return Err(AgencyClientError::from_msg(AgencyClientErrorKind::NotBase58, format!("Invalid DID: {}", x))); + } + } + } +} + +pub fn validate_verkey(verkey: &str) -> AgencyClientResult { + let check_verkey = String::from(verkey); + match check_verkey.from_base58() { + Ok(ref x) if x.len() == 32 => Ok(check_verkey), + Ok(_) => Err(AgencyClientError::from_msg(AgencyClientErrorKind::InvalidVerkey, "Invalid Verkey length")), + Err(x) => Err(AgencyClientError::from_msg(AgencyClientErrorKind::NotBase58, format!("Invalid Verkey: {}", x))), + } +} + +pub fn validate_url(url: &str) -> AgencyClientResult { + Url::parse(url) + .map_err(|err| AgencyClientError::from_msg(AgencyClientErrorKind::InvalidUrl, err))?; + Ok(url.to_string()) +} + +#[cfg(test)] +mod tests { + // use utils::devsetup::SetupDefaults; + + use super::*; + use crate::utils::error::AgencyClientErrorKind; + + #[test] + #[cfg(feature = "general_test")] + fn test_did_is_b58_and_valid_length() { + let to_did = "8XFh8yBzrpJQmNyZzgoTqB"; + match validate_did(&to_did) { + Err(_) => panic!("Should be valid did"), + Ok(x) => assert_eq!(x, to_did.to_string()) + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_did_is_b58_but_invalid_length() { + let to_did = "8XFh8yBzrpJQmNyZzgoT"; + match validate_did(&to_did) { + Err(x) => assert_eq!(x.kind(), AgencyClientErrorKind::InvalidDid), + Ok(_) => panic!("Should be invalid did"), + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_validate_did_with_non_base58() { + let to_did = "8*Fh8yBzrpJQmNyZzgoTqB"; + match validate_did(&to_did) { + Err(x) => assert_eq!(x.kind(), AgencyClientErrorKind::NotBase58), + Ok(_) => panic!("Should be invalid did"), + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_verkey_is_b58_and_valid_length() { + let verkey = "EkVTa7SCJ5SntpYyX7CSb2pcBhiVGT9kWSagA8a9T69A"; + match validate_verkey(&verkey) { + Err(_) => panic!("Should be valid verkey"), + Ok(x) => assert_eq!(x, verkey) + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_verkey_is_b58_but_invalid_length() { + let verkey = "8XFh8yBzrpJQmNyZzgoT"; + match validate_verkey(&verkey) { + Err(x) => assert_eq!(x.kind(), AgencyClientErrorKind::InvalidVerkey), + Ok(_) => panic!("Should be invalid verkey"), + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_validate_verkey_with_non_base58() { + let verkey = "*kVTa7SCJ5SntpYyX7CSb2pcBhiVGT9kWSagA8a9T69A"; + match validate_verkey(&verkey) { + Err(x) => assert_eq!(x.kind(), AgencyClientErrorKind::NotBase58), + Ok(_) => panic!("Should be invalid verkey"), + } + } +} diff --git a/agency_client/src/utils/wallet.rs b/agency_client/src/utils/wallet.rs new file mode 100644 index 0000000000..159187f04b --- /dev/null +++ b/agency_client/src/utils/wallet.rs @@ -0,0 +1,12 @@ +use indy::{INVALID_WALLET_HANDLE, WalletHandle}; + +pub static mut WALLET_HANDLE: WalletHandle = INVALID_WALLET_HANDLE; + +pub fn set_wallet_handle(handle: WalletHandle) -> WalletHandle { + unsafe { WALLET_HANDLE = handle; } + unsafe { WALLET_HANDLE } +} + +pub fn get_wallet_handle() -> WalletHandle { unsafe { WALLET_HANDLE } } + +pub fn reset_wallet_handle() { set_wallet_handle(INVALID_WALLET_HANDLE); } diff --git a/agents/node/vcxagent-core/demo/alice.js b/agents/node/vcxagent-core/demo/alice.js index 9fd5aa5780..aa75d544f5 100644 --- a/agents/node/vcxagent-core/demo/alice.js +++ b/agents/node/vcxagent-core/demo/alice.js @@ -42,7 +42,7 @@ async function getInvitationString (fetchInviteUrl) { async function runAlice (options) { logger.info('Starting.') - await initRustapi(process.env.VCX_LOG_LEVEL || 'vcx=error') + await initRustapi(process.env.VCX_LOG_LEVEL || 'vcx=error,agency_client=error') const agentName = `alice-${uuid.v4()}` const connectionId = 'alice-to-faber' const holderCredentialId = 'alice-credential' @@ -92,6 +92,7 @@ async function runAlice (options) { } function _validateMsgs (msgs) { + logger.debug(`Validating messages:\n${JSON.stringify(msgs, null, 2)}`) assert(msgs.length === 5) assert(msgs[0].uid) assert(msgs[0].statusCode) @@ -102,7 +103,7 @@ function _validateMsgs (msgs) { } async function _validateTestTailsLocation (holderCredentialId, revRegId, vcxAgent) { - logger.info(`Going to check that holder's tails location is ${testTailsUrl}`) + logger.debug(`Going to check that holder's tails location is ${testTailsUrl}`) const tailsLocation = await vcxAgent.serviceCredHolder.getTailsLocation(holderCredentialId) assert(tailsLocation === testTailsUrl) } diff --git a/agents/node/vcxagent-core/demo/faber.js b/agents/node/vcxagent-core/demo/faber.js index 62c09cc811..a50c71bb6e 100644 --- a/agents/node/vcxagent-core/demo/faber.js +++ b/agents/node/vcxagent-core/demo/faber.js @@ -15,7 +15,7 @@ const tailsFile = '/tmp/tails' async function runFaber (options) { logger.info(`Starting. Revocation enabled=${options.revocation}`) - await initRustapi(process.env.VCX_LOG_LEVEL || 'vcx=error') + await initRustapi(process.env.VCX_LOG_LEVEL || 'vcx=error,agency_client=error') let faberServer let exitcode = 0 let vcxAgent diff --git a/ci/libvcx-ubuntu.dockerfile b/ci/libvcx-ubuntu.dockerfile index cab4d45d57..7e03ffe299 100644 --- a/ci/libvcx-ubuntu.dockerfile +++ b/ci/libvcx-ubuntu.dockerfile @@ -37,7 +37,7 @@ RUN useradd -ms /bin/bash -u $UID indy USER indy WORKDIR /home/indy -COPY --chown=indy libvcx libvcx +COPY --chown=indy ./ aries-vcx/ # Install Rust toolchain RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VER} @@ -56,7 +56,7 @@ RUN mv /home/indy/indy-sdk/libindy/target/release/*.so /usr/lib USER indy RUN cargo build --release --manifest-path=$INDYSDK_PATH/libnullpay/Cargo.toml RUN cargo build --release --manifest-path=$INDYSDK_PATH/experimental/plugins/postgres_storage/Cargo.toml -RUN cargo build --release --manifest-path=/home/indy/libvcx/Cargo.toml +RUN cargo build --release --manifest-path=/home/indy/aries-vcx/Cargo.toml USER root RUN mv /home/indy/indy-sdk/libnullpay/target/release/*.so \ diff --git a/ci/libvcx.dockerfile b/ci/libvcx.dockerfile index 61f797a359..c2b7f5c5d3 100644 --- a/ci/libvcx.dockerfile +++ b/ci/libvcx.dockerfile @@ -6,10 +6,10 @@ WORKDIR /home/indy COPY --chown=indy ./ ./ USER indy -RUN cargo build --release --manifest-path=/home/indy/libvcx/Cargo.toml +RUN cargo build --release --manifest-path=/home/indy/Cargo.toml USER root -RUN mv /home/indy/libvcx/target/release/libvcx.so . +RUN mv /home/indy/target/release/libvcx.so . FROM alpine:3.12 @@ -22,6 +22,7 @@ COPY --from=builder /usr/lib/libindy.so /home/indy/lib*.so /usr/lib/ WORKDIR /home/node COPY --chown=node ./libvcx ./libvcx +COPY --chown=node ./agency_client ./agency_client COPY --chown=node ./wrappers/node ./wrappers/node COPY --chown=node ./agents/node ./agents/node diff --git a/libvcx/Cargo.toml b/libvcx/Cargo.toml index f08a06e834..ee12dcd959 100644 --- a/libvcx/Cargo.toml +++ b/libvcx/Cargo.toml @@ -57,6 +57,7 @@ uuid = {version = "0.7.1", default-features = false, features = ["v4"]} failure = "0.1.6" strum = "0.16.0" strum_macros = "0.16.0" +agency_client = { version = "0.1.0", path = "../agency_client" } [target.'cfg(target_os = "android")'.dependencies] android_logger = "0.5" @@ -95,8 +96,3 @@ provides = "libvcx (= 0.8.0)" [package.metadata.deb.variants.libvcx-bionic] name = "libvcx" provides = "libvcx (= 0.8.0)" - -[profile.release] -debug = true -panic = 'unwind' -incremental = false diff --git a/libvcx/src/agency_comm/payload.rs b/libvcx/src/agency_comm/payload.rs deleted file mode 100644 index 6a1fed3fe4..0000000000 --- a/libvcx/src/agency_comm/payload.rs +++ /dev/null @@ -1,33 +0,0 @@ -use serde_json::Value; - -use agency_comm::get_message::MessagePayload; -use agency_comm::thread::Thread; -use error::{VcxError, VcxErrorKind, VcxResult}; -use libindy::utils::crypto; -use agency_comm::message_type::MessageTypeV2; - -#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)] -#[serde(untagged)] -pub enum PayloadTypes { - PayloadTypeV1(PayloadTypeV1), - PayloadTypeV2(PayloadTypeV2), -} - -#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] -pub struct PayloadTypeV1 { - pub name: String, - ver: String, - fmt: String, -} - -type PayloadTypeV2 = MessageTypeV2; - -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] -pub enum PayloadKinds { - CredOffer, - CredReq, - Cred, - Proof, - ProofRequest, - Other(String), -} diff --git a/libvcx/src/agency_comm/update_message.rs b/libvcx/src/agency_comm/update_message.rs deleted file mode 100644 index 6d8fa73a88..0000000000 --- a/libvcx/src/agency_comm/update_message.rs +++ /dev/null @@ -1,190 +0,0 @@ -use agency_comm::{A2AMessage, A2AMessageKinds, A2AMessageV2, agency_settings, MessageStatusCode, parse_response_from_agency, prepare_message_for_agency}; -use agency_comm::message_type::MessageTypes; -use agency_comm::mocking::AgencyMock; -use agency_comm::utils::comm::post_to_agency; -use error::{VcxError, VcxErrorKind, VcxResult}; -use settings; -use utils::{constants, httpclient}; -use crate::agency_comm::mocking; - -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] -#[serde(rename_all = "camelCase")] -pub struct UpdateMessageStatusByConnections { - #[serde(rename = "@type")] - msg_type: MessageTypes, - status_code: Option, - uids_by_conns: Vec, -} - -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] -#[serde(rename_all = "camelCase")] -pub struct UpdateMessageStatusByConnectionsResponse { - #[serde(rename = "@type")] - msg_type: MessageTypes, - status_code: Option, - updated_uids_by_conns: Vec, -} - -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] -#[serde(rename_all = "camelCase")] -pub struct UIDsByConn { - #[serde(rename = "pairwiseDID")] - pub pairwise_did: String, - pub uids: Vec, -} - -struct UpdateMessageStatusByConnectionsBuilder { - status_code: Option, - uids_by_conns: Vec, -} - -impl UpdateMessageStatusByConnectionsBuilder { - pub fn create() -> UpdateMessageStatusByConnectionsBuilder { - trace!("UpdateMessageStatusByConnectionsBuilder::create >>>"); - - UpdateMessageStatusByConnectionsBuilder { - status_code: None, - uids_by_conns: Vec::new(), - } - } - - pub fn uids_by_conns(&mut self, uids_by_conns: Vec) -> VcxResult<&mut Self> { - //Todo: validate msg_uid?? - self.uids_by_conns = uids_by_conns; - Ok(self) - } - - pub fn status_code(&mut self, code: MessageStatusCode) -> VcxResult<&mut Self> { - //Todo: validate that it can be parsed to number?? - self.status_code = Some(code.clone()); - Ok(self) - } - - pub fn send_secure(&mut self) -> VcxResult<()> { - trace!("UpdateMessages::send >>>"); - - AgencyMock::set_next_response(constants::UPDATE_MESSAGES_RESPONSE.to_vec()); - - let data = self.prepare_request()?; - - let response = post_to_agency(&data)?; - - self.parse_response(&response) - } - - fn prepare_request(&mut self) -> VcxResult> { - let message = A2AMessage::Version2( - A2AMessageV2::UpdateMessageStatusByConnections( - UpdateMessageStatusByConnections { - msg_type: MessageTypes::build(A2AMessageKinds::UpdateMessageStatusByConnections), - uids_by_conns: self.uids_by_conns.clone(), - status_code: self.status_code.clone(), - } - ) - ); - - let agency_did = agency_settings::get_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_DID)?; - prepare_message_for_agency(&message, &agency_did) - } - - fn parse_response(&self, response: &Vec) -> VcxResult<()> { - trace!("UpdateMessageStatusByConnectionsBuilder::parse_response >>>"); - - let mut response = parse_response_from_agency(response)?; - - match response.remove(0) { - A2AMessage::Version2(A2AMessageV2::UpdateMessageStatusByConnectionsResponse(_)) => Ok(()), - _ => Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of UpdateMessageStatusByConnectionsResponse")) - } - } -} - -pub fn update_agency_messages(status_code: &str, msg_json: &str) -> VcxResult<()> { - trace!("update_agency_messages >>> status_code: {:?}, msg_json: {:?}", status_code, msg_json); - - let status_code: MessageStatusCode = ::serde_json::from_str(&format!("\"{}\"", status_code)) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot deserialize MessageStatusCode: {}", err)))?; - - debug!("updating agency messages {} to status code: {:?}", msg_json, status_code); - - let uids_by_conns: Vec = serde_json::from_str(msg_json) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot deserialize UIDsByConn: {}", err)))?; - - update_messages(status_code, uids_by_conns) -} - -pub fn update_messages(status_code: MessageStatusCode, uids_by_conns: Vec) -> VcxResult<()> { - trace!("update_messages >>> "); - - if mocking::agency_mocks_enabled() { - trace!("update_messages >>> agency mocks enabled, returning empty response"); - return Ok(()); - }; - - UpdateMessageStatusByConnectionsBuilder::create() - .uids_by_conns(uids_by_conns)? - .status_code(status_code)? - .send_secure() -} - -#[cfg(test)] -mod tests { - #[cfg(any(feature = "agency_pool_tests"))] - use std::thread; - #[cfg(any(feature = "agency_pool_tests"))] - use std::time::Duration; - - use agency_comm::get_message::download_messages_noauth; - use agency_comm::MessageStatusCode; - use agency_comm::mocking::AgencyMockDecrypted; - use agency_comm::update_message::{UIDsByConn, update_agency_messages, UpdateMessageStatusByConnectionsBuilder}; - use connection::send_generic_message; - use utils::devsetup::{SetupLibraryAgencyV2, SetupMocks}; - use utils::mockdata::mockdata_agency::AGENCY_MSG_STATUS_UPDATED_BY_CONNS; - - #[test] - #[cfg(feature = "general_test")] - fn test_parse_parse_update_messages_response() { - let _setup = SetupMocks::init(); - AgencyMockDecrypted::set_next_decrypted_response(AGENCY_MSG_STATUS_UPDATED_BY_CONNS); - UpdateMessageStatusByConnectionsBuilder::create().parse_response(&Vec::from("")).unwrap(); - } - - #[cfg(feature = "agency_pool_tests")] - #[test] - fn test_update_agency_messages() { - let _setup = SetupLibraryAgencyV2::init(); - let (_alice_to_faber, faber_to_alice) = ::connection::tests::create_connected_connections(None, None); - - send_generic_message(faber_to_alice, "Hello 1").unwrap(); - send_generic_message(faber_to_alice, "Hello 2").unwrap(); - send_generic_message(faber_to_alice, "Hello 3").unwrap(); - - thread::sleep(Duration::from_millis(1000)); - ::utils::devsetup::set_consumer(None); - - let received = download_messages_noauth(None, Some(vec![MessageStatusCode::Received.to_string()]), None).unwrap(); - assert_eq!(received.len(), 1); - assert_eq!(received[0].msgs.len(), 3); - let pairwise_did = received[0].pairwise_did.clone(); - let uid = received[0].msgs[0].uid.clone(); - - let reviewed = download_messages_noauth(Some(vec![pairwise_did.clone()]), Some(vec![MessageStatusCode::Reviewed.to_string()]), None).unwrap(); - let reviewed_count_before = reviewed[0].msgs.len(); - - // update status - let message = serde_json::to_string(&vec![UIDsByConn { pairwise_did: pairwise_did.clone(), uids: vec![uid.clone()] }]).unwrap(); - update_agency_messages("MS-106", &message).unwrap(); - - let received = download_messages_noauth(None, Some(vec![MessageStatusCode::Received.to_string()]), None).unwrap(); - assert_eq!(received.len(), 1); - assert_eq!(received[0].msgs.len(), 2); - - let reviewed = download_messages_noauth(Some(vec![pairwise_did.clone()]), Some(vec![MessageStatusCode::Reviewed.to_string()]), None).unwrap(); - let reviewed_count_after = reviewed[0].msgs.len(); - assert_eq!(reviewed_count_after, reviewed_count_before + 1); - - let specific_review = download_messages_noauth(Some(vec![pairwise_did.clone()]), Some(vec![MessageStatusCode::Reviewed.to_string()]), Some(vec![uid.clone()])).unwrap(); - assert_eq!(specific_review[0].msgs[0].uid, uid); - } -} diff --git a/libvcx/src/agency_comm/utils/comm.rs b/libvcx/src/agency_comm/utils/comm.rs deleted file mode 100644 index 18be3d6764..0000000000 --- a/libvcx/src/agency_comm/utils/comm.rs +++ /dev/null @@ -1,8 +0,0 @@ -use agency_comm::agency_settings; -use error::VcxResult; -use utils; - -pub fn post_to_agency(body_content: &Vec) -> VcxResult> { - let endpoint = format!("{}/agency/msg", agency_settings::get_config_value(agency_settings::CONFIG_AGENCY_ENDPOINT)?); - utils::httpclient::post_message(body_content, &endpoint) -} diff --git a/libvcx/src/agency_comm/utils/mod.rs b/libvcx/src/agency_comm/utils/mod.rs deleted file mode 100644 index 90c92e9726..0000000000 --- a/libvcx/src/agency_comm/utils/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod agent_utils; -pub(super) mod comm; \ No newline at end of file diff --git a/libvcx/src/api/connection.rs b/libvcx/src/api/connection.rs index e981c644bd..4069d8d147 100644 --- a/libvcx/src/api/connection.rs +++ b/libvcx/src/api/connection.rs @@ -1207,7 +1207,7 @@ mod tests { use serde_json::Value; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::mocking::AgencyMockDecrypted; use api::{return_types_u32, VcxStateType}; use connection::tests::{build_test_connection_inviter_invited, build_test_connection_inviter_null, build_test_connection_inviter_requested}; use utils::constants::{DELETE_CONNECTION_DECRYPTED_RESPONSE, GET_MESSAGES_DECRYPTED_RESPONSE}; diff --git a/libvcx/src/api/credential.rs b/libvcx/src/api/credential.rs index c90789bfc2..2db712feb0 100644 --- a/libvcx/src/api/credential.rs +++ b/libvcx/src/api/credential.rs @@ -998,7 +998,7 @@ mod tests { use serde_json::Value; use ::credential::tests::BAD_CREDENTIAL_OFFER; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::mocking::AgencyMockDecrypted; use api::return_types_u32; use api::VcxStateType; use utils::constants::{GET_MESSAGES_DECRYPTED_RESPONSE, V3_OBJECT_SERIALIZE_VERSION}; diff --git a/libvcx/src/api/disclosed_proof.rs b/libvcx/src/api/disclosed_proof.rs index e68070297e..f97adf6836 100644 --- a/libvcx/src/api/disclosed_proof.rs +++ b/libvcx/src/api/disclosed_proof.rs @@ -994,7 +994,7 @@ mod tests { use serde_json::Value; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::mocking::AgencyMockDecrypted; use api::return_types_u32; use api::VcxStateType; use utils::constants::{CREDS_FROM_PROOF_REQ, GET_MESSAGES_DECRYPTED_RESPONSE, V3_OBJECT_SERIALIZE_VERSION}; diff --git a/libvcx/src/api/filters.rs b/libvcx/src/api/filters.rs index 47834f7828..3ba36fdc91 100644 --- a/libvcx/src/api/filters.rs +++ b/libvcx/src/api/filters.rs @@ -60,7 +60,7 @@ pub extern fn vcx_filter_proof_requests_by_name(command_handle: CommandHandle, mod tests { use std::ffi::CString; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::mocking::AgencyMockDecrypted; use api::return_types_u32; use connection; use disclosed_proof::get_proof_request_messages; diff --git a/libvcx/src/api/issuer_credential.rs b/libvcx/src/api/issuer_credential.rs index ebfb27e78b..db00e3cc3b 100644 --- a/libvcx/src/api/issuer_credential.rs +++ b/libvcx/src/api/issuer_credential.rs @@ -843,7 +843,7 @@ pub mod tests { use std::ffi::CString; use std::ptr; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::mocking::AgencyMockDecrypted; use api::{return_types_u32, VcxStateType}; use settings; use utils::constants::*; diff --git a/libvcx/src/api/utils.rs b/libvcx/src/api/utils.rs index c14b46e99f..a28db8d9f6 100644 --- a/libvcx/src/api/utils.rs +++ b/libvcx/src/api/utils.rs @@ -5,9 +5,8 @@ use indy_sys::CommandHandle; use libc::c_char; use serde_json; -use agency_comm; -use agency_comm::get_message::{parse_connection_handles, parse_status_codes}; -use agency_comm::mocking::AgencyMock; +use agency_client::get_message::{parse_connection_handles, parse_status_codes}; +use agency_client::mocking::AgencyMock; use connection; use error::prelude::*; use libindy::utils::payments; @@ -44,7 +43,7 @@ pub extern fn vcx_provision_agent(config: *const c_char) -> *mut c_char { trace!("vcx_provision_agent(config: {})", config); - match agency_comm::utils::agent_utils::connect_register_provision(&config) { + match ::utils::provision::connect_register_provision(&config) { Err(e) => { error!("Provision Agent Error {}.", e); let _res: u32 = e.into(); @@ -84,7 +83,7 @@ pub extern fn vcx_agent_provision_async(command_handle: CommandHandle, command_handle, config); thread::spawn(move || { - match agency_comm::utils::agent_utils::connect_register_provision(&config) { + match ::utils::provision::connect_register_provision(&config) { Err(e) => { error!("vcx_agent_provision_async_cb(command_handle: {}, rc: {}, config: NULL", command_handle, e); cb(command_handle, e.into(), ptr::null_mut()); @@ -190,8 +189,6 @@ pub extern fn vcx_set_next_agency_response(message_index: u32) { info!("vcx_set_next_agency_response >>>"); let message = match message_index { - 2 => UPDATE_PROFILE_RESPONSE.to_vec(), - 3 => GET_MESSAGES_RESPONSE.to_vec(), 4 => UPDATE_CREDENTIAL_RESPONSE.to_vec(), 5 => UPDATE_PROOF_RESPONSE.to_vec(), 6 => CREDENTIAL_REQ_RESPONSE.to_vec(), @@ -331,7 +328,7 @@ pub extern fn vcx_messages_download(command_handle: CommandHandle, command_handle, message_status, uids); spawn(move || { - match ::agency_comm::get_message::download_messages_noauth(pw_dids, message_status, uids) { + match ::agency_client::get_message::download_messages_noauth(pw_dids, message_status, uids) { Ok(x) => { match serde_json::to_string(&x) { Ok(x) => { @@ -484,7 +481,7 @@ pub extern fn vcx_messages_update_status(command_handle: CommandHandle, command_handle, message_status, msg_json); spawn(move || { - match ::agency_comm::update_message::update_agency_messages(&message_status, &msg_json) { + match ::agency_client::update_message::update_agency_messages(&message_status, &msg_json) { Ok(()) => { trace!("vcx_messages_set_status_cb(command_handle: {}, rc: {})", command_handle, error::SUCCESS.message); @@ -619,7 +616,7 @@ pub extern fn vcx_endorse_transaction(command_handle: CommandHandle, mod tests { use std::ffi::CString; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::mocking::AgencyMockDecrypted; use api::return_types_u32; use utils::constants; use utils::devsetup::*; diff --git a/libvcx/src/api/vcx.rs b/libvcx/src/api/vcx.rs index a8c84e2529..9e9c72bd06 100644 --- a/libvcx/src/api/vcx.rs +++ b/libvcx/src/api/vcx.rs @@ -4,7 +4,6 @@ use indy::{CommandHandle, INVALID_WALLET_HANDLE}; use indy_sys::{INVALID_POOL_HANDLE, WalletHandle}; use libc::c_char; -use agency_comm::agency_settings; use error::prelude::*; use init::{init_core, open_as_main_wallet, open_pool}; use libindy::utils::{ledger, pool, wallet}; @@ -257,7 +256,7 @@ pub extern fn vcx_update_webhook_url(command_handle: CommandHandle, settings::set_config_value(::settings::CONFIG_WEBHOOK_URL, ¬ification_webhook_url); spawn(move || { - match ::agency_comm::utils::agent_utils::update_agent_webhook(¬ification_webhook_url[..]) { + match ::agency_client::utils::agent_utils::update_agent_webhook(¬ification_webhook_url[..]) { Ok(()) => { trace!("vcx_update_webhook_url_cb(command_handle: {}, rc: {})", command_handle, error::SUCCESS.message); @@ -421,7 +420,7 @@ mod tests { #[cfg(feature = "pool_tests")] use indy_sys::INVALID_POOL_HANDLE; - use agency_comm::agency_settings; + use agency_client::agency_settings; use api::return_types_u32; use api::VcxStateType; use api::wallet::{vcx_wallet_add_record, vcx_wallet_get_record}; diff --git a/libvcx/src/aries/handlers/connection/agent_info.rs b/libvcx/src/aries/handlers/connection/agent_info.rs index 3b7b1fae4b..8e101f9d2c 100644 --- a/libvcx/src/aries/handlers/connection/agent_info.rs +++ b/libvcx/src/aries/handlers/connection/agent_info.rs @@ -1,9 +1,9 @@ use std::collections::HashMap; -use agency_comm::get_message::{get_connection_messages, Message}; -use agency_comm::{MessageStatusCode, agency_settings}; -use agency_comm::update_connection::send_delete_connection_message; -use agency_comm::update_message::{UIDsByConn, update_messages as update_messages_status}; +use agency_client::get_message::{get_connection_messages, Message}; +use agency_client::{MessageStatusCode, agency_settings}; +use agency_client::update_connection::send_delete_connection_message; +use agency_client::update_message::{UIDsByConn, update_messages as update_messages_status}; use aries::messages::a2a::A2AMessage; use aries::messages::connection::did_doc::DidDoc; use aries::utils::encryption_envelope::EncryptionEnvelope; @@ -11,7 +11,7 @@ use connection::create_agent_keys; use error::prelude::*; use libindy::utils::signus::create_and_store_my_did; use settings; -use utils::httpclient; +use agency_client::httpclient; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AgentInfo { @@ -67,6 +67,7 @@ impl AgentInfo { pub fn agency_endpoint(&self) -> VcxResult { agency_settings::get_config_value(agency_settings::CONFIG_AGENCY_ENDPOINT) .map(|str| format!("{}/agency/msg", str)) + .map_err(|err| err.into()) } pub fn routing_keys(&self) -> VcxResult> { @@ -87,10 +88,13 @@ impl AgentInfo { }]; update_messages_status(MessageStatusCode::Reviewed, messages_to_update) + .map_err(|err| err.into()) } pub fn download_encrypted_messages(&self, msg_uid: Option>, status_codes: Option>) -> VcxResult> { + trace!("download_encrypted_messages >>>"); get_connection_messages(&self.pw_did, &self.pw_vk, &self.agent_did, &self.agent_vk, msg_uid, status_codes) + .map_err(|err| err.into()) } pub fn get_messages(&self, expect_sender_vk: &str) -> VcxResult> { @@ -171,5 +175,6 @@ impl AgentInfo { pub fn delete(&self) -> VcxResult<()> { trace!("Agent::delete >>>"); send_delete_connection_message(&self.pw_did, &self.pw_vk, &self.agent_did, &self.agent_vk) + .map_err(|err| err.into()) } } diff --git a/libvcx/src/aries/handlers/connection/connection.rs b/libvcx/src/aries/handlers/connection/connection.rs index 0a95bb3e45..fa113d8dce 100644 --- a/libvcx/src/aries/handlers/connection/connection.rs +++ b/libvcx/src/aries/handlers/connection/connection.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use error::prelude::*; -use agency_comm::get_message::Message; use aries::handlers::connection::agent_info::AgentInfo; use aries::handlers::connection::invitee::state_machine::{InviteeState, SmConnectionInvitee}; use aries::handlers::connection::inviter::state_machine::{InviterState, SmConnectionInviter}; diff --git a/libvcx/src/aries/handlers/connection/mod.rs b/libvcx/src/aries/handlers/connection/mod.rs index 22b28e53a1..a7a811a913 100644 --- a/libvcx/src/aries/handlers/connection/mod.rs +++ b/libvcx/src/aries/handlers/connection/mod.rs @@ -88,7 +88,7 @@ pub mod tests { } } - let _res = ::agency_comm::get_message::download_messages_noauth(None, None, Some(vec![uid.clone()])).unwrap(); + let _res = ::agency_client::get_message::download_messages_noauth(None, None, Some(vec![uid.clone()])).unwrap(); info!("test_connection_send_works:: Test if Get Message by id works"); { @@ -135,7 +135,7 @@ pub mod tests { info!("test_connection_send_works:: Test if Download Messages"); { - use agency_comm::get_message::{download_messages_noauth, MessageByConnection, Message}; + use agency_client::get_message::{download_messages_noauth, MessageByConnection, Message}; let credential_offer = ::aries::messages::issuance::credential_offer::tests::_credential_offer(); diff --git a/libvcx/src/aries/messages/a2a/message_type.rs b/libvcx/src/aries/messages/a2a/message_type.rs index bf9ac06bd7..521db3c8b3 100644 --- a/libvcx/src/aries/messages/a2a/message_type.rs +++ b/libvcx/src/aries/messages/a2a/message_type.rs @@ -1,7 +1,7 @@ use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value; -use agency_comm::message_type::parse_message_type; +use agency_client::message_type::parse_message_type; use aries::messages::a2a::message_family::MessageFamilies; #[derive(Debug, Clone, PartialEq, Default)] diff --git a/libvcx/src/aries/messages/ack.rs b/libvcx/src/aries/messages/ack.rs index 76c7cd799f..3bd5936c81 100644 --- a/libvcx/src/aries/messages/ack.rs +++ b/libvcx/src/aries/messages/ack.rs @@ -1,4 +1,4 @@ -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -76,4 +76,4 @@ pub mod tests { assert_eq!(_ack(), ack); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/connection/problem_report.rs b/libvcx/src/aries/messages/connection/problem_report.rs index 4e3527b87d..93da4c73c5 100644 --- a/libvcx/src/aries/messages/connection/problem_report.rs +++ b/libvcx/src/aries/messages/connection/problem_report.rs @@ -1,4 +1,4 @@ -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::localization::Localization; diff --git a/libvcx/src/aries/messages/connection/response.rs b/libvcx/src/aries/messages/connection/response.rs index a9a4505223..9ff57e5eef 100644 --- a/libvcx/src/aries/messages/connection/response.rs +++ b/libvcx/src/aries/messages/connection/response.rs @@ -2,7 +2,7 @@ use base64; use time; use error::prelude::*; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use libindy::utils::crypto; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::a2a::message_family::MessageFamilies; @@ -220,4 +220,4 @@ pub mod tests { let signed_response: SignedResponse = _response().encode(&trustee_key).unwrap(); assert_eq!(_response(), signed_response.decode(&trustee_key).unwrap()); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/discovery/disclose.rs b/libvcx/src/aries/messages/discovery/disclose.rs index 7ce52935cd..ce293d8a95 100644 --- a/libvcx/src/aries/messages/discovery/disclose.rs +++ b/libvcx/src/aries/messages/discovery/disclose.rs @@ -1,4 +1,4 @@ -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use settings::Actors; use aries::messages::a2a::{MessageId, A2AMessage}; @@ -69,4 +69,4 @@ pub mod tests { assert_eq!(_disclose(), disclose); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/error.rs b/libvcx/src/aries/messages/error.rs index 7172c0b1fa..b9e70b8fc4 100644 --- a/libvcx/src/aries/messages/error.rs +++ b/libvcx/src/aries/messages/error.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -139,4 +139,4 @@ pub mod tests { assert_eq!(_problem_report(), report); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/issuance/credential.rs b/libvcx/src/aries/messages/issuance/credential.rs index a1436462cc..bfa88fc2a1 100644 --- a/libvcx/src/aries/messages/issuance/credential.rs +++ b/libvcx/src/aries/messages/issuance/credential.rs @@ -1,6 +1,6 @@ use error::VcxResult; use error::prelude::*; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::ack::PleaseAck; use aries::messages::attachment::{AttachmentId, Attachments}; diff --git a/libvcx/src/aries/messages/issuance/credential_offer.rs b/libvcx/src/aries/messages/issuance/credential_offer.rs index 520de0609d..7a2c60aa0d 100644 --- a/libvcx/src/aries/messages/issuance/credential_offer.rs +++ b/libvcx/src/aries/messages/issuance/credential_offer.rs @@ -1,5 +1,5 @@ use error::VcxResult; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::attachment::{AttachmentId, Attachments}; use aries::messages::issuance::CredentialPreviewData; diff --git a/libvcx/src/aries/messages/issuance/credential_proposal.rs b/libvcx/src/aries/messages/issuance/credential_proposal.rs index be85376e2c..64f54bbc7d 100644 --- a/libvcx/src/aries/messages/issuance/credential_proposal.rs +++ b/libvcx/src/aries/messages/issuance/credential_proposal.rs @@ -1,5 +1,5 @@ use error::VcxResult; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::issuance::CredentialPreviewData; use aries::messages::mime_type::MimeType; @@ -101,4 +101,4 @@ pub mod tests { assert_eq!(_credential_proposal(), credential_proposal); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/issuance/credential_request.rs b/libvcx/src/aries/messages/issuance/credential_request.rs index 92e1913cae..3eac9c0a36 100644 --- a/libvcx/src/aries/messages/issuance/credential_request.rs +++ b/libvcx/src/aries/messages/issuance/credential_request.rs @@ -1,5 +1,5 @@ use error::VcxResult; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::attachment::{AttachmentId, Attachments}; @@ -73,4 +73,4 @@ pub mod tests { assert_eq!(_credential_request(), credential_request); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/mod.rs b/libvcx/src/aries/messages/mod.rs index 9ceb2bf9ca..cc68230cea 100644 --- a/libvcx/src/aries/messages/mod.rs +++ b/libvcx/src/aries/messages/mod.rs @@ -1,4 +1,6 @@ #[macro_use] +pub mod thread; +#[macro_use] pub mod a2a; #[macro_use] pub mod ack; @@ -13,4 +15,4 @@ pub mod proof_presentation; pub mod discovery; pub mod trust_ping; pub mod basic_message; -pub mod localization; \ No newline at end of file +pub mod localization; diff --git a/libvcx/src/aries/messages/proof_presentation/presentation.rs b/libvcx/src/aries/messages/proof_presentation/presentation.rs index 2b7f9d1490..6408d61f8f 100644 --- a/libvcx/src/aries/messages/proof_presentation/presentation.rs +++ b/libvcx/src/aries/messages/proof_presentation/presentation.rs @@ -1,7 +1,5 @@ -use std::convert::TryInto; - use error::prelude::*; -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::ack::PleaseAck; use aries::messages::attachment::{AttachmentId, Attachments}; diff --git a/libvcx/src/aries/messages/proof_presentation/presentation_proposal.rs b/libvcx/src/aries/messages/proof_presentation/presentation_proposal.rs index 5d34c0c5da..552c58c955 100644 --- a/libvcx/src/aries/messages/proof_presentation/presentation_proposal.rs +++ b/libvcx/src/aries/messages/proof_presentation/presentation_proposal.rs @@ -1,4 +1,4 @@ -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; use aries::messages::a2a::message_family::MessageFamilies; use aries::messages::a2a::message_type::MessageType; diff --git a/libvcx/src/aries/messages/proof_presentation/presentation_request.rs b/libvcx/src/aries/messages/proof_presentation/presentation_request.rs index c43bb67685..9186978be6 100644 --- a/libvcx/src/aries/messages/proof_presentation/presentation_request.rs +++ b/libvcx/src/aries/messages/proof_presentation/presentation_request.rs @@ -56,7 +56,7 @@ pub type PresentationRequestData = ProofRequestData; #[cfg(test)] pub mod tests { - use agency_comm::thread::Thread; + use aries::messages::thread::Thread; use aries::messages::connection::service::tests::_service; use super::*; @@ -122,4 +122,4 @@ pub mod tests { assert_eq!(_presentation_request_with_service(), presentation_request); } -} \ No newline at end of file +} diff --git a/libvcx/src/agency_comm/thread.rs b/libvcx/src/aries/messages/thread.rs similarity index 99% rename from libvcx/src/agency_comm/thread.rs rename to libvcx/src/aries/messages/thread.rs index 1b65286709..5ad6e21505 100644 --- a/libvcx/src/agency_comm/thread.rs +++ b/libvcx/src/aries/messages/thread.rs @@ -56,4 +56,4 @@ macro_rules! threadlike (($type:ident) => ( self.thread.is_reply(id) } } -)); \ No newline at end of file +)); diff --git a/libvcx/src/aries/messages/trust_ping/ping.rs b/libvcx/src/aries/messages/trust_ping/ping.rs index d067161508..98ff0d8f7c 100644 --- a/libvcx/src/aries/messages/trust_ping/ping.rs +++ b/libvcx/src/aries/messages/trust_ping/ping.rs @@ -1,4 +1,4 @@ -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -65,4 +65,4 @@ pub mod tests { assert_eq!(_ping(), ping); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/messages/trust_ping/ping_response.rs b/libvcx/src/aries/messages/trust_ping/ping_response.rs index cbce022236..db7245dadb 100644 --- a/libvcx/src/aries/messages/trust_ping/ping_response.rs +++ b/libvcx/src/aries/messages/trust_ping/ping_response.rs @@ -1,4 +1,4 @@ -use agency_comm::thread::Thread; +use aries::messages::thread::Thread; use aries::messages::a2a::{A2AMessage, MessageId}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -52,4 +52,4 @@ pub mod tests { assert_eq!(_ping_response(), ping_response); } -} \ No newline at end of file +} diff --git a/libvcx/src/aries/mod.rs b/libvcx/src/aries/mod.rs index 0b3223f63d..60d7bdb6b6 100644 --- a/libvcx/src/aries/mod.rs +++ b/libvcx/src/aries/mod.rs @@ -1,7 +1,7 @@ #[macro_use] -pub mod utils; pub mod handlers; pub mod messages; +pub mod utils; pub const SERIALIZE_VERSION: &'static str = "2.0"; @@ -11,14 +11,13 @@ pub mod test { use ::{rand, settings}; use rand::Rng; - use agency_comm::utils::agent_utils::connect_register_provision; - use agency_comm::payload::{PayloadKinds}; + use utils::provision::connect_register_provision; + use agency_client::payload::PayloadKinds; use utils::devsetup::*; use libindy::utils::wallet::*; use utils::plugins::init_plugin; use aries::messages::a2a::A2AMessage; use error::{VcxResult, VcxErrorKind, VcxError}; - use serde_json::Value; pub fn source_id() -> String { String::from("test source id") @@ -77,7 +76,7 @@ pub mod test { } fn download_message(did: String, filter_msg_type: PayloadKinds) -> VcxAgencyMessage { - let mut messages = ::agency_comm::get_message::download_messages_noauth(Some(vec![did]), Some(vec![String::from("MS-103")]), None).unwrap(); + let mut messages = ::agency_client::get_message::download_messages_noauth(Some(vec![did]), Some(vec![String::from("MS-103")]), None).unwrap(); assert_eq!(1, messages.len()); let messages = messages.pop().unwrap(); diff --git a/libvcx/src/aries/utils/encryption_envelope.rs b/libvcx/src/aries/utils/encryption_envelope.rs index 4bb7443bd0..3b5c729a90 100644 --- a/libvcx/src/aries/utils/encryption_envelope.rs +++ b/libvcx/src/aries/utils/encryption_envelope.rs @@ -1,4 +1,4 @@ -use agency_comm::mocking::AgencyMockDecrypted; +use agency_client::mocking::AgencyMockDecrypted; use aries::messages::a2a::A2AMessage; use aries::messages::connection::did_doc::DidDoc; use aries::messages::forward::Forward; @@ -101,6 +101,7 @@ impl EncryptionEnvelope { AgencyMockDecrypted::get_next_decrypted_message() } else { let (a2a_message, sender_vk) = Self::_unpack_a2a_message(payload)?; + trace!("anon_unpack >> a2a_msg: {:?}, sender_vk: {:?}", a2a_message, sender_vk); match sender_vk { Some(sender_vk) => { @@ -126,7 +127,6 @@ impl EncryptionEnvelope { #[cfg(test)] pub mod tests { - use agency_comm::agency_settings; use aries::messages::ack::tests::_ack; use aries::messages::connection::did_doc::tests::*; use libindy::utils::crypto::create_key; diff --git a/libvcx/src/connection.rs b/libvcx/src/connection.rs index 91d8816718..46370b992c 100644 --- a/libvcx/src/connection.rs +++ b/libvcx/src/connection.rs @@ -2,9 +2,9 @@ use std::collections::HashMap; use serde_json; -use agency_comm; -use agency_comm::{MessageStatusCode, SerializableObjectWithState}; -use agency_comm::get_message::{get_bootstrap_agent_messages, Message, MessageByConnection}; +use agency_client; +use agency_client::{MessageStatusCode, SerializableObjectWithState}; +use agency_client::get_message::{Message, MessageByConnection}; use aries::handlers::connection::agent_info::AgentInfo; use aries::handlers::connection::connection::{Connection, SmConnectionState}; use aries::messages::a2a::A2AMessage; @@ -22,12 +22,13 @@ lazy_static! { pub fn create_agent_keys(source_id: &str, pw_did: &str, pw_verkey: &str) -> VcxResult<(String, String)> { debug!("creating pairwise keys on agent for connection {}", source_id); - let (agent_did, agent_verkey) = agency_comm::create_keys() + let (agent_did, agent_verkey) = agency_client::create_keys() .for_did(pw_did)? .for_verkey(pw_verkey)? .send_secure() .map_err(|err| err.extend("Cannot create pairwise keys"))?; + trace!("create_agent_keys <<< agent_did: {}, agent_verkey: {}", agent_did, agent_verkey); Ok((agent_did, agent_verkey)) } @@ -118,6 +119,18 @@ pub fn update_state_with_message(handle: u32, message: A2AMessage) -> VcxResult< }) } +fn get_bootstrap_agent_messages(remote_vk: VcxResult, bootstrap_agent_info: Option<&AgentInfo>) -> VcxResult, AgentInfo)>> { + let expected_sender_vk = match remote_vk { + Ok(vk) => vk, + Err(_) => return Ok(None) + }; + if let Some(bootstrap_agent_info) = bootstrap_agent_info { + let messages = bootstrap_agent_info.get_messages(&expected_sender_vk)?; + return Ok(Some((messages, bootstrap_agent_info.clone()))); + } + Ok(None) +} + /** Tries to update state of connection state machine in 3 steps: 1. find relevant message in agency, @@ -178,7 +191,7 @@ pub fn connect(handle: u32) -> VcxResult> { pub fn to_string(handle: u32) -> VcxResult { CONNECTION_MAP.get(handle, |connection| { let (state, data, source_id) = connection.to_owned().into(); - let object = SerializableObjectWithState::V3 { data, state, source_id }; + let object = SerializableObjectWithState::V1 { data, state, source_id }; ::serde_json::to_string(&object) .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidState, format!("Cannot serialize Connection: {:?}", err))) @@ -190,7 +203,7 @@ pub fn from_string(connection_data: &str) -> VcxResult { .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Cannot deserialize Connection: {:?}", err)))?; let handle = match object { - SerializableObjectWithState::V3 { data, state, source_id } => { + SerializableObjectWithState::V1 { data, state, source_id } => { CONNECTION_MAP.add((state, data, source_id).into())? } _ => return Err(VcxError::from_msg(VcxErrorKind::InvalidJson, format!("Unexpected format of serialized connection: {:?}", object))) @@ -280,6 +293,7 @@ pub fn get_connection_info(handle: u32) -> VcxResult { } pub fn download_messages(conn_handles: Vec, status_codes: Option>, uids: Option>) -> VcxResult> { + trace!("download_messages >>> cann_handles: {:?}, status_codes: {:?}, uids: {:?}", conn_handles, status_codes, uids); let mut res = Vec::new(); for conn_handle in conn_handles { let msg_by_conn = CONNECTION_MAP.get( @@ -289,13 +303,14 @@ pub fn download_messages(conn_handles: Vec, status_codes: Option>>()?; Ok(MessageByConnection { pairwise_did: connection.agent_info().clone().pw_did, msgs }) }, )?; res.push(msg_by_conn); }; + trace!("download_messages <<< res: {:?}", res); Ok(res) } @@ -306,9 +321,10 @@ pub mod tests { use serde_json::Value; - use agency_comm::get_message::download_messages_noauth; - use agency_comm::MessageStatusCode; - use agency_comm::mocking::AgencyMockDecrypted; + use agency_client::get_message::download_messages_noauth; + use agency_client::MessageStatusCode; + use agency_client::mocking::AgencyMockDecrypted; + use agency_client::update_message::{update_agency_messages, UIDsByConn}; use api::VcxStateType; use utils::constants::*; use utils::constants; @@ -715,4 +731,42 @@ pub mod tests { assert_eq!(consumer1_reviewed_msgs[0].msgs.len(), 1); assert!(consumer1_reviewed_msgs[0].msgs[0].decrypted_msg.is_some()); } + + #[cfg(feature = "agency_pool_tests")] + #[test] + fn test_update_agency_messages() { + let _setup = SetupLibraryAgencyV2::init(); + let (_alice_to_faber, faber_to_alice) = ::connection::tests::create_connected_connections(None, None); + + send_generic_message(faber_to_alice, "Hello 1").unwrap(); + send_generic_message(faber_to_alice, "Hello 2").unwrap(); + send_generic_message(faber_to_alice, "Hello 3").unwrap(); + + thread::sleep(Duration::from_millis(1000)); + ::utils::devsetup::set_consumer(None); + + let received = download_messages_noauth(None, Some(vec![MessageStatusCode::Received.to_string()]), None).unwrap(); + assert_eq!(received.len(), 1); + assert_eq!(received[0].msgs.len(), 3); + let pairwise_did = received[0].pairwise_did.clone(); + let uid = received[0].msgs[0].uid.clone(); + + let reviewed = download_messages_noauth(Some(vec![pairwise_did.clone()]), Some(vec![MessageStatusCode::Reviewed.to_string()]), None).unwrap(); + let reviewed_count_before = reviewed[0].msgs.len(); + + // update status + let message = serde_json::to_string(&vec![UIDsByConn { pairwise_did: pairwise_did.clone(), uids: vec![uid.clone()] }]).unwrap(); + update_agency_messages("MS-106", &message).unwrap(); + + let received = download_messages_noauth(None, Some(vec![MessageStatusCode::Received.to_string()]), None).unwrap(); + assert_eq!(received.len(), 1); + assert_eq!(received[0].msgs.len(), 2); + + let reviewed = download_messages_noauth(Some(vec![pairwise_did.clone()]), Some(vec![MessageStatusCode::Reviewed.to_string()]), None).unwrap(); + let reviewed_count_after = reviewed[0].msgs.len(); + assert_eq!(reviewed_count_after, reviewed_count_before + 1); + + let specific_review = download_messages_noauth(Some(vec![pairwise_did.clone()]), Some(vec![MessageStatusCode::Reviewed.to_string()]), Some(vec![uid.clone()])).unwrap(); + assert_eq!(specific_review[0].msgs[0].uid, uid); + } } diff --git a/libvcx/src/credential.rs b/libvcx/src/credential.rs index 5ea507bdbf..1f48bdc44f 100644 --- a/libvcx/src/credential.rs +++ b/libvcx/src/credential.rs @@ -1,6 +1,6 @@ use serde_json; -use agency_comm::mocking::AgencyMockDecrypted; +use agency_client::mocking::AgencyMockDecrypted; use aries::{ handlers::issuance::holder::holder::Holder, messages::a2a::A2AMessage, diff --git a/libvcx/src/credential_def.rs b/libvcx/src/credential_def.rs index b5a15f8315..d5504679d2 100644 --- a/libvcx/src/credential_def.rs +++ b/libvcx/src/credential_def.rs @@ -1,6 +1,6 @@ use serde_json; -use agency_comm::ObjectWithVersion; +use agency_client::ObjectWithVersion; use api::PublicEntityStateType; use error::prelude::*; use libindy::utils::anoncreds; @@ -83,13 +83,15 @@ impl CredentialDef { pub fn from_str(data: &str) -> VcxResult { ObjectWithVersion::deserialize(data) .map(|obj: ObjectWithVersion| obj.data) - .map_err(|err| err.map(VcxErrorKind::CreateCredDef, "Cannot deserialize CredentialDefinition")) + .map_err(|err| err.into()) + .map_err(|err: VcxError| err.map(VcxErrorKind::CreateCredDef, "Cannot deserialize CredentialDefinition")) } pub fn to_string(&self) -> VcxResult { ObjectWithVersion::new(DEFAULT_SERIALIZE_VERSION, self.to_owned()) .serialize() - .map_err(|err| err.extend("Cannot serialize CredentialDefinition")) + .map_err(|err| err.into()) + .map_err(|err: VcxError| err.extend("Cannot serialize CredentialDefinition")) } pub fn get_source_id(&self) -> &String { &self.source_id } diff --git a/libvcx/src/disclosed_proof.rs b/libvcx/src/disclosed_proof.rs index b356e8f8db..aafc2a7c4f 100644 --- a/libvcx/src/disclosed_proof.rs +++ b/libvcx/src/disclosed_proof.rs @@ -1,11 +1,6 @@ -use std::convert::TryInto; - use serde_json; -use agency_comm::{ - get_message::Message, -}; -use agency_comm::mocking::AgencyMockDecrypted; +use agency_client::mocking::AgencyMockDecrypted; use aries::{ handlers::proof_presentation::prover::prover::Prover, messages::proof_presentation::presentation_request::PresentationRequest, diff --git a/libvcx/src/error/mod.rs b/libvcx/src/error/mod.rs index 709ddb77d8..f2a11cf149 100644 --- a/libvcx/src/error/mod.rs +++ b/libvcx/src/error/mod.rs @@ -8,6 +8,7 @@ use libc::c_char; use utils::cstring::CStringUtils; use utils::error; +use agency_client; pub mod prelude { pub use super::{err_msg, get_current_error_c_json, VcxError, VcxErrorExt, VcxErrorKind, VcxResult, VcxResultExt}; @@ -284,6 +285,13 @@ impl From for VcxError { } } +impl From for VcxError { + fn from(agency_err: agency_client::utils::error::AgencyClientError) -> VcxError { + let kind_num: u32 = agency_err.kind().into(); + VcxError::from_msg(kind_num.into(), ::utils::error::error_message(&agency_err.kind().clone().into())) + } +} + impl From> for VcxError { fn from(inner: Context) -> VcxError { VcxError { inner } @@ -391,6 +399,99 @@ impl From for u32 { } } +impl From for VcxErrorKind { + fn from(code: u32) -> VcxErrorKind { + match code { + _ if { error::INVALID_STATE.code_num == code } => VcxErrorKind::InvalidState, + _ if { error::INVALID_CONFIGURATION.code_num == code } => VcxErrorKind::InvalidConfiguration, + _ if { error::INVALID_OBJ_HANDLE.code_num == code } => VcxErrorKind::InvalidHandle, + _ if { error::INVALID_JSON.code_num == code } => VcxErrorKind::InvalidJson, + _ if { error::INVALID_OPTION.code_num == code } => VcxErrorKind::InvalidOption, + _ if { error::INVALID_MSGPACK.code_num == code } => VcxErrorKind::InvalidMessagePack, + _ if { error::OBJECT_CACHE_ERROR.code_num == code } => VcxErrorKind::ObjectCacheError, + _ if { error::NO_PAYMENT_INFORMATION.code_num == code } => VcxErrorKind::NoPaymentInformation, + _ if { error::NOT_READY.code_num == code } => VcxErrorKind::NotReady, + _ if { error::INVALID_REVOCATION_DETAILS.code_num == code } => VcxErrorKind::InvalidRevocationDetails, + _ if { error::CONNECTION_ERROR.code_num == code } => VcxErrorKind::GeneralConnectionError, + _ if { error::IOERROR.code_num == code } => VcxErrorKind::IOError, + _ if { error::LIBINDY_INVALID_STRUCTURE.code_num == code } => VcxErrorKind::LibindyInvalidStructure, + _ if { error::TIMEOUT_LIBINDY_ERROR.code_num == code } => VcxErrorKind::TimeoutLibindy, + _ if { error::INVALID_LIBINDY_PARAM.code_num == code } => VcxErrorKind::InvalidLibindyParam, + _ if { error::ALREADY_INITIALIZED.code_num == code } => VcxErrorKind::AlreadyInitialized, + _ if { error::CREATE_CONNECTION_ERROR.code_num == code } => VcxErrorKind::CreateConnection, + _ if { error::INVALID_CONNECTION_HANDLE.code_num == code } => VcxErrorKind::InvalidConnectionHandle, + _ if { error::INVALID_INVITE_DETAILS.code_num == code } => VcxErrorKind::InvalidInviteDetail, + _ if { error::INVALID_REDIRECT_DETAILS.code_num == code } => VcxErrorKind::InvalidRedirectDetail, + _ if { error::CANNOT_DELETE_CONNECTION.code_num == code } => VcxErrorKind::DeleteConnection, + _ if { error::CREATE_CREDENTIAL_DEF_ERR.code_num == code } => VcxErrorKind::CreateCredDef, + _ if { error::CREDENTIAL_DEF_ALREADY_CREATED.code_num == code } => VcxErrorKind::CredDefAlreadyCreated, + _ if { error::INVALID_CREDENTIAL_DEF_HANDLE.code_num == code } => VcxErrorKind::InvalidCredDefHandle, + _ if { error::INVALID_REV_ENTRY.code_num == code } => VcxErrorKind::InvalidRevocationEntry, + _ if { error::INVALID_REV_REG_DEF_CREATION.code_num == code } => VcxErrorKind::CreateRevRegDef, + _ if { error::INVALID_CREDENTIAL_HANDLE.code_num == code } => VcxErrorKind::InvalidCredentialHandle, + _ if { error::CREATE_CREDENTIAL_REQUEST_ERROR.code_num == code } => VcxErrorKind::CreateCredentialRequest, + _ if { error::INVALID_ISSUER_CREDENTIAL_HANDLE.code_num == code } => VcxErrorKind::InvalidIssuerCredentialHandle, + _ if { error::INVALID_CREDENTIAL_REQUEST.code_num == code } => VcxErrorKind::InvalidCredentialRequest, + _ if { error::INVALID_CREDENTIAL_JSON.code_num == code } => VcxErrorKind::InvalidCredential, + _ if { error::INSUFFICIENT_TOKEN_AMOUNT.code_num == code } => VcxErrorKind::InsufficientTokenAmount, + _ if { error::INVALID_PROOF_HANDLE.code_num == code } => VcxErrorKind::InvalidProofHandle, + _ if { error::INVALID_DISCLOSED_PROOF_HANDLE.code_num == code } => VcxErrorKind::InvalidDisclosedProofHandle, + _ if { error::INVALID_PROOF.code_num == code } => VcxErrorKind::InvalidProof, + _ if { error::INVALID_SCHEMA.code_num == code } => VcxErrorKind::InvalidSchema, + _ if { error::INVALID_PROOF_CREDENTIAL_DATA.code_num == code } => VcxErrorKind::InvalidProofCredentialData, + _ if { error::CREATE_PROOF_ERROR.code_num == code } => VcxErrorKind::CreateProof, + _ if { error::INVALID_REVOCATION_TIMESTAMP.code_num == code } => VcxErrorKind::InvalidRevocationTimestamp, + _ if { error::INVALID_SCHEMA_CREATION.code_num == code } => VcxErrorKind::CreateSchema, + _ if { error::INVALID_SCHEMA_HANDLE.code_num == code } => VcxErrorKind::InvalidSchemaHandle, + _ if { error::INVALID_SCHEMA_SEQ_NO.code_num == code } => VcxErrorKind::InvalidSchemaSeqNo, + _ if { error::DUPLICATE_SCHEMA.code_num == code } => VcxErrorKind::DuplicationSchema, + _ if { error::UNKNOWN_SCHEMA_REJECTION.code_num == code } => VcxErrorKind::UnknownSchemaRejection, + _ if { error::INVALID_WALLET_CREATION.code_num == code } => VcxErrorKind::WalletCreate, + _ if { error::MISSING_WALLET_NAME.code_num == code } => VcxErrorKind::MissingWalletName, + _ if { error::WALLET_ACCESS_FAILED.code_num == code } => VcxErrorKind::WalletAccessFailed, + _ if { error::INVALID_WALLET_HANDLE.code_num == code } => VcxErrorKind::InvalidWalletHandle, + _ if { error::WALLET_ALREADY_EXISTS.code_num == code } => VcxErrorKind::DuplicationWallet, + _ if { error::WALLET_NOT_FOUND.code_num == code } => VcxErrorKind::WalletNotFound, + _ if { error::WALLET_RECORD_NOT_FOUND.code_num == code } => VcxErrorKind::WalletRecordNotFound, + _ if { error::POOL_LEDGER_CONNECT.code_num == code } => VcxErrorKind::PoolLedgerConnect, + _ if { error::INVALID_GENESIS_TXN_PATH.code_num == code } => VcxErrorKind::InvalidGenesisTxnPath, + _ if { error::CREATE_POOL_CONFIG.code_num == code } => VcxErrorKind::CreatePoolConfig, + _ if { error::DUPLICATE_WALLET_RECORD.code_num == code } => VcxErrorKind::DuplicationWalletRecord, + _ if { error::WALLET_ALREADY_OPEN.code_num == code } => VcxErrorKind::WalletAlreadyOpen, + _ if { error::DUPLICATE_MASTER_SECRET.code_num == code } => VcxErrorKind::DuplicationMasterSecret, + _ if { error::DID_ALREADY_EXISTS_IN_WALLET.code_num == code } => VcxErrorKind::DuplicationDid, + _ if { error::INVALID_LEDGER_RESPONSE.code_num == code } => VcxErrorKind::InvalidLedgerResponse, + _ if { error::INVALID_ATTRIBUTES_STRUCTURE.code_num == code } => VcxErrorKind::InvalidAttributesStructure, + _ if { error::INVALID_PAYMENT_ADDRESS.code_num == code } => VcxErrorKind::InvalidPaymentAddress, + _ if { error::NO_ENDPOINT.code_num == code } => VcxErrorKind::NoEndpoint, + _ if { error::INVALID_PROOF_REQUEST.code_num == code } => VcxErrorKind::InvalidProofRequest, + _ if { error::NO_POOL_OPEN.code_num == code } => VcxErrorKind::NoPoolOpen, + _ if { error::POST_MSG_FAILURE.code_num == code } => VcxErrorKind::PostMessageFailed, + _ if { error::LOGGING_ERROR.code_num == code } => VcxErrorKind::LoggingError, + _ if { error::BIG_NUMBER_ERROR.code_num == code } => VcxErrorKind::EncodeError, + _ if { error::UNKNOWN_ERROR.code_num == code } => VcxErrorKind::UnknownError, + _ if { error::INVALID_DID.code_num == code } => VcxErrorKind::InvalidDid, + _ if { error::INVALID_VERKEY.code_num == code } => VcxErrorKind::InvalidVerkey, + _ if { error::INVALID_NONCE.code_num == code } => VcxErrorKind::InvalidNonce, + _ if { error::INVALID_URL.code_num == code } => VcxErrorKind::InvalidUrl, + _ if { error::MISSING_WALLET_KEY.code_num == code } => VcxErrorKind::MissingWalletKey, + _ if { error::MISSING_PAYMENT_METHOD.code_num == code } => VcxErrorKind::MissingPaymentMethod, + _ if { error::SERIALIZATION_ERROR.code_num == code } => VcxErrorKind::SerializationError, + _ if { error::NOT_BASE58.code_num == code } => VcxErrorKind::NotBase58, + _ if { error::INVALID_HTTP_RESPONSE.code_num == code } => VcxErrorKind::InvalidHttpResponse, + _ if { error::INVALID_MESSAGES.code_num == code } => VcxErrorKind::InvalidMessages, + _ if { error::MISSING_EXPORTED_WALLET_PATH.code_num == code } => VcxErrorKind::MissingExportedWalletPath, + _ if { error::MISSING_BACKUP_KEY.code_num == code } => VcxErrorKind::MissingBackupKey, + _ if { error::UNKNOWN_LIBINDY_ERROR.code_num == code } => VcxErrorKind::UnknownLibndyError, + _ if { error::ACTION_NOT_SUPPORTED.code_num == code } => VcxErrorKind::ActionNotSupported, + _ if { error::NO_AGENT_INFO.code_num == code } => VcxErrorKind::NoAgentInformation, + _ if { error::REV_REG_DEF_NOT_FOUND.code_num == code } => VcxErrorKind::RevRegDefNotFound, + _ if { error::REV_DELTA_NOT_FOUND.code_num == code } => VcxErrorKind::RevDeltaNotFound, + _ => VcxErrorKind::UnknownError, + } + } +} + pub type VcxResult = Result; /// Extension methods for `Result`. diff --git a/libvcx/src/filters.rs b/libvcx/src/filters.rs index d540975905..205cf50792 100644 --- a/libvcx/src/filters.rs +++ b/libvcx/src/filters.rs @@ -66,7 +66,6 @@ pub mod tests { use super::*; use utils::constants::*; use utils::devsetup::*; - use utils::httpclient::HttpClientMockResponse; use utils::mockdata::mockdata_proof; #[test] diff --git a/libvcx/src/init.rs b/libvcx/src/init.rs index 80297cea77..3e69e1e74a 100644 --- a/libvcx/src/init.rs +++ b/libvcx/src/init.rs @@ -61,4 +61,4 @@ pub fn open_as_main_wallet(wallet_name: &str, wallet_key: &str, key_derivation: set_wallet_handle(handle); Ok(handle) -} \ No newline at end of file +} diff --git a/libvcx/src/issuer_credential.rs b/libvcx/src/issuer_credential.rs index 3db1d7edfc..4b5e472653 100644 --- a/libvcx/src/issuer_credential.rs +++ b/libvcx/src/issuer_credential.rs @@ -179,7 +179,7 @@ pub mod tests { use utils::constants::{SCHEMAS_JSON, V3_OBJECT_SERIALIZE_VERSION, REV_REG_ID}; #[allow(unused_imports)] use utils::devsetup::*; - use utils::httpclient::HttpClientMockResponse; + use agency_client::mocking::HttpClientMockResponse; use utils::mockdata::mockdata_connection::ARIES_CONNECTION_ACK; use utils::mockdata::mockdata_credex::ARIES_CREDENTIAL_REQUEST; @@ -296,7 +296,7 @@ pub mod tests { assert_eq!(get_rev_reg_id(handle_cred).unwrap(), REV_REG_ID); // First attempt to send credential fails - HttpClientMockResponse::set_next_response(VcxResult::Err(VcxError::from_msg(VcxErrorKind::IOError, "Sending message timeout."))); + HttpClientMockResponse::set_next_response(::agency_client::utils::error::AgencyClientResult::Err(::agency_client::utils::error::AgencyClientError::from_msg(::agency_client::utils::error::AgencyClientErrorKind::IOError, "Sending message timeout."))); let send_result = issuer_credential::send_credential(handle_cred, handle_conn); assert_eq!(send_result.is_err(), true); assert_eq!(get_state(handle_cred).unwrap(), VcxStateType::VcxStateRequestReceived as u32); diff --git a/libvcx/src/lib.rs b/libvcx/src/lib.rs index c69f005308..2af04e90ae 100644 --- a/libvcx/src/lib.rs +++ b/libvcx/src/lib.rs @@ -29,12 +29,12 @@ extern crate strum_macros; extern crate time; extern crate url; extern crate uuid; +extern crate agency_client; #[macro_use] pub mod utils; pub mod settings; #[macro_use] -pub mod agency_comm; pub mod api; pub mod init; diff --git a/libvcx/src/libindy/proofs/verifier/verifier_internal.rs b/libvcx/src/libindy/proofs/verifier/verifier_internal.rs index 6b1f2878db..da0203484a 100644 --- a/libvcx/src/libindy/proofs/verifier/verifier_internal.rs +++ b/libvcx/src/libindy/proofs/verifier/verifier_internal.rs @@ -171,7 +171,7 @@ pub mod tests { use connection::tests::build_test_connection_inviter_requested; use utils::constants::*; use utils::devsetup::*; - use utils::httpclient::HttpClientMockResponse; + use agency_client::mocking::HttpClientMockResponse; use utils::mockdata::mockdata_proof; use super::*; diff --git a/libvcx/src/libindy/utils/signus.rs b/libvcx/src/libindy/utils/signus.rs index f88d3a6f14..18ccb48e7c 100644 --- a/libvcx/src/libindy/utils/signus.rs +++ b/libvcx/src/libindy/utils/signus.rs @@ -16,13 +16,3 @@ pub fn create_and_store_my_did(seed: Option<&str>, method_name: Option<&str>) -> .wait() .map_err(VcxError::from) } - -pub fn get_local_verkey(did: &str) -> VcxResult { - if settings::indy_mocks_enabled() { - return Ok(::utils::constants::VERKEY.to_string()); - } - - did::key_for_local_did(get_wallet_handle(), did) - .wait() - .map_err(VcxError::from) -} diff --git a/libvcx/src/libindy/utils/wallet.rs b/libvcx/src/libindy/utils/wallet.rs index 594d8fb6fc..d0d97101c4 100644 --- a/libvcx/src/libindy/utils/wallet.rs +++ b/libvcx/src/libindy/utils/wallet.rs @@ -1,6 +1,7 @@ use futures::Future; use indy::{ErrorCode, wallet}; use indy::{INVALID_WALLET_HANDLE, SearchHandle, WalletHandle}; +use agency_client::utils::wallet as agency_wallet; use error::prelude::*; use init::open_as_main_wallet; @@ -53,12 +54,16 @@ pub static mut WALLET_HANDLE: WalletHandle = INVALID_WALLET_HANDLE; pub fn set_wallet_handle(handle: WalletHandle) -> WalletHandle { unsafe { WALLET_HANDLE = handle; } + agency_wallet::set_wallet_handle(handle); unsafe { WALLET_HANDLE } } pub fn get_wallet_handle() -> WalletHandle { unsafe { WALLET_HANDLE } } -pub fn reset_wallet_handle() { set_wallet_handle(INVALID_WALLET_HANDLE); } +pub fn reset_wallet_handle() { + set_wallet_handle(INVALID_WALLET_HANDLE); + agency_wallet::reset_wallet_handle(); +} pub fn build_wallet_config(wallet_name: &str, wallet_type: Option<&str>, storage_config: Option<&str>) -> String { let mut config = json!({ @@ -303,7 +308,7 @@ pub mod tests { use utils::get_temp_dir_path; use super::*; - use agency_comm::agency_settings; + use agency_client::agency_settings; fn _record() -> (&'static str, &'static str, &'static str) { ("type1", "id1", "value1") diff --git a/libvcx/src/proof.rs b/libvcx/src/proof.rs index 3be240b283..13e85eac71 100644 --- a/libvcx/src/proof.rs +++ b/libvcx/src/proof.rs @@ -126,7 +126,7 @@ pub mod tests { use settings; use utils::constants::*; use utils::devsetup::*; - use utils::httpclient::HttpClientMockResponse; + use agency_client::mocking::HttpClientMockResponse; use utils::mockdata::mock_settings::MockBuilder; use utils::mockdata::mockdata_proof; @@ -356,7 +356,7 @@ pub mod tests { let _request = generate_proof_request_msg(handle_proof).unwrap(); assert_eq!(get_state(handle_proof).unwrap(), VcxStateType::VcxStateInitialized as u32); - HttpClientMockResponse::set_next_response(VcxResult::Err(VcxError::from_msg(VcxErrorKind::IOError, "Sending message timeout."))); + HttpClientMockResponse::set_next_response(::agency_client::utils::error::AgencyClientResult::Err(::agency_client::utils::error::AgencyClientError::from_msg(::agency_client::utils::error::AgencyClientErrorKind::IOError, "Sending message timeout."))); assert_eq!(send_proof_request(handle_proof, handle_conn).unwrap_err().kind(), VcxErrorKind::IOError); assert_eq!(get_state(handle_proof).unwrap(), VcxStateType::VcxStateInitialized as u32); diff --git a/libvcx/src/schema.rs b/libvcx/src/schema.rs index 29aa89ce02..445997c742 100644 --- a/libvcx/src/schema.rs +++ b/libvcx/src/schema.rs @@ -2,7 +2,7 @@ use std::string::ToString; use serde_json; -use agency_comm::ObjectWithVersion; +use agency_client::ObjectWithVersion; use api::PublicEntityStateType; use error::prelude::*; use libindy::utils::anoncreds; @@ -49,13 +49,15 @@ impl CreateSchema { fn to_string(&self) -> VcxResult { ObjectWithVersion::new(DEFAULT_SERIALIZE_VERSION, self.to_owned()) .serialize() - .map_err(|err| err.extend("Cannot serialize Schema")) + .map_err(|err| err.into()) + .map_err(|err: VcxError| err.extend("Cannot serialize Schema")) } fn from_str(data: &str) -> VcxResult { ObjectWithVersion::deserialize(data) .map(|obj: ObjectWithVersion| obj.data) - .map_err(|err| err.extend("Cannot deserialize Schema")) + .map_err(|err| err.into()) + .map_err(|err: VcxError| err.extend("Cannot deserialize Schema")) } fn update_state(&mut self) -> VcxResult { diff --git a/libvcx/src/settings.rs b/libvcx/src/settings.rs index ec029551ff..0a05cf9c8f 100644 --- a/libvcx/src/settings.rs +++ b/libvcx/src/settings.rs @@ -11,7 +11,7 @@ use serde_json::Value; use strum::IntoEnumIterator; use url::Url; -use agency_comm::agency_settings; +use agency_client::agency_settings; use error::prelude::*; use utils::{error, get_temp_dir_path}; use utils::file::read_file; @@ -331,7 +331,7 @@ pub fn clear_config() { #[cfg(test)] pub mod tests { - use agency_comm::agency_settings; + use agency_client::agency_settings; use utils::devsetup::{SetupDefaults, TempFile}; use super::*; diff --git a/libvcx/src/utils/constants.rs b/libvcx/src/utils/constants.rs index 486456fd13..db4c61f1c9 100644 --- a/libvcx/src/utils/constants.rs +++ b/libvcx/src/utils/constants.rs @@ -30,17 +30,11 @@ pub static ARIES_PROVER_SELF_ATTESTED_ATTRS: &str = r#"{"attribute_3":"Smith"}"# pub static PROOF_REJECT_RESPONSE_STR: &str = r#"{"version":null,"to_did":null,"from_did":"2hoqvcwupRTUNkXn6ArYzs","proof_request_id":null,"libindy_proof":"","state":9}"#; pub static PROOF_REJECT_RESPONSE_STR_V2: &str = r#"{"@id":"6ccc927b-84a4-4766-8145-d40d112999df","@type":"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/report-problem/1.0/problem-report","comment":"Presentation Request was rejected","~thread":{"received_orders":{},"sender_order":0,"thid":"94028fc2-be95-4c35-9a66-6810b0e3d6da"}}"#; pub const REGISTER_RESPONSE: &'static [u8; 51] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 31, 208, 129, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 169, 83, 73, 71, 78, 69, 68, 95, 85, 80, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48]; -pub const REGISTER_RESPONSE_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/onboarding/1.0/SIGNED_UP"}"#; pub const UPDATE_COM_METHOD_RESPONSE_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/configs/1.0/COM_METHOD_UPDATED","id":"12345"}"#; pub const CONNECTED_RESPONSE: &'static [u8; 162] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 138, 204, 131, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 169, 67, 79, 78, 78, 69, 67, 84, 69, 68, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 175, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 204, 182, 65, 52, 97, 54, 57, 113, 97, 102, 113, 90, 72, 80, 76, 80, 80, 117, 53, 74, 70, 81, 114, 99, 204, 181, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 86, 101, 114, 75, 101, 121, 204, 217, 44, 53, 119, 84, 75, 88, 114, 100, 102, 85, 105, 84, 81, 55, 102, 51, 115, 90, 74, 122, 118, 72, 112, 99, 83, 55, 88, 72, 72, 120, 105, 66, 107, 70, 116, 80, 67, 115, 121, 110, 90, 116, 118, 52, 107]; -pub const CONNECTED_RESPONSE_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/onboarding/1.0/CONNECTED","withPairwiseDID":"XSasL1cESeSJ2v9wMYeXBf","withPairwiseDIDVerKey":"HbJb8uKp4mtjhnNknP66GgmUMYta6XArNaA4WJDEyyv9"}"#; pub const AGENT_CREATED: &'static [u8; 166] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 142, 208, 131, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 173, 65, 71, 69, 78, 84, 95, 67, 82, 69, 65, 84, 69, 68, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 175, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 208, 182, 65, 52, 97, 54, 57, 113, 97, 102, 113, 90, 72, 80, 76, 80, 80, 117, 53, 74, 70, 81, 114, 99, 208, 181, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 86, 101, 114, 75, 101, 121, 208, 217, 44, 53, 119, 84, 75, 88, 114, 100, 102, 85, 105, 84, 81, 55, 102, 51, 115, 90, 74, 122, 118, 72, 112, 99, 83, 55, 88, 72, 72, 120, 105, 66, 107, 70, 116, 80, 67, 115, 121, 110, 90, 116, 118, 52, 107]; -pub const AGENT_CREATED_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/onboarding/1.0/AGENT_CREATED","withPairwiseDID":"DnEpUQJLupa5rKPkrKUpFd","withPairwiseDIDVerKey":"7y118tRW2EMJn18qs9MY5NJWYW2PLwV5QpaLyfoLHtgF"}"#; -// The byte arrays come directly from the agency team's documentation -pub const CREATE_KEYS_V2_RESPONSE: &'static [u8; 343] = &[123, 34, 109, 101, 115, 115, 97, 103, 101, 34, 58, 34, 123, 92, 34, 64, 116, 121, 112, 101, 92, 34, 58, 92, 34, 100, 105, 100, 58, 115, 111, 118, 58, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102, 103, 104, 105, 49, 50, 51, 52, 59, 115, 112, 101, 99, 47, 99, 111, 110, 110, 101, 99, 116, 105, 110, 103, 47, 48, 46, 54, 47, 75, 69, 89, 95, 67, 82, 69, 65, 84, 69, 68, 92, 34, 44, 92, 34, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 92, 34, 58, 92, 34, 77, 78, 101, 112, 101, 83, 87, 116, 71, 102, 104, 110, 118, 56, 106, 76, 66, 49, 115, 70, 90, 67, 92, 34, 44, 92, 34, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 86, 101, 114, 75, 101, 121, 92, 34, 58, 92, 34, 67, 55, 51, 77, 82, 110, 110, 115, 52, 113, 85, 106, 82, 53, 78, 52, 76, 82, 119, 84, 121, 105, 88, 86, 80, 75, 80, 114, 65, 53, 113, 52, 76, 67, 84, 56, 80, 90, 122, 120, 86, 100, 116, 57, 92, 34, 125, 34, 44, 34, 114, 101, 99, 105, 112, 105, 101, 110, 116, 95, 118, 101, 114, 107, 101, 121, 34, 58, 34, 50, 112, 70, 109, 113, 97, 98, 119, 75, 82, 82, 109, 80, 54, 76, 117, 67, 99, 121, 65, 70, 101, 107, 56, 77, 109, 68, 75, 107, 107, 102, 100, 72, 111, 100, 116, 57, 103, 90, 49, 67, 88, 74, 52, 34, 44, 34, 115, 101, 110, 100, 101, 114, 95, 118, 101, 114, 107, 101, 121, 34, 58, 34, 65, 66, 117, 89, 121, 84, 87, 90, 120, 113, 53, 88, 98, 105, 54, 90, 69, 119, 119, 121, 49, 97, 51, 69, 88, 51, 90, 68, 56, 100, 105, 112, 115, 109, 102, 106, 81, 53, 75, 116, 71, 116, 115, 120, 34, 125]; pub const DELETE_CONNECTION_RESPONSE: &'static [u8; 81] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 59, 204, 130, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 179, 67, 79, 78, 78, 95, 83, 84, 65, 84, 85, 83, 95, 85, 80, 68, 65, 84, 69, 68, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 67, 83, 45, 49, 48, 51]; pub const DELETE_CONNECTION_DECRYPTED_RESPONSE: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/pairwise/1.0/CONN_STATUS_UPDATED","statusCode":"CS-103"}"#; -pub const UPDATE_PROFILE_RESPONSE: &'static [u8; 57] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 37, 208, 129, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 175, 67, 79, 78, 70, 73, 71, 83, 95, 85, 80, 68, 65, 84, 69, 68, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48]; pub const SEND_INVITE_RESPONSE: &'static [u8; 862] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 147, 220, 0, 45, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 171, 77, 83, 71, 95, 67, 82, 69, 65, 84, 69, 68, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 163, 117, 105, 100, 208, 167, 78, 106, 99, 119, 79, 87, 85, 220, 2, 181, 208, 131, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 170, 77, 83, 71, 95, 68, 69, 84, 65, 73, 76, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 172, 105, 110, 118, 105, 116, 101, 68, 101, 116, 97, 105, 108, 208, 134, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 166, 77, 83, 45, 49, 48, 49, 208, 169, 99, 111, 110, 110, 82, 101, 113, 73, 100, 208, 167, 78, 106, 99, 119, 79, 87, 85, 208, 172, 115, 101, 110, 100, 101, 114, 68, 101, 116, 97, 105, 108, 208, 133, 208, 164, 110, 97, 109, 101, 208, 168, 101, 110, 116, 45, 110, 97, 109, 101, 208, 176, 97, 103, 101, 110, 116, 75, 101, 121, 68, 108, 103, 80, 114, 111, 111, 102, 208, 131, 208, 168, 97, 103, 101, 110, 116, 68, 73, 68, 208, 182, 85, 53, 76, 88, 115, 52, 85, 55, 80, 57, 109, 115, 104, 54, 52, 55, 107, 84, 111, 101, 122, 121, 208, 177, 97, 103, 101, 110, 116, 68, 101, 108, 101, 103, 97, 116, 101, 100, 75, 101, 121, 208, 217, 44, 70, 107, 116, 83, 90, 103, 56, 105, 100, 65, 86, 122, 121, 81, 90, 114, 100, 85, 112, 112, 75, 54, 70, 84, 114, 102, 65, 122, 87, 51, 119, 87, 86, 122, 65, 106, 74, 65, 102, 100, 85, 118, 74, 113, 208, 169, 115, 105, 103, 110, 97, 116, 117, 114, 101, 208, 217, 88, 103, 107, 86, 68, 104, 119, 101, 50, 47, 70, 69, 116, 70, 113, 74, 89, 66, 109, 50, 119, 98, 69, 118, 113, 71, 108, 66, 119, 65, 71, 71, 97, 67, 49, 57, 79, 101, 98, 106, 47, 51, 90, 116, 90, 47, 75, 112, 90, 115, 55, 75, 50, 74, 70, 77, 103, 84, 113, 84, 98, 50, 57, 120, 84, 84, 65, 97, 100, 48, 52, 65, 106, 102, 78, 97, 55, 54, 57, 51, 49, 101, 82, 97, 54, 66, 65, 61, 61, 208, 163, 68, 73, 68, 208, 182, 87, 82, 85, 122, 88, 88, 117, 70, 86, 84, 89, 107, 84, 56, 67, 106, 83, 90, 112, 70, 118, 84, 208, 167, 108, 111, 103, 111, 85, 114, 108, 208, 172, 101, 110, 116, 45, 108, 111, 103, 111, 45, 117, 114, 108, 208, 166, 118, 101, 114, 75, 101, 121, 208, 217, 44, 69, 83, 69, 54, 77, 110, 113, 65, 121, 106, 82, 105, 103, 100, 117, 80, 71, 52, 53, 52, 118, 102, 76, 118, 75, 104, 77, 98, 109, 97, 90, 106, 121, 57, 118, 113, 120, 67, 110, 83, 75, 81, 110, 112, 208, 178, 115, 101, 110, 100, 101, 114, 65, 103, 101, 110, 99, 121, 68, 101, 116, 97, 105, 108, 208, 131, 208, 163, 68, 73, 68, 208, 182, 66, 68, 83, 109, 86, 107, 122, 120, 82, 89, 71, 69, 52, 72, 75, 121, 77, 75, 120, 100, 49, 72, 208, 166, 118, 101, 114, 75, 101, 121, 208, 217, 44, 72, 115, 97, 87, 68, 75, 110, 74, 116, 103, 111, 66, 115, 121, 113, 71, 50, 122, 75, 97, 53, 120, 82, 118, 75, 90, 122, 90, 72, 104, 107, 105, 67, 68, 72, 55, 101, 85, 51, 105, 113, 82, 115, 118, 208, 168, 101, 110, 100, 112, 111, 105, 110, 116, 208, 185, 108, 111, 99, 97, 108, 104, 111, 115, 116, 58, 57, 48, 48, 49, 47, 97, 103, 101, 110, 99, 121, 47, 109, 115, 103, 208, 170, 116, 97, 114, 103, 101, 116, 78, 97, 109, 101, 208, 165, 116, 104, 101, 114, 101, 208, 169, 115, 116, 97, 116, 117, 115, 77, 115, 103, 208, 175, 109, 101, 115, 115, 97, 103, 101, 32, 99, 114, 101, 97, 116, 101, 100, 208, 177, 117, 114, 108, 84, 111, 73, 110, 118, 105, 116, 101, 68, 101, 116, 97, 105, 108, 208, 217, 70, 104, 116, 116, 112, 58, 47, 47, 108, 111, 99, 97, 108, 104, 111, 115, 116, 58, 57, 48, 48, 49, 47, 97, 103, 101, 110, 99, 121, 47, 105, 110, 118, 105, 116, 101, 47, 87, 82, 85, 122, 88, 88, 117, 70, 86, 84, 89, 107, 84, 56, 67, 106, 83, 90, 112, 70, 118, 84, 63, 117, 105, 100, 61, 78, 106, 99, 119, 79, 87, 85, 220, 0, 42, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 168, 77, 83, 71, 95, 83, 69, 78, 84, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 163, 117, 105, 100, 208, 167, 78, 106, 99, 119, 79, 87, 85]; pub const SEND_INVITE_V2_RESPONSE: &'static [u8; 1059] = &[123, 34, 109, 101, 115, 115, 97, 103, 101, 34, 58, 34, 123, 92, 34, 64, 105, 100, 92, 34, 58, 92, 34, 66, 88, 55, 74, 89, 103, 72, 79, 109, 115, 92, 34, 44, 92, 34, 64, 116, 121, 112, 101, 92, 34, 58, 92, 34, 100, 105, 100, 58, 115, 111, 118, 58, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102, 103, 104, 105, 49, 50, 51, 52, 59, 115, 112, 101, 99, 47, 99, 111, 110, 110, 101, 99, 116, 105, 110, 103, 47, 48, 46, 54, 47, 67, 79, 78, 78, 95, 82, 69, 81, 85, 69, 83, 84, 95, 82, 69, 83, 80, 92, 34, 44, 92, 34, 105, 110, 118, 105, 116, 101, 68, 101, 116, 97, 105, 108, 92, 34, 58, 123, 92, 34, 99, 111, 110, 110, 82, 101, 113, 73, 100, 92, 34, 58, 92, 34, 66, 88, 55, 74, 89, 103, 72, 79, 109, 115, 92, 34, 44, 92, 34, 115, 101, 110, 100, 101, 114, 65, 103, 101, 110, 99, 121, 68, 101, 116, 97, 105, 108, 92, 34, 58, 123, 92, 34, 68, 73, 68, 92, 34, 58, 92, 34, 86, 115, 75, 86, 55, 103, 114, 82, 49, 66, 85, 69, 50, 57, 109, 71, 50, 70, 109, 50, 107, 88, 92, 34, 44, 92, 34, 101, 110, 100, 112, 111, 105, 110, 116, 92, 34, 58, 92, 34, 104, 116, 116, 112, 58, 47, 47, 108, 111, 99, 97, 108, 104, 111, 115, 116, 58, 56, 48, 56, 48, 92, 34, 44, 92, 34, 118, 101, 114, 75, 101, 121, 92, 34, 58, 92, 34, 72, 101, 122, 99, 101, 50, 85, 87, 77, 90, 51, 119, 85, 104, 86, 107, 104, 50, 76, 102, 75, 83, 115, 56, 110, 68, 122, 87, 119, 122, 115, 50, 87, 105, 110, 55, 69, 122, 78, 78, 51, 89, 97, 82, 92, 34, 125, 44, 92, 34, 115, 101, 110, 100, 101, 114, 68, 101, 116, 97, 105, 108, 92, 34, 58, 123, 92, 34, 68, 73, 68, 92, 34, 58, 92, 34, 85, 49, 53, 100, 75, 98, 90, 97, 51, 72, 76, 112, 87, 70, 116, 113, 99, 114, 69, 117, 75, 113, 92, 34, 44, 92, 34, 97, 103, 101, 110, 116, 75, 101, 121, 68, 108, 103, 80, 114, 111, 111, 102, 92, 34, 58, 123, 92, 34, 97, 103, 101, 110, 116, 68, 73, 68, 92, 34, 58, 92, 34, 77, 78, 101, 112, 101, 83, 87, 116, 71, 102, 104, 110, 118, 56, 106, 76, 66, 49, 115, 70, 90, 67, 92, 34, 44, 92, 34, 97, 103, 101, 110, 116, 68, 101, 108, 101, 103, 97, 116, 101, 100, 75, 101, 121, 92, 34, 58, 92, 34, 67, 55, 51, 77, 82, 110, 110, 115, 52, 113, 85, 106, 82, 53, 78, 52, 76, 82, 119, 84, 121, 105, 88, 86, 80, 75, 80, 114, 65, 53, 113, 52, 76, 67, 84, 56, 80, 90, 122, 120, 86, 100, 116, 57, 92, 34, 44, 92, 34, 115, 105, 103, 110, 97, 116, 117, 114, 101, 92, 34, 58, 92, 34, 108, 101, 101, 89, 114, 57, 106, 85, 74, 50, 69, 79, 65, 98, 105, 118, 83, 100, 55, 77, 66, 89, 73, 111, 77, 75, 113, 88, 82, 65, 113, 116, 77, 107, 85, 107, 78, 108, 106, 98, 107, 98, 83, 120, 99, 86, 55, 87, 50, 75, 99, 52, 112, 102, 51, 110, 104, 53, 66, 74, 49, 112, 97, 71, 114, 82, 56, 86, 84, 100, 43, 77, 49, 117, 49, 112, 50, 73, 89, 71, 116, 55, 87, 75, 66, 103, 61, 61, 92, 34, 125, 44, 92, 34, 108, 111, 103, 111, 85, 114, 108, 92, 34, 58, 110, 117, 108, 108, 44, 92, 34, 110, 97, 109, 101, 92, 34, 58, 110, 117, 108, 108, 44, 92, 34, 112, 117, 98, 108, 105, 99, 68, 73, 68, 92, 34, 58, 92, 34, 52, 76, 55, 105, 107, 111, 107, 100, 103, 57, 88, 74, 67, 82, 78, 117, 74, 56, 68, 109, 72, 53, 92, 34, 44, 92, 34, 118, 101, 114, 75, 101, 121, 92, 34, 58, 92, 34, 70, 105, 90, 115, 80, 54, 89, 84, 120, 83, 67, 83, 71, 77, 51, 89, 110, 69, 100, 103, 100, 80, 103, 69, 69, 101, 56, 101, 119, 52, 49, 66, 70, 117, 114, 122, 100, 104, 78, 68, 90, 98, 119, 100, 92, 34, 125, 44, 92, 34, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 92, 34, 58, 92, 34, 77, 83, 45, 49, 48, 49, 92, 34, 44, 92, 34, 115, 116, 97, 116, 117, 115, 77, 115, 103, 92, 34, 58, 92, 34, 109, 101, 115, 115, 97, 103, 101, 32, 99, 114, 101, 97, 116, 101, 100, 92, 34, 44, 92, 34, 116, 97, 114, 103, 101, 116, 78, 97, 109, 101, 92, 34, 58, 92, 34, 92, 34, 44, 92, 34, 116, 104, 114, 101, 97, 100, 73, 100, 92, 34, 58, 92, 34, 57, 97, 55, 101, 97, 98, 56, 102, 45, 99, 50, 49, 53, 45, 52, 102, 100, 53, 45, 56, 100, 50, 55, 45, 56, 57, 100, 51, 53, 98, 54, 98, 102, 102, 98, 100, 92, 34, 125, 44, 92, 34, 115, 101, 110, 116, 92, 34, 58, 116, 114, 117, 101, 44, 92, 34, 117, 114, 108, 84, 111, 73, 110, 118, 105, 116, 101, 68, 101, 116, 97, 105, 108, 92, 34, 58, 92, 34, 92, 34, 125, 34, 44, 34, 114, 101, 99, 105, 112, 105, 101, 110, 116, 95, 118, 101, 114, 107, 101, 121, 34, 58, 34, 50, 112, 70, 109, 113, 97, 98, 119, 75, 82, 82, 109, 80, 54, 76, 117, 67, 99, 121, 65, 70, 101, 107, 56, 77, 109, 68, 75, 107, 107, 102, 100, 72, 111, 100, 116, 57, 103, 90, 49, 67, 88, 74, 52, 34, 44, 34, 115, 101, 110, 100, 101, 114, 95, 118, 101, 114, 107, 101, 121, 34, 58, 34, 67, 55, 51, 77, 82, 110, 110, 115, 52, 113, 85, 106, 82, 53, 78, 52, 76, 82, 119, 84, 121, 105, 88, 86, 80, 75, 80, 114, 65, 53, 113, 52, 76, 67, 84, 56, 80, 90, 122, 120, 86, 100, 116, 57, 34, 125]; pub const SEND_MESSAGE_RESPONSE: &'static [u8; 124] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 146, 220, 0, 45, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 171, 77, 83, 71, 95, 67, 82, 69, 65, 84, 69, 68, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 163, 117, 105, 100, 208, 167, 110, 116, 99, 50, 121, 116, 98, 220, 0, 44, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 168, 77, 83, 71, 95, 83, 69, 78, 84, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 164, 117, 105, 100, 115, 208, 145, 208, 167, 110, 116, 99, 50, 121, 116, 98]; @@ -52,7 +46,6 @@ pub const ACCEPT_INVITE_V2_RESPONSE: &'static [u8; 271] = &[123, 34, 109, 101, 1 pub const GET_MESSAGES_RESPONSE: &'static [u8; 1097] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 3, 173, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 164, 77, 83, 71, 83, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 164, 109, 115, 103, 115, 208, 147, 208, 133, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 166, 77, 83, 45, 49, 48, 50, 208, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 208, 182, 69, 90, 99, 113, 66, 56, 113, 102, 87, 49, 113, 85, 116, 54, 86, 106, 105, 72, 121, 117, 88, 76, 208, 163, 117, 105, 100, 208, 167, 109, 119, 110, 104, 111, 103, 109, 208, 164, 116, 121, 112, 101, 208, 167, 99, 111, 110, 110, 82, 101, 113, 208, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 208, 145, 208, 131, 208, 162, 116, 111, 208, 170, 52, 48, 52, 53, 57, 52, 51, 54, 57, 54, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 167, 77, 68, 83, 45, 49, 48, 50, 208, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 208, 189, 50, 48, 49, 55, 45, 49, 50, 45, 50, 48, 84, 49, 51, 58, 51, 57, 58, 51, 49, 46, 55, 51, 56, 90, 91, 85, 84, 67, 93, 208, 134, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 166, 77, 83, 45, 49, 48, 52, 208, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 208, 182, 69, 90, 99, 113, 66, 56, 113, 102, 87, 49, 113, 85, 116, 54, 86, 106, 105, 72, 121, 117, 88, 76, 208, 163, 117, 105, 100, 208, 167, 122, 119, 121, 51, 109, 100, 97, 208, 164, 116, 121, 112, 101, 208, 167, 99, 111, 110, 110, 82, 101, 113, 208, 168, 114, 101, 102, 77, 115, 103, 73, 100, 208, 167, 121, 122, 106, 106, 121, 119, 117, 208, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 208, 145, 208, 131, 208, 162, 116, 111, 208, 170, 52, 48, 52, 53, 57, 52, 51, 54, 57, 54, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 167, 77, 68, 83, 45, 49, 48, 50, 208, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 208, 189, 50, 48, 49, 55, 45, 49, 50, 45, 50, 48, 84, 49, 51, 58, 51, 57, 58, 51, 50, 46, 48, 57, 56, 90, 91, 85, 84, 67, 93, 208, 134, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 166, 77, 83, 45, 49, 48, 52, 208, 167, 112, 97, 121, 108, 111, 97, 100, 208, 220, 1, 208, 128, 208, 208, 208, 130, 208, 208, 208, 165, 64, 116, 121, 112, 101, 208, 208, 208, 131, 208, 208, 208, 164, 110, 97, 109, 101, 208, 208, 208, 173, 99, 111, 110, 110, 82, 101, 113, 65, 110, 115, 119, 101, 114, 208, 208, 208, 163, 118, 101, 114, 208, 208, 208, 163, 49, 46, 48, 208, 208, 208, 163, 102, 109, 116, 208, 208, 208, 172, 105, 110, 100, 121, 46, 109, 115, 103, 112, 97, 99, 107, 208, 208, 208, 164, 64, 109, 115, 103, 208, 208, 208, 220, 1, 53, 208, 208, 208, 208, 208, 208, 208, 129, 208, 208, 208, 208, 208, 208, 208, 172, 115, 101, 110, 100, 101, 114, 68, 101, 116, 97, 105, 108, 208, 208, 208, 208, 208, 208, 208, 131, 208, 208, 208, 208, 208, 208, 208, 163, 68, 73, 68, 208, 208, 208, 208, 208, 208, 208, 182, 67, 113, 85, 88, 113, 53, 114, 76, 105, 117, 82, 111, 100, 55, 68, 67, 52, 97, 86, 84, 97, 115, 208, 208, 208, 208, 208, 208, 208, 166, 118, 101, 114, 75, 101, 121, 208, 208, 208, 208, 208, 208, 208, 217, 44, 67, 70, 86, 87, 122, 118, 97, 103, 113, 65, 99, 117, 50, 115, 114, 68, 106, 117, 106, 85, 113, 74, 102, 111, 72, 65, 80, 74, 66, 111, 65, 99, 70, 78, 117, 49, 55, 113, 117, 67, 66, 57, 118, 71, 208, 208, 208, 208, 208, 208, 208, 176, 97, 103, 101, 110, 116, 75, 101, 121, 68, 108, 103, 80, 114, 111, 111, 102, 208, 208, 208, 208, 208, 208, 208, 131, 208, 208, 208, 208, 208, 208, 208, 168, 97, 103, 101, 110, 116, 68, 73, 68, 208, 208, 208, 208, 208, 208, 208, 182, 57, 54, 106, 111, 119, 113, 111, 84, 68, 68, 104, 87, 102, 81, 100, 105, 72, 49, 117, 83, 109, 77, 208, 208, 208, 208, 208, 208, 208, 177, 97, 103, 101, 110, 116, 68, 101, 108, 101, 103, 97, 116, 101, 100, 75, 101, 121, 208, 208, 208, 208, 208, 208, 208, 217, 44, 66, 105, 118, 78, 52, 116, 114, 53, 78, 88, 107, 69, 103, 119, 66, 56, 81, 115, 66, 51, 109, 109, 109, 122, 118, 53, 102, 119, 122, 54, 85, 121, 53, 121, 112, 122, 90, 77, 102, 115, 74, 56, 68, 122, 208, 208, 208, 208, 208, 208, 208, 169, 115, 105, 103, 110, 97, 116, 117, 114, 101, 208, 208, 208, 208, 208, 208, 208, 217, 88, 77, 100, 115, 99, 66, 85, 47, 99, 89, 75, 72, 49, 113, 69, 82, 66, 56, 80, 74, 65, 43, 48, 51, 112, 121, 65, 80, 65, 102, 84, 113, 73, 80, 74, 102, 52, 84, 120, 102, 83, 98, 115, 110, 81, 86, 66, 68, 84, 115, 67, 100, 119, 122, 75, 114, 52, 54, 120, 87, 116, 80, 43, 78, 65, 68, 73, 57, 88, 68, 71, 55, 50, 50, 103, 113, 86, 80, 77, 104, 117, 76, 90, 103, 89, 67, 103, 61, 61, 208, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 208, 182, 72, 52, 70, 66, 107, 85, 105, 100, 82, 71, 56, 87, 76, 115, 87, 97, 55, 77, 54, 80, 51, 56, 208, 163, 117, 105, 100, 208, 167, 121, 122, 106, 106, 121, 119, 117, 208, 164, 116, 121, 112, 101, 208, 173, 99, 111, 110, 110, 82, 101, 113, 65, 110, 115, 119, 101, 114, 208, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 208, 144]; pub const GET_MESSAGES_DECRYPTED_RESPONSE: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/pairwise/1.0/MSGS","msgs":[{"payload":{"ciphertext":"oThWoHkEUkOvRk9ry3jjtK19DuG6e5VaXYtSrawHJJQCnfcFNwif5t6BoURbewOxQYfR7QOeJUTvEmVlVl1l2GPkNPXJDKuaqlRAMdotQVvogKAPoQY0rxloosETIkpZUc2dDeLpWO0IaSmv5Q8eeEA18CkJBfe-PsSkJna8mUVVw7w1rmSh30Dyiz2686pKBhbKcZCPHn1t6qPgQeSGPLqsXD5eJ--JAVfdQQixF5atMvkObV5ET--FnL9pUiycPC9fIXsyl_jzkJ2mhpe8SiJlEqZqBJ1DyxTWW3BRvNrP-hFx_a66-NrAEBIxctpVzRR29MI46Ipn3yJAn9zCJUOxXPL3eKB436fePuQZFDusxscYJHjtjgP7ItWylBkiCob2uleZkqprmlEnWKn_40mogkLW25LG1pkdxfMvBljRdDVvvfrHVT8AsggUJvgKmZloz4AgjQfuty_T-U83oDSR3tlHYUR6J_XTEz0w_XW_wiSwLe8rIRRvA49Ja-A6ujUtgRVIot53kh19tNiqonosH1AyS6k5ZdlPpQNnZ391B_kV4zfBdn_5vepcXjoDT9m_i67q-xK42OpKwFXT8pNnxREoOhzTa6scPxvcKdq3iDRvUIbTrt7O0-22jbmsEJ1mOQ64pitfgNKQ0jkUpFoBiDuvmlA0RtDk8azkQpBNtgx1naykrHTIfGWxD4acYUaaN9mhUIWvkzaGOE0tPT-6v_oD-mGy4eU-qaP3DNxTJRn_FMWiGmwmsWee_GUL-8qTtLAeby_J9MHJli7Wt80M0MOElCkNkW6pQuMMC9IPYadvjZeMH8NFmOh5cGRZlBGWTzlFXGFwowvBr9DrjQ2sgZB4xGkG2owdi-VB676CboGO-GdPkvXnNeubZwOVtEW1W3u5_3nHnjIEyClN7lesizpy8PUI8Ud5sqe3mZUEyO9a_ywtOFkjF8xzTyoRK-fZj6XG6qqdjUo4BpcNv9Kt56GpigEKeQQ1mQfWIJROskbe_nJ5j_vc8HxsEnrB5-Nl2xEAZFwN5CSREN5FXaPIXE1U9Xp0HQgdOZ3_9D48twqAMvV2asTjlgRAxUh8uf0mwxg=","iv":"_AmDnIVEnS2-m14K","protected":"eyJlbmMiOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIiwidHlwIjoiSldNLzEuMCIsImFsZyI6IkF1dGhjcnlwdCIsInJlY2lwaWVudHMiOlt7ImVuY3J5cHRlZF9rZXkiOiJsbzRrM0R2RzJXcnZJNTJNNTVaM2tZdXJQX0pZd2gtcUtHak5uRkE4YjZpbmJNRVBpbkUxT1Nwb2dpY2FHSGNPIiwiaGVhZGVyIjp7ImtpZCI6IjRQWGFDU1BUQVpxRFRIaDRNNnYzWlExdVc1d2hQUW5EeDMyYkp0Q3lvSjhWIiwiaXYiOiJjdUhLcUZQMlFiN0s4djJxTEFya0VLOHpRZHFkS1dLMSIsInNlbmRlciI6IkY3S2FacmhVczc0bDg2OFAzX0swYk9QVzU2eFNNc0t5M1ZPV3FGTlpsMVprOGV0UUlfZUs4Q3JXUUktT1NZU3ZlVzRHNjRZOWFnRHlDS3ZHbWN1dWtieURxOV9KVUI2Tlk1SzNIV2pjalBUVk9qZnpEX2NpV21DNTZXTT0ifX1dfQ==","tag":"GLUAUyEK7oOfB1Qyk05Ubg=="},"senderDID":"","statusCode":"MS-103","type":"aries","uid":"0c6bd83f-1fd2-441d-a0b9-3293536afdb3"}]}"#; pub const GET_ALL_MESSAGES_RESPONSE: &'static [u8; 339] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 1, 36, 204, 130, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 173, 77, 83, 71, 83, 95, 66, 89, 95, 67, 79, 78, 78, 83, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 171, 109, 115, 103, 115, 66, 121, 67, 111, 110, 110, 115, 204, 145, 204, 130, 204, 171, 112, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 204, 182, 54, 116, 115, 56, 67, 71, 101, 66, 118, 72, 120, 75, 68, 57, 111, 69, 115, 109, 119, 87, 76, 81, 204, 164, 109, 115, 103, 115, 204, 145, 204, 134, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 51, 204, 167, 112, 97, 121, 108, 111, 97, 100, 204, 145, 25, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 70, 110, 76, 90, 120, 119, 82, 57, 86, 74, 76, 57, 70, 97, 66, 53, 88, 82, 69, 100, 121, 51, 204, 163, 117, 105, 100, 204, 167, 121, 50, 113, 49, 110, 50, 109, 204, 164, 116, 121, 112, 101, 204, 169, 99, 114, 101, 100, 79, 102, 102, 101, 114, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 145, 204, 131, 204, 162, 116, 111, 204, 182, 54, 116, 115, 56, 67, 71, 101, 66, 118, 72, 120, 75, 68, 57, 111, 69, 115, 109, 119, 87, 76, 81, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 167, 77, 68, 83, 45, 49, 48, 49, 204, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 204, 189, 50, 48, 49, 56, 45, 48, 55, 45, 49, 56, 84, 48, 52, 58, 53, 49, 58, 49, 57, 46, 51, 50, 56, 90, 91, 85, 84, 67, 93]; -pub const UPDATE_MESSAGES_RESPONSE: &'static [u8; 147] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 119, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 187, 77, 83, 71, 95, 83, 84, 65, 84, 85, 83, 95, 85, 80, 68, 65, 84, 69, 68, 95, 66, 89, 95, 67, 79, 78, 78, 83, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 178, 117, 112, 100, 97, 116, 101, 100, 85, 105, 100, 115, 66, 121, 67, 111, 110, 110, 115, 208, 145, 208, 130, 208, 171, 112, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 208, 182, 55, 57, 82, 78, 82, 113, 77, 87, 52, 72, 106, 107, 97, 111, 98, 101, 72, 105, 69, 77, 110, 101, 208, 164, 117, 105, 100, 115, 208, 145, 208, 167, 111, 103, 109, 49, 121, 50, 102]; pub const GET_MESSAGES_INVITE_ACCEPTED_RESPONSE: &'static [u8; 870] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 2, 203, 204, 130, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 164, 77, 83, 71, 83, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 164, 109, 115, 103, 115, 204, 146, 204, 134, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 52, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 77, 82, 105, 67, 118, 83, 87, 72, 101, 78, 110, 88, 82, 116, 122, 118, 69, 105, 57, 80, 75, 101, 204, 163, 117, 105, 100, 204, 167, 111, 119, 118, 108, 121, 116, 121, 204, 164, 116, 121, 112, 101, 204, 167, 99, 111, 110, 110, 82, 101, 113, 204, 168, 114, 101, 102, 77, 115, 103, 73, 100, 204, 167, 111, 119, 109, 53, 121, 116, 97, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 144, 204, 134, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 52, 204, 167, 112, 97, 121, 108, 111, 97, 100, 204, 220, 1, 204, 152, 204, 208, 204, 130, 204, 208, 204, 165, 64, 116, 121, 112, 101, 204, 208, 204, 131, 204, 208, 204, 164, 110, 97, 109, 101, 204, 208, 204, 173, 67, 111, 110, 110, 82, 101, 113, 65, 110, 115, 119, 101, 114, 204, 208, 204, 163, 118, 101, 114, 204, 208, 204, 163, 49, 46, 48, 204, 208, 204, 163, 102, 109, 116, 204, 208, 204, 164, 106, 115, 111, 110, 204, 208, 204, 164, 64, 109, 115, 103, 204, 208, 204, 220, 1, 79, 204, 208, 204, 208, 204, 208, 204, 129, 204, 208, 204, 208, 204, 208, 204, 172, 115, 101, 110, 100, 101, 114, 68, 101, 116, 97, 105, 108, 204, 208, 204, 208, 204, 208, 204, 134, 204, 208, 204, 208, 204, 208, 204, 163, 68, 73, 68, 204, 208, 204, 208, 204, 208, 204, 182, 75, 119, 49, 57, 54, 87, 75, 69, 72, 77, 98, 85, 105, 86, 71, 99, 85, 76, 120, 56, 107, 82, 204, 208, 204, 208, 204, 208, 204, 176, 97, 103, 101, 110, 116, 75, 101, 121, 68, 108, 103, 80, 114, 111, 111, 102, 204, 208, 204, 208, 204, 208, 204, 131, 204, 208, 204, 208, 204, 208, 204, 168, 97, 103, 101, 110, 116, 68, 73, 68, 204, 208, 204, 208, 204, 208, 204, 182, 76, 115, 102, 102, 106, 72, 114, 69, 52, 86, 113, 75, 66, 114, 69, 69, 99, 99, 86, 89, 75, 86, 204, 208, 204, 208, 204, 208, 204, 177, 97, 103, 101, 110, 116, 68, 101, 108, 101, 103, 97, 116, 101, 100, 75, 101, 121, 204, 208, 204, 208, 204, 208, 204, 217, 44, 66, 113, 70, 52, 113, 119, 85, 97, 104, 68, 109, 114, 116, 115, 113, 54, 111, 88, 109, 77, 112, 116, 89, 105, 57, 76, 109, 109, 70, 121, 102, 57, 55, 76, 111, 103, 53, 75, 86, 69, 83, 98, 121, 105, 204, 208, 204, 208, 204, 208, 204, 169, 115, 105, 103, 110, 97, 116, 117, 114, 101, 204, 208, 204, 208, 204, 208, 204, 217, 88, 67, 76, 57, 90, 65, 113, 119, 72, 82, 54, 70, 110, 112, 106, 118, 49, 106, 80, 47, 115, 121, 103, 65, 43, 74, 78, 57, 74, 104, 120, 69, 65, 68, 86, 117, 101, 71, 88, 83, 101, 90, 54, 73, 72, 75, 97, 43, 52, 106, 57, 105, 108, 82, 111, 74, 49, 119, 76, 56, 66, 121, 54, 119, 97, 117, 86, 56, 113, 72, 86, 71, 49, 71, 74, 112, 101, 49, 71, 79, 106, 67, 105, 108, 101, 65, 65, 61, 61, 204, 208, 204, 208, 204, 208, 204, 167, 108, 111, 103, 111, 85, 114, 108, 204, 208, 204, 208, 204, 208, 204, 192, 204, 208, 204, 208, 204, 208, 204, 164, 110, 97, 109, 101, 204, 208, 204, 208, 204, 208, 204, 192, 204, 208, 204, 208, 204, 208, 204, 169, 112, 117, 98, 108, 105, 99, 68, 73, 68, 204, 208, 204, 208, 204, 208, 204, 192, 204, 208, 204, 208, 204, 208, 204, 166, 118, 101, 114, 75, 101, 121, 204, 208, 204, 208, 204, 208, 204, 217, 44, 66, 75, 84, 50, 67, 85, 78, 71, 66, 82, 107, 81, 67, 104, 54, 118, 85, 89, 118, 65, 111, 110, 101, 107, 110, 54, 88, 75, 122, 122, 122, 86, 68, 90, 107, 98, 114, 74, 85, 56, 86, 104, 99, 114, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 78, 115, 81, 49, 114, 118, 109, 54, 84, 114, 115, 72, 120, 49, 84, 66, 52, 120, 69, 104, 53, 53, 204, 163, 117, 105, 100, 204, 167, 111, 119, 109, 53, 121, 116, 97, 204, 164, 116, 121, 112, 101, 204, 173, 99, 111, 110, 110, 82, 101, 113, 65, 110, 115, 119, 101, 114, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 144]; #[cfg(test)] pub const GET_PROOF_RESPONSE: &'static [u8; 7626] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 25, 203, 204, 130, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 164, 77, 83, 71, 83, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 164, 109, 115, 103, 115, 204, 146, 204, 134, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 51, 204, 167, 112, 97, 121, 108, 111, 97, 100, 204, 220, 18, 204, 130, 204, 208, 204, 130, 204, 208, 204, 165, 64, 116, 121, 112, 101, 204, 208, 204, 131, 204, 208, 204, 164, 110, 97, 109, 101, 204, 208, 204, 165, 112, 114, 111, 111, 102, 204, 208, 204, 163, 118, 101, 114, 204, 208, 204, 163, 49, 46, 48, 204, 208, 204, 163, 102, 109, 116, 204, 208, 204, 164, 106, 115, 111, 110, 204, 208, 204, 164, 64, 109, 115, 103, 204, 208, 204, 218, 18, 86, 123, 34, 112, 114, 111, 111, 102, 115, 34, 58, 123, 34, 99, 108, 97, 105, 109, 58, 58, 101, 51, 100, 50, 102, 48, 53, 55, 45, 101, 52, 98, 53, 45, 52, 48, 54, 100, 45, 98, 102, 54, 52, 45, 100, 52, 101, 100, 57, 55, 50, 53, 51, 56, 52, 52, 34, 58, 123, 34, 112, 114, 111, 111, 102, 34, 58, 123, 34, 112, 114, 105, 109, 97, 114, 121, 95, 112, 114, 111, 111, 102, 34, 58, 123, 34, 101, 113, 95, 112, 114, 111, 111, 102, 34, 58, 123, 34, 114, 101, 118, 101, 97, 108, 101, 100, 95, 97, 116, 116, 114, 115, 34, 58, 123, 34, 99, 105, 116, 121, 34, 58, 34, 49, 50, 57, 48, 57, 56, 55, 52, 51, 55, 57, 54, 57, 57, 48, 49, 54, 57, 57, 52, 51, 56, 53, 53, 56, 48, 50, 50, 49, 53, 51, 50, 56, 48, 49, 53, 51, 54, 49, 53, 52, 55, 55, 54, 51, 50, 49, 51, 56, 56, 48, 55, 51, 55, 52, 54, 51, 51, 56, 50, 57, 51, 53, 57, 57, 52, 54, 52, 57, 49, 55, 57, 48, 57, 57, 49, 51, 34, 44, 34, 115, 116, 97, 116, 101, 34, 58, 34, 57, 51, 56, 53, 54, 54, 50, 57, 54, 55, 48, 54, 53, 55, 56, 51, 48, 51, 53, 49, 57, 57, 49, 50, 50, 48, 57, 56, 57, 48, 51, 49, 49, 51, 48, 52, 57, 57, 51, 49, 51, 53, 53, 57, 51, 51, 50, 53, 52, 57, 52, 50, 55, 54, 51, 55, 57, 52, 48, 54, 52, 53, 55, 55, 55, 56, 49, 51, 57, 54, 52, 52, 54, 49, 50, 51, 49, 34, 44, 34, 122, 105, 112, 34, 58, 34, 56, 52, 48, 48, 48, 34, 44, 34, 97, 100, 100, 114, 101, 115, 115, 50, 34, 58, 34, 49, 52, 48, 54, 57, 52, 50, 48, 53, 51, 55, 52, 56, 56, 55, 56, 50, 50, 49, 50, 53, 55, 50, 56, 49, 53, 52, 53, 55, 54, 57, 52, 55, 54, 51, 53, 57, 55, 50, 56, 50, 51, 56, 57, 51, 53, 54, 53, 53, 51, 54, 56, 53, 49, 50, 52, 53, 56, 55, 56, 52, 54, 51, 49, 54, 52, 49, 54, 55, 57, 48, 52, 49, 50, 49, 55, 50, 34, 44, 34, 97, 100, 100, 114, 101, 115, 115, 49, 34, 58, 34, 54, 55, 49, 55, 56, 51, 50, 53, 55, 48, 54, 48, 53, 53, 52, 52, 48, 53, 49, 57, 51, 51, 51, 56, 52, 52, 48, 48, 49, 57, 49, 48, 55, 49, 52, 55, 55, 56, 49, 56, 55, 50, 48, 48, 51, 50, 54, 50, 50, 52, 54, 50, 54, 54, 55, 57, 48, 51, 48, 57, 52, 55, 55, 49, 53, 54, 49, 56, 57, 50, 50, 50, 55, 48, 56, 51, 52, 34, 125, 44, 34, 97, 95, 112, 114, 105, 109, 101, 34, 58, 34, 55, 56, 57, 49, 51, 55, 49, 50, 50, 48, 56, 49, 57, 48, 50, 50, 48, 49, 53, 56, 55, 55, 48, 54, 49, 48, 53, 53, 50, 56, 52, 56, 54, 48, 50, 56, 56, 51, 57, 50, 56, 55, 51, 53, 56, 50, 56, 48, 48, 51, 55, 52, 57, 56, 51, 55, 51, 54, 54, 48, 54, 52, 51, 50, 52, 55, 53, 53, 57, 55, 57, 52, 55, 50, 57, 56, 53, 52, 48, 55, 54, 51, 56, 49, 54, 50, 51, 55, 54, 48, 54, 51, 55, 52, 56, 54, 50, 53, 57, 55, 52, 56, 54, 54, 50, 48, 53, 53, 51, 57, 54, 51, 55, 56, 52, 55, 54, 48, 49, 49, 55, 48, 50, 54, 53, 49, 51, 51, 54, 48, 57, 56, 52, 51, 55, 50, 55, 56, 53, 53, 48, 57, 54, 53, 49, 51, 57, 57, 57, 53, 57, 50, 50, 57, 56, 56, 51, 52, 52, 53, 50, 56, 48, 54, 53, 54, 49, 52, 54, 52, 53, 51, 48, 48, 54, 56, 57, 50, 49, 49, 57, 57, 50, 50, 56, 51, 48, 57, 53, 51, 53, 50, 52, 54, 49, 53, 50, 50, 49, 51, 49, 51, 50, 53, 49, 55, 49, 50, 53, 52, 57, 49, 53, 48, 54, 50, 50, 50, 48, 51, 57, 54, 55, 57, 57, 53, 49, 57, 55, 54, 53, 51, 57, 52, 53, 49, 52, 51, 50, 49, 55, 55, 57, 54, 56, 53, 57, 54, 57, 51, 54, 48, 49, 55, 55, 50, 50, 50, 51, 48, 49, 52, 55, 48, 53, 54, 50, 49, 48, 52, 54, 48, 52, 53, 48, 49, 56, 52, 53, 52, 50, 54, 56, 57, 55, 57, 53, 52, 54, 56, 55, 49, 49, 51, 53, 57, 57, 54, 51, 51, 54, 50, 49, 50, 54, 48, 50, 50, 53, 48, 48, 48, 55, 49, 49, 51, 49, 54, 57, 54, 54, 57, 50, 57, 53, 53, 56, 53, 50, 56, 50, 51, 48, 48, 55, 57, 54, 48, 55, 51, 53, 48, 49, 56, 56, 55, 57, 51, 49, 55, 55, 51, 49, 50, 52, 54, 56, 53, 49, 53, 56, 55, 48, 48, 52, 48, 55, 57, 50, 57, 56, 53, 48, 51, 50, 56, 55, 56, 53, 49, 55, 51, 51, 50, 54, 49, 51, 56, 57, 49, 49, 48, 50, 54, 56, 52, 48, 49, 53, 49, 51, 57, 49, 49, 56, 57, 49, 51, 56, 52, 55, 52, 48, 53, 48, 53, 56, 54, 54, 54, 51, 49, 56, 52, 50, 57, 53, 48, 52, 52, 50, 56, 50, 54, 57, 48, 53, 54, 51, 49, 54, 54, 52, 56, 55, 55, 49, 52, 53, 53, 50, 49, 55, 52, 50, 49, 55, 54, 48, 52, 49, 56, 56, 57, 48, 49, 48, 53, 52, 49, 54, 52, 50, 51, 52, 54, 56, 54, 55, 53, 57, 50, 49, 48, 48, 55, 55, 52, 53, 49, 51, 49, 54, 50, 56, 57, 56, 51, 53, 57, 55, 53, 49, 55, 50, 49, 51, 50, 51, 51, 55, 50, 54, 50, 55, 50, 57, 51, 51, 49, 54, 48, 49, 56, 49, 49, 50, 55, 53, 49, 52, 49, 56, 54, 52, 48, 56, 54, 48, 52, 53, 54, 51, 48, 55, 55, 53, 57, 57, 53, 48, 52, 49, 54, 57, 54, 48, 48, 57, 49, 49, 53, 48, 49, 52, 50, 48, 50, 52, 54, 48, 55, 50, 56, 52, 57, 51, 52, 54, 52, 49, 57, 53, 55, 50, 55, 53, 50, 57, 55, 48, 50, 50, 55, 53, 48, 54, 53, 49, 48, 53, 52, 57, 53, 54, 53, 53, 54, 51, 50, 54, 53, 50, 53, 52, 54, 48, 34, 44, 34, 101, 34, 58, 34, 49, 49, 55, 50, 55, 53, 49, 50, 48, 48, 52, 48, 57, 50, 52, 51, 57, 54, 57, 50, 53, 51, 49, 55, 52, 49, 49, 54, 56, 55, 48, 51, 48, 53, 50, 49, 54, 53, 57, 48, 53, 55, 50, 56, 50, 53, 50, 52, 48, 53, 48, 55, 56, 52, 53, 55, 53, 57, 53, 49, 56, 49, 54, 54, 50, 55, 55, 49, 49, 57, 56, 55, 54, 56, 53, 57, 54, 49, 53, 48, 52, 49, 50, 51, 54, 56, 54, 55, 57, 49, 50, 53, 54, 48, 48, 55, 54, 51, 54, 56, 54, 52, 56, 54, 50, 53, 49, 56, 50, 56, 51, 54, 48, 55, 54, 57, 55, 52, 49, 49, 54, 49, 57, 55, 51, 55, 54, 56, 53, 57, 56, 49, 55, 56, 48, 56, 54, 56, 34, 44, 34, 118, 34, 58, 34, 57, 52, 48, 49, 49, 57, 53, 49, 57, 57, 54, 56, 53, 54, 52, 57, 52, 48, 57, 52, 52, 53, 51, 48, 57, 54, 50, 48, 51, 56, 53, 53, 56, 53, 52, 48, 57, 52, 57, 54, 55, 49, 55, 56, 54, 53, 51, 48, 55, 55, 52, 57, 50, 56, 57, 54, 53, 48, 55, 52, 57, 54, 55, 51, 52, 51, 50, 49, 53, 52, 50, 50, 51, 49, 52, 57, 50, 48, 53, 51, 51, 48, 52, 53, 49, 57, 57, 54, 57, 52, 50, 53, 51, 56, 50, 48, 56, 49, 48, 51, 55, 50, 51, 49, 50, 48, 57, 49, 49, 51, 54, 49, 52, 56, 52, 51, 55, 53, 48, 50, 48, 53, 48, 56, 49, 56, 54, 53, 49, 51, 48, 51, 53, 52, 52, 57, 49, 53, 53, 53, 57, 48, 57, 52, 54, 52, 49, 54, 49, 51, 48, 52, 53, 48, 56, 56, 51, 56, 53, 48, 57, 50, 48, 56, 56, 50, 50, 49, 49, 52, 56, 56, 53, 57, 55, 49, 55, 53, 49, 48, 52, 53, 52, 48, 51, 57, 55, 54, 51, 57, 52, 51, 49, 50, 54, 55, 57, 53, 53, 53, 56, 55, 57, 50, 51, 55, 48, 50, 55, 48, 48, 50, 50, 48, 57, 51, 54, 54, 55, 50, 57, 52, 55, 53, 56, 49, 55, 57, 53, 48, 54, 56, 56, 48, 56, 57, 53, 56, 51, 52, 53, 57, 50, 51, 55, 52, 51, 53, 51, 57, 55, 53, 49, 56, 55, 51, 48, 48, 51, 54, 53, 56, 53, 57, 52, 52, 51, 52, 57, 48, 48, 49, 55, 57, 52, 53, 57, 53, 52, 55, 50, 52, 53, 55, 52, 56, 55, 54, 57, 56, 57, 48, 54, 55, 52, 56, 49, 57, 52, 48, 56, 53, 50, 50, 50, 55, 51, 55, 54, 55, 49, 55, 55, 50, 55, 52, 48, 48, 51, 54, 51, 56, 48, 51, 55, 50, 55, 54, 57, 50, 54, 51, 51, 51, 53, 52, 48, 57, 57, 50, 53, 55, 49, 48, 51, 56, 57, 48, 50, 53, 56, 53, 51, 53, 55, 55, 57, 56, 57, 53, 53, 55, 53, 48, 48, 57, 53, 50, 51, 51, 54, 50, 50, 56, 55, 50, 53, 48, 48, 56, 52, 54, 52, 53, 52, 48, 54, 48, 48, 56, 54, 54, 52, 52, 54, 53, 56, 56, 52, 54, 50, 54, 48, 57, 57, 48, 51, 48, 51, 57, 55, 53, 48, 55, 48, 53, 56, 50, 49, 53, 51, 53, 53, 56, 56, 54, 52, 56, 51, 50, 51, 48, 50, 49, 55, 48, 52, 53, 48, 48, 51, 49, 48, 56, 54, 52, 55, 53, 50, 53, 48, 54, 51, 54, 50, 48, 53, 51, 53, 52, 48, 53, 54, 55, 52, 57, 51, 57, 51, 48, 54, 54, 55, 49, 56, 55, 54, 48, 54, 54, 50, 55, 56, 49, 52, 48, 52, 52, 50, 53, 50, 53, 51, 56, 49, 50, 49, 54, 53, 48, 49, 53, 49, 48, 51, 54, 56, 55, 56, 54, 48, 49, 50, 49, 57, 54, 49, 50, 50, 50, 55, 48, 54, 49, 56, 50, 54, 57, 50, 51, 53, 51, 51, 55, 48, 50, 54, 53, 55, 50, 55, 52, 51, 54, 51, 51, 56, 48, 57, 56, 49, 53, 54, 55, 56, 53, 50, 57, 52, 56, 57, 57, 50, 56, 50, 51, 52, 52, 52, 49, 51, 54, 51, 55, 50, 51, 49, 52, 50, 55, 53, 51, 53, 53, 51, 56, 53, 49, 48, 51, 53, 54, 49, 49, 50, 48, 53, 56, 57, 56, 52, 55, 53, 53, 56, 50, 57, 50, 54, 48, 54, 51, 54, 50, 50, 50, 57, 50, 52, 48, 57, 50, 50, 52, 56, 55, 53, 52, 49, 56, 50, 49, 55, 57, 54, 54, 55, 57, 51, 49, 51, 49, 54, 55, 54, 57, 52, 52, 55, 48, 48, 55, 49, 52, 51, 51, 55, 54, 51, 52, 57, 56, 51, 49, 50, 56, 54, 55, 49, 54, 51, 51, 51, 55, 52, 51, 49, 49, 53, 52, 56, 53, 49, 54, 55, 53, 56, 57, 54, 49, 57, 54, 56, 54, 55, 56, 54, 54, 56, 49, 50, 50, 54, 55, 56, 49, 55, 52, 53, 55, 48, 49, 55, 50, 50, 52, 53, 51, 52, 50, 48, 53, 56, 51, 50, 51, 49, 53, 54, 57, 48, 50, 57, 55, 53, 54, 51, 49, 50, 51, 50, 55, 52, 48, 55, 50, 54, 53, 54, 55, 53, 51, 57, 53, 54, 48, 56, 57, 56, 56, 56, 56, 54, 55, 51, 49, 48, 57, 51, 57, 48, 55, 55, 54, 53, 50, 56, 52, 57, 50, 56, 52, 55, 54, 54, 51, 51, 50, 55, 49, 51, 57, 56, 50, 52, 51, 54, 49, 51, 48, 52, 57, 50, 54, 51, 49, 49, 52, 54, 57, 54, 48, 51, 54, 49, 55, 48, 50, 52, 56, 50, 50, 50, 53, 57, 48, 55, 56, 54, 50, 54, 53, 54, 49, 52, 52, 55, 52, 51, 49, 56, 54, 50, 50, 55, 57, 53, 54, 51, 56, 56, 54, 56, 57, 54, 53, 52, 53, 48, 52, 49, 54, 56, 56, 56, 51, 54, 57, 50, 55, 52, 48, 55, 52, 50, 49, 54, 50, 53, 54, 50, 53, 53, 57, 54, 56, 54, 51, 56, 48, 54, 52, 54, 49, 55, 54, 53, 52, 54, 49, 50, 48, 49, 51, 51, 52, 48, 53, 50, 49, 52, 49, 52, 54, 48, 56, 52, 48, 51, 55, 53, 34, 44, 34, 109, 34, 58, 123, 125, 44, 34, 109, 49, 34, 58, 34, 56, 48, 48, 55, 55, 56, 48, 53, 53, 52, 57, 48, 49, 56, 55, 51, 53, 55, 53, 56, 51, 51, 50, 56, 55, 52, 50, 50, 51, 53, 53, 53, 49, 55, 48, 56, 52, 50, 56, 51, 51, 48, 54, 53, 50, 51, 51, 54, 56, 49, 55, 48, 49, 51, 56, 54, 56, 50, 48, 56, 53, 55, 48, 53, 53, 56, 53, 57, 51, 48, 57, 55, 53, 48, 54, 52, 55, 55, 52, 49, 53, 49, 57, 57, 53, 50, 57, 50, 48, 49, 56, 48, 53, 57, 48, 54, 48, 53, 53, 54, 55, 48, 48, 54, 52, 50, 56, 48, 49, 56, 51, 52, 52, 54, 55, 49, 52, 54, 52, 51, 48, 56, 56, 50, 54, 54, 51, 57, 54, 53, 54, 50, 48, 50, 54, 48, 48, 54, 56, 52, 54, 54, 57, 48, 57, 48, 49, 52, 48, 55, 53, 49, 48, 54, 56, 56, 48, 52, 53, 57, 48, 48, 52, 48, 54, 57, 52, 49, 50, 57, 52, 53, 57, 54, 50, 57, 48, 56, 52, 56, 51, 56, 56, 57, 52, 54, 57, 51, 54, 57, 50, 52, 56, 53, 51, 50, 55, 51, 49, 50, 57, 54, 53, 56, 54, 50, 49, 52, 51, 54, 54, 49, 57, 52, 49, 53, 51, 50, 49, 55, 48, 53, 49, 52, 48, 57, 57, 57, 49, 53, 55, 57, 50, 53, 57, 49, 55, 55, 50, 50, 55, 55, 49, 50, 52, 50, 51, 55, 53, 54, 48, 50, 53, 48, 52, 57, 55, 51, 50, 55, 48, 55, 51, 49, 54, 48, 51, 48, 48, 52, 50, 50, 54, 52, 51, 56, 55, 52, 57, 49, 48, 49, 55, 54, 57, 56, 55, 56, 50, 48, 51, 54, 52, 55, 53, 53, 52, 56, 49, 51, 55, 57, 53, 57, 49, 54, 52, 51, 34, 44, 34, 109, 50, 34, 58, 34, 50, 51, 50, 54, 51, 51, 57, 48, 56, 50, 56, 50, 49, 51, 56, 55, 53, 54, 54, 51, 55, 56, 56, 50, 53, 57, 55, 57, 48, 55, 54, 51, 56, 52, 53, 52, 57, 51, 49, 55, 52, 50, 56, 54, 52, 52, 54, 50, 56, 48, 51, 50, 52, 50, 56, 53, 49, 54, 52, 50, 50, 56, 49, 50, 56, 49, 56, 57, 51, 51, 49, 55, 48, 56, 54, 55, 48, 53, 56, 56, 51, 55, 54, 49, 53, 54, 52, 53, 55, 53, 53, 52, 54, 49, 50, 51, 54, 56, 56, 52, 55, 49, 52, 52, 53, 57, 54, 54, 51, 51, 55, 52, 53, 51, 52, 52, 49, 48, 49, 53, 54, 53, 51, 56, 50, 55, 48, 48, 52, 56, 49, 51, 57, 49, 48, 57, 51, 52, 57, 52, 51, 50, 50, 53, 57, 48, 52, 54, 57, 53, 51, 56, 48, 57, 52, 56, 52, 52, 49, 52, 57, 56, 52, 53, 53, 57, 56, 52, 50, 48, 57, 54, 56, 51, 54, 52, 48, 55, 34, 125, 44, 34, 103, 101, 95, 112, 114, 111, 111, 102, 115, 34, 58, 91, 93, 125, 44, 34, 110, 111, 110, 95, 114, 101, 118, 111, 99, 95, 112, 114, 111, 111, 102, 34, 58, 110, 117, 108, 108, 125, 44, 34, 115, 99, 104, 101, 109, 97, 95, 115, 101, 113, 95, 110, 111, 34, 58, 49, 53, 44, 34, 105, 115, 115, 117, 101, 114, 95, 100, 105, 100, 34, 58, 34, 50, 104, 111, 113, 118, 99, 119, 117, 112, 82, 84, 85, 78, 107, 88, 110, 54, 65, 114, 89, 122, 115, 34, 125, 125, 44, 34, 97, 103, 103, 114, 101, 103, 97, 116, 101, 100, 95, 112, 114, 111, 111, 102, 34, 58, 123, 34, 99, 95, 104, 97, 115, 104, 34, 58, 34, 50, 50, 52, 56, 57, 49, 49, 57, 49, 52, 51, 57, 57, 55, 52, 50, 56, 56, 48, 50, 55, 48, 49, 55, 51, 52, 51, 55, 51, 54, 54, 50, 50, 50, 50, 52, 54, 53, 57, 55, 50, 48, 48, 56, 50, 49, 57, 48, 55, 48, 50, 50, 53, 51, 48, 54, 51, 53, 49, 53, 53, 52, 56, 50, 54, 57, 52, 48, 57, 49, 51, 57, 51, 51, 50, 55, 51, 34, 44, 34, 99, 95, 108, 105, 115, 116, 34, 58, 91, 91, 50, 44, 49, 49, 51, 44, 50, 57, 44, 50, 52, 52, 44, 49, 53, 53, 44, 53, 55, 44, 55, 53, 44, 49, 53, 48, 44, 50, 50, 52, 44, 51, 48, 44, 49, 56, 57, 44, 49, 55, 54, 44, 50, 48, 50, 44, 50, 49, 48, 44, 50, 52, 56, 44, 55, 55, 44, 49, 51, 51, 44, 52, 49, 44, 49, 49, 53, 44, 55, 54, 44, 50, 56, 44, 51, 50, 44, 49, 52, 48, 44, 50, 52, 50, 44, 53, 49, 44, 49, 56, 49, 44, 49, 51, 57, 44, 53, 56, 44, 50, 52, 48, 44, 50, 50, 51, 44, 57, 51, 44, 49, 52, 44, 49, 56, 55, 44, 50, 50, 50, 44, 49, 54, 48, 44, 50, 57, 44, 50, 52, 48, 44, 49, 55, 55, 44, 49, 48, 54, 44, 53, 49, 44, 54, 50, 44, 57, 44, 51, 54, 44, 50, 51, 49, 44, 54, 44, 54, 54, 44, 50, 53, 50, 44, 51, 51, 44, 57, 53, 44, 49, 50, 56, 44, 57, 51, 44, 54, 56, 44, 51, 51, 44, 50, 51, 54, 44, 49, 56, 44, 49, 55, 56, 44, 50, 48, 57, 44, 49, 48, 52, 44, 49, 49, 53, 44, 52, 53, 44, 50, 52, 50, 44, 57, 53, 44, 49, 55, 53, 44, 57, 50, 44, 50, 51, 50, 44, 49, 52, 53, 44, 50, 48, 55, 44, 56, 52, 44, 50, 50, 53, 44, 50, 50, 55, 44, 49, 50, 54, 44, 49, 53, 44, 49, 55, 49, 44, 54, 56, 44, 49, 49, 52, 44, 49, 48, 57, 44, 57, 48, 44, 49, 56, 53, 44, 51, 44, 49, 50, 57, 44, 50, 48, 51, 44, 49, 50, 55, 44, 49, 51, 52, 44, 49, 54, 57, 44, 56, 55, 44, 51, 50, 44, 50, 48, 49, 44, 49, 48, 50, 44, 49, 52, 49, 44, 51, 48, 44, 49, 51, 52, 44, 50, 50, 55, 44, 49, 55, 44, 55, 56, 44, 51, 49, 44, 49, 54, 53, 44, 50, 48, 50, 44, 50, 50, 53, 44, 49, 57, 44, 56, 49, 44, 49, 53, 52, 44, 49, 53, 55, 44, 50, 53, 48, 44, 49, 53, 54, 44, 49, 56, 52, 44, 50, 52, 57, 44, 50, 51, 56, 44, 49, 52, 51, 44, 50, 49, 44, 49, 56, 44, 49, 48, 50, 44, 49, 55, 48, 44, 51, 57, 44, 49, 57, 52, 44, 49, 52, 50, 44, 50, 50, 50, 44, 50, 50, 48, 44, 50, 49, 51, 44, 49, 52, 51, 44, 54, 52, 44, 50, 52, 53, 44, 49, 56, 51, 44, 52, 57, 44, 50, 50, 57, 44, 56, 52, 44, 52, 56, 44, 52, 55, 44, 49, 48, 56, 44, 49, 52, 55, 44, 56, 53, 44, 57, 53, 44, 49, 48, 50, 44, 49, 51, 54, 44, 52, 49, 44, 56, 53, 44, 49, 48, 55, 44, 50, 53, 48, 44, 49, 48, 55, 44, 49, 55, 52, 44, 50, 52, 53, 44, 50, 49, 53, 44, 50, 51, 50, 44, 50, 49, 51, 44, 50, 51, 51, 44, 49, 44, 48, 44, 49, 54, 54, 44, 49, 48, 57, 44, 51, 48, 44, 50, 48, 54, 44, 50, 48, 53, 44, 50, 48, 48, 44, 52, 53, 44, 50, 51, 57, 44, 49, 53, 44, 50, 50, 55, 44, 50, 53, 52, 44, 51, 55, 44, 49, 53, 57, 44, 50, 51, 55, 44, 49, 57, 51, 44, 54, 48, 44, 54, 48, 44, 49, 53, 54, 44, 49, 51, 48, 44, 51, 51, 44, 49, 57, 55, 44, 49, 50, 52, 44, 53, 48, 44, 49, 52, 53, 44, 51, 55, 44, 49, 56, 55, 44, 49, 50, 53, 44, 50, 49, 44, 49, 57, 50, 44, 52, 51, 44, 49, 53, 48, 44, 51, 50, 44, 50, 48, 48, 44, 49, 49, 56, 44, 49, 53, 52, 44, 50, 48, 51, 44, 49, 54, 48, 44, 49, 55, 57, 44, 50, 50, 52, 44, 52, 50, 44, 49, 55, 55, 44, 49, 48, 48, 44, 55, 57, 44, 53, 53, 44, 50, 51, 49, 44, 50, 52, 50, 44, 50, 50, 51, 44, 50, 51, 55, 44, 56, 48, 44, 49, 56, 57, 44, 57, 55, 44, 56, 44, 51, 57, 44, 51, 48, 44, 49, 56, 51, 44, 52, 50, 44, 49, 51, 52, 44, 57, 53, 44, 54, 53, 44, 50, 48, 56, 44, 49, 51, 57, 44, 57, 51, 44, 49, 57, 52, 44, 54, 48, 44, 50, 49, 53, 44, 49, 50, 52, 44, 49, 51, 54, 44, 52, 54, 44, 49, 52, 50, 44, 49, 55, 44, 50, 53, 48, 44, 49, 48, 56, 44, 49, 53, 53, 44, 56, 54, 44, 49, 52, 48, 44, 49, 54, 50, 44, 50, 48, 54, 44, 49, 50, 54, 44, 57, 49, 44, 50, 49, 51, 44, 49, 57, 50, 44, 49, 51, 55, 44, 50, 48, 57, 44, 49, 49, 52, 44, 51, 57, 44, 49, 53, 55, 44, 49, 50, 54, 44, 51, 56, 44, 49, 51, 52, 44, 53, 49, 44, 49, 56, 54, 44, 54, 51, 44, 49, 57, 51, 44, 50, 50, 49, 44, 49, 50, 56, 44, 50, 57, 44, 55, 51, 44, 50, 49, 48, 44, 50, 50, 44, 49, 50, 56, 44, 49, 52, 55, 44, 49, 54, 53, 44, 50, 49, 56, 44, 49, 57, 54, 44, 56, 51, 44, 49, 48, 55, 44, 49, 48, 53, 44, 51, 44, 50, 52, 55, 44, 50, 49, 56, 44, 50, 48, 93, 93, 125, 44, 34, 114, 101, 113, 117, 101, 115, 116, 101, 100, 95, 112, 114, 111, 111, 102, 34, 58, 123, 34, 114, 101, 118, 101, 97, 108, 101, 100, 95, 97, 116, 116, 114, 115, 34, 58, 123, 34, 99, 105, 116, 121, 95, 50, 34, 58, 91, 34, 99, 108, 97, 105, 109, 58, 58, 101, 51, 100, 50, 102, 48, 53, 55, 45, 101, 52, 98, 53, 45, 52, 48, 54, 100, 45, 98, 102, 54, 52, 45, 100, 52, 101, 100, 57, 55, 50, 53, 51, 56, 52, 52, 34, 44, 34, 68, 114, 97, 112, 101, 114, 34, 44, 34, 49, 50, 57, 48, 57, 56, 55, 52, 51, 55, 57, 54, 57, 57, 48, 49, 54, 57, 57, 52, 51, 56, 53, 53, 56, 48, 50, 50, 49, 53, 51, 50, 56, 48, 49, 53, 51, 54, 49, 53, 52, 55, 55, 54, 51, 50, 49, 51, 56, 56, 48, 55, 51, 55, 52, 54, 51, 51, 56, 50, 57, 51, 53, 57, 57, 52, 54, 52, 57, 49, 55, 57, 48, 57, 57, 49, 51, 34, 93, 44, 34, 115, 116, 97, 116, 101, 95, 51, 34, 58, 91, 34, 99, 108, 97, 105, 109, 58, 58, 101, 51, 100, 50, 102, 48, 53, 55, 45, 101, 52, 98, 53, 45, 52, 48, 54, 100, 45, 98, 102, 54, 52, 45, 100, 52, 101, 100, 57, 55, 50, 53, 51, 56, 52, 52, 34, 44, 34, 85, 84, 34, 44, 34, 57, 51, 56, 53, 54, 54, 50, 57, 54, 55, 48, 54, 53, 55, 56, 51, 48, 51, 53, 49, 57, 57, 49, 50, 50, 48, 57, 56, 57, 48, 51, 49, 49, 51, 48, 52, 57, 57, 51, 49, 51, 53, 53, 57, 51, 51, 50, 53, 52, 57, 52, 50, 55, 54, 51, 55, 57, 52, 48, 54, 52, 53, 55, 55, 55, 56, 49, 51, 57, 54, 52, 52, 54, 49, 50, 51, 49, 34, 93, 44, 34, 97, 100, 100, 114, 101, 115, 115, 50, 95, 49, 34, 58, 91, 34, 99, 108, 97, 105, 109, 58, 58, 101, 51, 100, 50, 102, 48, 53, 55, 45, 101, 52, 98, 53, 45, 52, 48, 54, 100, 45, 98, 102, 54, 52, 45, 100, 52, 101, 100, 57, 55, 50, 53, 51, 56, 52, 52, 34, 44, 34, 83, 117, 105, 116, 101, 32, 51, 34, 44, 34, 49, 52, 48, 54, 57, 52, 50, 48, 53, 51, 55, 52, 56, 56, 55, 56, 50, 50, 49, 50, 53, 55, 50, 56, 49, 53, 52, 53, 55, 54, 57, 52, 55, 54, 51, 53, 57, 55, 50, 56, 50, 51, 56, 57, 51, 53, 54, 53, 53, 51, 54, 56, 53, 49, 50, 52, 53, 56, 55, 56, 52, 54, 51, 49, 54, 52, 49, 54, 55, 57, 48, 52, 49, 50, 49, 55, 50, 34, 93, 44, 34, 97, 100, 100, 114, 101, 115, 115, 49, 95, 48, 34, 58, 91, 34, 99, 108, 97, 105, 109, 58, 58, 101, 51, 100, 50, 102, 48, 53, 55, 45, 101, 52, 98, 53, 45, 52, 48, 54, 100, 45, 98, 102, 54, 52, 45, 100, 52, 101, 100, 57, 55, 50, 53, 51, 56, 52, 52, 34, 44, 34, 49, 50, 51, 32, 77, 97, 105, 110, 32, 83, 116, 34, 44, 34, 54, 55, 49, 55, 56, 51, 50, 53, 55, 48, 54, 48, 53, 53, 52, 52, 48, 53, 49, 57, 51, 51, 51, 56, 52, 52, 48, 48, 49, 57, 49, 48, 55, 49, 52, 55, 55, 56, 49, 56, 55, 50, 48, 48, 51, 50, 54, 50, 50, 52, 54, 50, 54, 54, 55, 57, 48, 51, 48, 57, 52, 55, 55, 49, 53, 54, 49, 56, 57, 50, 50, 50, 55, 48, 56, 51, 52, 34, 93, 44, 34, 122, 105, 112, 95, 52, 34, 58, 91, 34, 99, 108, 97, 105, 109, 58, 58, 101, 51, 100, 50, 102, 48, 53, 55, 45, 101, 52, 98, 53, 45, 52, 48, 54, 100, 45, 98, 102, 54, 52, 45, 100, 52, 101, 100, 57, 55, 50, 53, 51, 56, 52, 52, 34, 44, 34, 56, 52, 48, 48, 48, 34, 44, 34, 56, 52, 48, 48, 48, 34, 93, 125, 44, 34, 117, 110, 114, 101, 118, 101, 97, 108, 101, 100, 95, 97, 116, 116, 114, 115, 34, 58, 123, 125, 44, 34, 115, 101, 108, 102, 95, 97, 116, 116, 101, 115, 116, 101, 100, 95, 97, 116, 116, 114, 115, 34, 58, 123, 125, 44, 34, 112, 114, 101, 100, 105, 99, 97, 116, 101, 115, 34, 58, 123, 125, 125, 44, 34, 114, 101, 109, 111, 116, 101, 68, 105, 100, 34, 58, 34, 76, 99, 118, 77, 117, 71, 72, 87, 105, 99, 120, 70, 100, 49, 71, 83, 69, 98, 80, 75, 51, 86, 34, 44, 34, 117, 115, 101, 114, 80, 97, 105, 114, 119, 105, 115, 101, 68, 105, 100, 34, 58, 34, 80, 72, 118, 50, 50, 106, 76, 49, 78, 120, 67, 98, 51, 115, 89, 107, 85, 75, 112, 72, 84, 68, 34, 125, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 54, 78, 112, 56, 53, 117, 97, 51, 49, 53, 101, 111, 118, 90, 121, 85, 87, 82, 118, 80, 65, 74, 204, 163, 117, 105, 100, 204, 167, 122, 100, 118, 106, 111, 100, 110, 204, 164, 116, 121, 112, 101, 204, 165, 112, 114, 111, 111, 102, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 144, 204, 134, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 50, 204, 167, 112, 97, 121, 108, 111, 97, 100, 204, 220, 4, 93, 54, 204, 208, 204, 205, 204, 208, 204, 211, 17, 204, 208, 204, 172, 110, 204, 255, 204, 208, 204, 161, 17, 112, 204, 230, 26, 204, 208, 204, 150, 204, 208, 204, 190, 204, 224, 107, 204, 255, 204, 208, 204, 187, 45, 14, 204, 208, 204, 217, 31, 204, 208, 204, 191, 204, 208, 204, 173, 204, 242, 204, 246, 204, 208, 204, 170, 204, 208, 204, 213, 204, 208, 204, 184, 204, 208, 204, 177, 204, 208, 204, 168, 87, 63, 204, 227, 36, 204, 208, 204, 219, 117, 67, 50, 5, 204, 208, 204, 147, 204, 208, 204, 188, 110, 204, 208, 204, 149, 93, 204, 208, 204, 193, 3, 86, 60, 106, 6, 204, 255, 204, 208, 204, 133, 99, 119, 67, 204, 208, 204, 213, 126, 111, 204, 232, 204, 208, 204, 135, 0, 204, 208, 204, 176, 106, 204, 208, 204, 138, 204, 249, 45, 204, 208, 204, 209, 110, 204, 208, 204, 133, 204, 251, 106, 204, 208, 204, 152, 204, 208, 204, 204, 100, 204, 208, 204, 152, 204, 208, 204, 167, 44, 111, 204, 208, 204, 128, 204, 208, 204, 183, 94, 204, 208, 204, 191, 51, 204, 242, 7, 81, 204, 208, 204, 216, 49, 204, 208, 204, 178, 204, 226, 54, 111, 204, 208, 204, 151, 44, 204, 208, 204, 128, 3, 44, 204, 208, 204, 194, 204, 208, 204, 190, 41, 204, 240, 204, 208, 204, 193, 204, 241, 15, 204, 250, 32, 1, 4, 120, 56, 86, 204, 208, 204, 223, 204, 208, 204, 180, 69, 98, 65, 204, 253, 32, 204, 229, 204, 208, 204, 161, 10, 204, 208, 204, 132, 204, 244, 204, 208, 204, 141, 204, 208, 204, 144, 204, 208, 204, 217, 204, 208, 204, 140, 19, 204, 254, 204, 208, 204, 185, 204, 226, 14, 70, 204, 225, 18, 16, 35, 204, 228, 102, 126, 204, 237, 204, 208, 204, 188, 204, 208, 204, 142, 20, 204, 208, 204, 184, 112, 204, 253, 204, 208, 204, 182, 49, 28, 97, 204, 208, 204, 154, 108, 204, 229, 204, 208, 204, 153, 107, 105, 65, 204, 208, 204, 133, 33, 90, 33, 204, 208, 204, 184, 30, 204, 208, 204, 188, 62, 17, 204, 208, 204, 187, 204, 208, 204, 219, 204, 208, 204, 217, 99, 58, 204, 240, 54, 64, 100, 204, 208, 204, 193, 204, 208, 204, 148, 58, 204, 208, 204, 171, 7, 204, 208, 204, 191, 204, 208, 204, 149, 204, 208, 204, 213, 2, 60, 85, 2, 204, 225, 56, 204, 208, 204, 221, 204, 208, 204, 185, 66, 23, 204, 208, 204, 219, 204, 208, 204, 198, 204, 239, 204, 230, 204, 208, 204, 130, 204, 208, 204, 167, 204, 251, 204, 208, 204, 204, 77, 204, 208, 204, 170, 204, 208, 204, 220, 204, 225, 109, 204, 208, 204, 138, 56, 41, 115, 101, 204, 208, 204, 202, 73, 204, 208, 204, 169, 12, 204, 208, 204, 167, 204, 247, 204, 208, 204, 140, 204, 241, 90, 50, 118, 204, 208, 204, 145, 85, 204, 208, 204, 152, 54, 121, 8, 204, 208, 204, 199, 204, 208, 204, 174, 204, 208, 204, 169, 204, 208, 204, 198, 204, 208, 204, 142, 204, 208, 204, 186, 204, 237, 101, 204, 244, 204, 208, 204, 198, 96, 204, 208, 204, 220, 204, 208, 204, 174, 204, 208, 204, 195, 29, 63, 54, 116, 204, 208, 204, 211, 81, 204, 208, 204, 195, 115, 8, 64, 204, 246, 52, 204, 208, 204, 210, 127, 204, 208, 204, 197, 204, 208, 204, 160, 43, 204, 208, 204, 172, 204, 208, 204, 210, 204, 208, 204, 133, 113, 83, 204, 252, 204, 248, 204, 232, 5, 204, 208, 204, 199, 204, 208, 204, 133, 87, 204, 208, 204, 198, 107, 41, 120, 19, 108, 1, 204, 229, 120, 204, 208, 204, 219, 108, 102, 204, 252, 204, 252, 204, 208, 204, 148, 46, 42, 204, 225, 60, 204, 208, 204, 181, 107, 12, 108, 69, 56, 204, 208, 204, 131, 204, 208, 204, 194, 204, 208, 204, 183, 47, 204, 208, 204, 180, 204, 208, 204, 186, 94, 204, 208, 204, 128, 95, 204, 208, 204, 216, 80, 204, 208, 204, 135, 204, 208, 204, 160, 40, 125, 11, 68, 204, 208, 204, 204, 81, 204, 237, 204, 246, 74, 204, 208, 204, 221, 86, 27, 204, 208, 204, 210, 126, 204, 250, 91, 204, 208, 204, 206, 58, 204, 249, 204, 242, 204, 208, 204, 186, 204, 208, 204, 222, 59, 204, 208, 204, 198, 204, 208, 204, 222, 204, 243, 204, 208, 204, 197, 16, 204, 208, 204, 170, 13, 204, 208, 204, 153, 204, 208, 204, 221, 204, 226, 204, 208, 204, 218, 204, 255, 89, 21, 204, 229, 204, 208, 204, 167, 3, 204, 208, 204, 150, 204, 208, 204, 206, 73, 88, 204, 208, 204, 177, 204, 208, 204, 153, 48, 51, 67, 71, 204, 208, 204, 223, 82, 60, 204, 208, 204, 134, 204, 208, 204, 160, 204, 208, 204, 164, 204, 208, 204, 142, 42, 204, 208, 204, 170, 204, 208, 204, 133, 204, 208, 204, 129, 204, 208, 204, 156, 51, 101, 45, 204, 208, 204, 215, 204, 254, 30, 73, 204, 226, 78, 204, 208, 204, 206, 76, 10, 204, 208, 204, 154, 204, 228, 204, 208, 204, 135, 124, 58, 204, 208, 204, 146, 204, 245, 204, 254, 204, 208, 204, 197, 41, 11, 204, 208, 204, 174, 204, 208, 204, 193, 12, 204, 208, 204, 171, 204, 208, 204, 173, 11, 204, 208, 204, 206, 204, 208, 204, 161, 204, 208, 204, 203, 86, 204, 208, 204, 157, 204, 208, 204, 219, 204, 208, 204, 215, 45, 42, 204, 208, 204, 221, 204, 208, 204, 185, 118, 84, 83, 69, 204, 208, 204, 168, 59, 70, 204, 208, 204, 207, 77, 204, 208, 204, 211, 68, 32, 204, 208, 204, 218, 204, 208, 204, 168, 204, 208, 204, 160, 31, 204, 208, 204, 156, 204, 208, 204, 138, 107, 49, 49, 204, 208, 204, 181, 76, 118, 204, 237, 204, 208, 204, 181, 204, 208, 204, 189, 204, 208, 204, 213, 204, 208, 204, 146, 204, 208, 204, 193, 94, 112, 204, 208, 204, 195, 127, 55, 127, 204, 208, 204, 193, 77, 95, 92, 39, 204, 208, 204, 159, 204, 208, 204, 172, 204, 208, 204, 162, 93, 80, 124, 13, 204, 208, 204, 151, 204, 208, 204, 156, 113, 109, 204, 208, 204, 141, 30, 204, 208, 204, 223, 81, 94, 79, 53, 204, 225, 121, 204, 208, 204, 158, 84, 204, 233, 204, 254, 204, 238, 204, 208, 204, 158, 204, 208, 204, 128, 204, 208, 204, 152, 204, 208, 204, 203, 204, 208, 204, 172, 72, 94, 204, 208, 204, 189, 204, 208, 204, 168, 204, 208, 204, 153, 53, 204, 208, 204, 130, 11, 100, 204, 225, 204, 208, 204, 144, 204, 208, 204, 167, 31, 204, 208, 204, 157, 19, 18, 204, 252, 124, 204, 208, 204, 220, 204, 249, 204, 235, 204, 208, 204, 171, 28, 28, 44, 204, 208, 204, 154, 8, 80, 204, 208, 204, 164, 63, 89, 204, 208, 204, 205, 116, 204, 253, 20, 204, 208, 204, 184, 204, 224, 204, 208, 204, 214, 95, 52, 45, 69, 204, 254, 88, 204, 208, 204, 209, 204, 208, 204, 204, 204, 208, 204, 170, 82, 8, 45, 84, 108, 74, 59, 14, 53, 204, 208, 204, 174, 57, 127, 40, 18, 48, 93, 61, 204, 208, 204, 162, 204, 208, 204, 145, 108, 29, 14, 48, 110, 30, 18, 24, 119, 204, 208, 204, 151, 204, 208, 204, 205, 204, 248, 204, 208, 204, 164, 204, 208, 204, 136, 16, 204, 208, 204, 158, 101, 204, 208, 204, 203, 67, 69, 204, 208, 204, 197, 63, 204, 208, 204, 211, 204, 208, 204, 181, 36, 110, 118, 59, 204, 244, 20, 204, 208, 204, 221, 204, 208, 204, 185, 204, 208, 204, 204, 56, 204, 208, 204, 200, 204, 208, 204, 175, 204, 246, 90, 85, 78, 66, 20, 204, 208, 204, 187, 90, 71, 204, 208, 204, 213, 204, 244, 63, 65, 204, 253, 27, 5, 28, 204, 208, 204, 212, 204, 234, 204, 208, 204, 173, 204, 208, 204, 131, 204, 208, 204, 205, 40, 83, 204, 208, 204, 183, 21, 125, 204, 250, 47, 95, 107, 54, 50, 204, 208, 204, 148, 94, 87, 204, 208, 204, 195, 29, 204, 208, 204, 145, 101, 204, 247, 110, 62, 50, 204, 255, 39, 204, 208, 204, 151, 204, 208, 204, 140, 1, 66, 81, 126, 204, 248, 29, 204, 208, 204, 134, 116, 81, 24, 103, 204, 208, 204, 193, 12, 204, 245, 204, 208, 204, 213, 86, 119, 52, 204, 208, 204, 172, 204, 208, 204, 137, 204, 208, 204, 137, 109, 204, 245, 102, 122, 204, 208, 204, 150, 31, 204, 208, 204, 142, 31, 204, 208, 204, 150, 204, 208, 204, 161, 204, 208, 204, 146, 204, 208, 204, 182, 204, 208, 204, 138, 22, 43, 204, 242, 204, 208, 204, 150, 49, 204, 208, 204, 209, 98, 204, 248, 204, 208, 204, 135, 7, 87, 204, 225, 204, 208, 204, 218, 204, 227, 204, 231, 4, 204, 208, 204, 129, 204, 208, 204, 187, 45, 24, 204, 233, 98, 9, 204, 247, 204, 224, 24, 204, 208, 204, 197, 204, 208, 204, 130, 204, 235, 204, 241, 75, 24, 50, 19, 63, 204, 252, 204, 208, 204, 173, 99, 204, 252, 106, 204, 240, 103, 53, 71, 204, 208, 204, 176, 204, 208, 204, 219, 204, 208, 204, 212, 204, 250, 127, 18, 204, 208, 204, 185, 204, 208, 204, 128, 204, 208, 204, 214, 92, 204, 208, 204, 219, 2, 204, 208, 204, 159, 204, 208, 204, 172, 204, 208, 204, 128, 204, 208, 204, 173, 204, 208, 204, 221, 13, 95, 32, 204, 208, 204, 151, 204, 208, 204, 132, 0, 204, 208, 204, 143, 53, 204, 208, 204, 173, 204, 208, 204, 191, 204, 208, 204, 134, 58, 204, 208, 204, 165, 204, 240, 91, 88, 204, 208, 204, 147, 15, 15, 13, 104, 66, 11, 204, 208, 204, 220, 63, 63, 77, 93, 52, 204, 208, 204, 132, 101, 45, 38, 0, 79, 204, 208, 204, 146, 204, 208, 204, 217, 3, 94, 93, 204, 208, 204, 175, 54, 3, 109, 204, 208, 204, 129, 37, 29, 204, 208, 204, 168, 40, 96, 85, 204, 208, 204, 174, 22, 204, 208, 204, 143, 204, 208, 204, 209, 204, 234, 57, 98, 204, 208, 204, 213, 204, 243, 73, 15, 33, 204, 208, 204, 216, 103, 204, 208, 204, 194, 4, 204, 208, 204, 193, 29, 204, 208, 204, 223, 50, 122, 118, 58, 43, 204, 208, 204, 129, 28, 204, 208, 204, 207, 13, 204, 239, 35, 204, 208, 204, 215, 117, 73, 119, 121, 204, 208, 204, 134, 66, 101, 204, 208, 204, 217, 108, 16, 66, 204, 208, 204, 178, 95, 204, 208, 204, 152, 112, 87, 204, 208, 204, 223, 10, 127, 5, 51, 79, 204, 208, 204, 185, 204, 227, 87, 204, 208, 204, 181, 204, 208, 204, 162, 204, 232, 204, 235, 49, 204, 208, 204, 188, 204, 208, 204, 180, 13, 29, 204, 254, 119, 204, 231, 50, 44, 17, 1, 204, 246, 58, 204, 208, 204, 152, 25, 46, 69, 204, 208, 204, 215, 10, 13, 118, 64, 204, 208, 204, 142, 66, 87, 204, 208, 204, 137, 117, 204, 208, 204, 154, 118, 48, 204, 241, 67, 204, 208, 204, 142, 204, 208, 204, 155, 29, 204, 208, 204, 140, 204, 208, 204, 195, 78, 204, 208, 204, 193, 204, 208, 204, 223, 118, 31, 103, 204, 208, 204, 193, 204, 208, 204, 133, 66, 204, 208, 204, 180, 76, 12, 204, 208, 204, 210, 204, 208, 204, 213, 55, 204, 239, 204, 208, 204, 170, 55, 62, 111, 5, 204, 208, 204, 175, 77, 204, 208, 204, 209, 88, 204, 208, 204, 157, 204, 208, 204, 193, 47, 204, 208, 204, 139, 204, 208, 204, 157, 204, 242, 90, 204, 208, 204, 190, 64, 34, 204, 208, 204, 135, 204, 208, 204, 169, 204, 208, 204, 204, 90, 76, 85, 47, 204, 208, 204, 143, 204, 252, 55, 112, 90, 24, 105, 204, 230, 204, 208, 204, 218, 204, 208, 204, 181, 204, 241, 21, 95, 204, 208, 204, 208, 204, 225, 94, 90, 204, 234, 204, 247, 95, 204, 228, 204, 208, 204, 184, 123, 204, 208, 204, 168, 204, 247, 204, 208, 204, 138, 63, 204, 225, 32, 204, 241, 95, 85, 29, 29, 20, 204, 208, 204, 195, 204, 208, 204, 130, 204, 208, 204, 142, 204, 252, 121, 14, 33, 45, 103, 66, 204, 208, 204, 193, 115, 204, 208, 204, 159, 204, 208, 204, 218, 114, 204, 224, 204, 208, 204, 146, 111, 204, 208, 204, 199, 31, 204, 246, 53, 204, 208, 204, 139, 204, 208, 204, 136, 20, 204, 208, 204, 191, 40, 204, 208, 204, 192, 114, 111, 64, 47, 18, 99, 204, 208, 204, 221, 204, 232, 204, 239, 127, 17, 204, 208, 204, 129, 204, 208, 204, 147, 204, 208, 204, 214, 204, 238, 78, 204, 208, 204, 220, 94, 98, 119, 17, 204, 252, 204, 208, 204, 204, 204, 208, 204, 176, 204, 208, 204, 131, 113, 204, 208, 204, 196, 204, 208, 204, 131, 96, 10, 98, 204, 208, 204, 168, 204, 226, 56, 37, 97, 204, 224, 204, 247, 204, 208, 204, 195, 105, 88, 53, 204, 208, 204, 133, 204, 240, 204, 208, 204, 188, 60, 204, 208, 204, 131, 204, 208, 204, 151, 48, 90, 74, 90, 54, 204, 247, 39, 9, 108, 62, 204, 208, 204, 137, 1, 204, 208, 204, 162, 102, 204, 208, 204, 131, 204, 231, 40, 74, 58, 41, 204, 225, 79, 27, 72, 71, 204, 252, 58, 204, 253, 204, 208, 204, 158, 113, 24, 204, 208, 204, 200, 204, 208, 204, 159, 1, 204, 241, 204, 248, 204, 208, 204, 170, 123, 81, 204, 231, 29, 204, 249, 204, 208, 204, 158, 57, 204, 208, 204, 146, 45, 204, 208, 204, 177, 204, 208, 204, 172, 204, 208, 204, 143, 20, 204, 208, 204, 149, 13, 204, 208, 204, 129, 204, 208, 204, 198, 204, 240, 204, 208, 204, 163, 204, 208, 204, 147, 28, 204, 208, 204, 212, 204, 237, 204, 208, 204, 164, 110, 50, 204, 208, 204, 193, 100, 204, 227, 122, 204, 208, 204, 181, 204, 208, 204, 149, 204, 208, 204, 139, 204, 235, 30, 204, 208, 204, 147, 109, 88, 204, 208, 204, 136, 31, 204, 225, 204, 234, 204, 208, 204, 152, 204, 208, 204, 194, 204, 208, 204, 221, 204, 208, 204, 197, 204, 208, 204, 178, 68, 204, 208, 204, 185, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 67, 119, 56, 113, 70, 70, 66, 52, 53, 70, 117, 68, 122, 81, 102, 111, 65, 51, 77, 72, 67, 86, 204, 163, 117, 105, 100, 204, 167, 121, 106, 97, 120, 109, 119, 118, 204, 164, 116, 121, 112, 101, 204, 168, 112, 114, 111, 111, 102, 82, 101, 113, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 145, 204, 131, 204, 162, 116, 111, 204, 182, 78, 72, 88, 70, 90, 77, 80, 87, 98, 56, 116, 114, 103, 90, 77, 101, 106, 53, 117, 110, 117, 50, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 167, 77, 68, 83, 45, 49, 48, 50, 204, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 204, 189, 50, 48, 49, 56, 45, 48, 49, 45, 48, 51, 84, 49, 55, 58, 52, 50, 58, 51, 52, 46, 51, 50, 56, 90, 91, 85, 84, 67, 93]; @@ -60,14 +53,6 @@ pub const UPDATE_CREDENTIAL_RESPONSE: &'static [u8; 295] = &[129, 167, 98, 117, pub const CREDENTIAL_REQ_RESPONSE: &'static [u8; 3524] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 13, 129, 204, 130, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 164, 77, 83, 71, 83, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 164, 109, 115, 103, 115, 204, 145, 204, 135, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 51, 204, 167, 112, 97, 121, 108, 111, 97, 100, 204, 220, 12, 204, 130, 204, 208, 204, 130, 204, 208, 204, 165, 64, 116, 121, 112, 101, 204, 208, 204, 131, 204, 208, 204, 164, 110, 97, 109, 101, 204, 208, 204, 169, 67, 76, 65, 73, 77, 95, 82, 69, 81, 204, 208, 204, 163, 118, 101, 114, 204, 208, 204, 163, 49, 46, 48, 204, 208, 204, 163, 102, 109, 116, 204, 208, 204, 164, 106, 115, 111, 110, 204, 208, 204, 164, 64, 109, 115, 103, 204, 208, 204, 218, 12, 82, 123, 34, 108, 105, 98, 105, 110, 100, 121, 95, 99, 114, 101, 100, 95, 114, 101, 113, 34, 58, 34, 123, 92, 34, 108, 105, 98, 105, 110, 100, 121, 95, 99, 114, 101, 100, 95, 114, 101, 113, 92, 34, 58, 92, 34, 123, 92, 92, 92, 34, 112, 114, 111, 118, 101, 114, 95, 100, 105, 100, 92, 92, 92, 34, 58, 92, 92, 92, 34, 50, 104, 111, 113, 118, 99, 119, 117, 112, 82, 84, 85, 78, 107, 88, 110, 54, 65, 114, 89, 122, 115, 92, 92, 92, 34, 44, 92, 92, 92, 34, 99, 114, 101, 100, 95, 100, 101, 102, 95, 105, 100, 92, 92, 92, 34, 58, 92, 92, 92, 34, 50, 104, 111, 113, 118, 99, 119, 117, 112, 82, 84, 85, 78, 107, 88, 110, 54, 65, 114, 89, 122, 115, 58, 51, 58, 67, 76, 58, 49, 55, 54, 54, 92, 92, 92, 34, 44, 92, 92, 92, 34, 98, 108, 105, 110, 100, 101, 100, 95, 109, 115, 92, 92, 92, 34, 58, 123, 92, 92, 92, 34, 117, 92, 92, 92, 34, 58, 92, 92, 92, 34, 56, 55, 51, 50, 48, 55, 49, 54, 48, 50, 51, 53, 55, 48, 49, 53, 51, 48, 55, 56, 49, 48, 53, 54, 54, 49, 51, 56, 56, 48, 56, 49, 57, 55, 50, 51, 52, 54, 53, 56, 51, 49, 50, 53, 56, 49, 55, 56, 53, 49, 51, 55, 49, 48, 57, 55, 56, 56, 49, 49, 51, 51, 48, 50, 57, 56, 50, 54, 52, 48, 48, 53, 57, 51, 52, 57, 57, 54, 55, 48, 53, 48, 57, 54, 53, 52, 52, 55, 52, 56, 57, 50, 49, 55, 53, 57, 51, 50, 57, 56, 54, 49, 54, 50, 48, 57, 57, 56, 56, 56, 50, 54, 55, 50, 51, 55, 48, 49, 53, 54, 50, 54, 54, 49, 51, 52, 51, 52, 52, 51, 53, 49, 55, 53, 56, 57, 56, 52, 55, 50, 49, 56, 48, 49, 51, 51, 54, 54, 52, 48, 55, 56, 52, 53, 48, 55, 51, 54, 49, 54, 50, 54, 54, 51, 57, 49, 55, 53, 54, 48, 48, 57, 50, 54, 52, 57, 56, 48, 48, 52, 48, 50, 51, 56, 57, 53, 50, 51, 52, 57, 52, 52, 53, 54, 52, 51, 55, 55, 56, 57, 51, 54, 53, 55, 53, 54, 53, 54, 53, 51, 53, 55, 55, 57, 48, 49, 53, 52, 53, 56, 48, 50, 51, 52, 57, 51, 57, 48, 51, 55, 56, 53, 55, 56, 48, 53, 49, 56, 49, 48, 49, 57, 55, 53, 55, 48, 49, 57, 56, 50, 57, 48, 49, 51, 56, 51, 53, 49, 52, 48, 51, 48, 50, 48, 56, 56, 54, 56, 56, 52, 55, 51, 48, 55, 54, 50, 50, 51, 54, 50, 54, 57, 54, 56, 56, 48, 50, 54, 51, 49, 54, 51, 51, 52, 51, 56, 52, 56, 52, 57, 52, 53, 49, 48, 53, 57, 53, 54, 57, 48, 51, 48, 55, 54, 49, 51, 50, 48, 52, 50, 55, 55, 56, 52, 56, 53, 57, 57, 54, 57, 53, 56, 56, 50, 50, 49, 48, 52, 53, 57, 49, 50, 54, 57, 52, 49, 55, 57, 55, 52, 53, 57, 48, 49, 57, 57, 49, 51, 57, 53, 51, 53, 57, 50, 55, 50, 52, 48, 57, 55, 56, 53, 53, 49, 48, 57, 54, 49, 51, 54, 49, 49, 54, 52, 55, 55, 48, 57, 55, 52, 53, 48, 55, 50, 55, 55, 51, 52, 50, 55, 54, 50, 54, 55, 50, 48, 52, 48, 49, 52, 52, 50, 50, 51, 53, 49, 57, 51, 48, 49, 49, 53, 53, 55, 50, 51, 50, 53, 54, 50, 53, 53, 53, 54, 50, 50, 50, 52, 52, 49, 53, 54, 51, 51, 54, 56, 48, 54, 49, 53, 49, 54, 54, 50, 52, 52, 49, 50, 51, 52, 56, 52, 55, 55, 55, 51, 51, 57, 51, 51, 56, 55, 54, 52, 57, 55, 49, 57, 50, 48, 57, 50, 52, 51, 52, 53, 53, 57, 54, 48, 51, 52, 55, 53, 54, 51, 50, 55, 52, 55, 57, 49, 50, 50, 57, 49, 50, 54, 50, 48, 50, 48, 49, 54, 50, 49, 53, 53, 53, 48, 49, 50, 48, 57, 51, 52, 55, 55, 53, 48, 54, 48, 57, 57, 50, 48, 51, 49, 50, 56, 48, 57, 54, 54, 48, 52, 53, 56, 57, 52, 56, 53, 57, 53, 53, 55, 50, 55, 49, 54, 52, 49, 56, 49, 55, 52, 57, 49, 57, 52, 51, 52, 49, 54, 48, 52, 56, 48, 55, 53, 52, 52, 53, 52, 52, 57, 55, 50, 50, 48, 48, 48, 53, 57, 49, 48, 53, 57, 53, 54, 56, 48, 49, 51, 49, 55, 54, 57, 48, 53, 51, 48, 52, 49, 57, 53, 92, 92, 92, 34, 44, 92, 92, 92, 34, 117, 114, 92, 92, 92, 34, 58, 110, 117, 108, 108, 125, 44, 92, 92, 92, 34, 98, 108, 105, 110, 100, 101, 100, 95, 109, 115, 95, 99, 111, 114, 114, 101, 99, 116, 110, 101, 115, 115, 95, 112, 114, 111, 111, 102, 92, 92, 92, 34, 58, 123, 92, 92, 92, 34, 99, 92, 92, 92, 34, 58, 92, 92, 92, 34, 50, 54, 53, 51, 48, 55, 52, 48, 48, 50, 54, 53, 48, 55, 52, 51, 49, 51, 55, 57, 52, 57, 49, 51, 56, 53, 52, 50, 52, 55, 56, 49, 48, 48, 48, 56, 53, 53, 49, 55, 48, 54, 51, 55, 52, 48, 50, 50, 56, 48, 50, 50, 53, 52, 49, 57, 50, 55, 48, 52, 54, 54, 50, 50, 54, 55, 51, 54, 48, 54, 55, 57, 48, 52, 53, 49, 50, 92, 92, 92, 34, 44, 92, 92, 92, 34, 118, 95, 100, 97, 115, 104, 95, 99, 97, 112, 92, 92, 92, 34, 58, 92, 92, 92, 34, 49, 52, 51, 49, 52, 50, 55, 54, 52, 50, 53, 54, 50, 50, 49, 54, 52, 57, 53, 57, 49, 51, 57, 52, 49, 57, 48, 55, 53, 54, 53, 57, 52, 50, 54, 51, 53, 55, 53, 50, 53, 50, 55, 56, 55, 51, 51, 54, 56, 56, 56, 50, 54, 48, 50, 55, 55, 53, 54, 57, 55, 48, 50, 55, 53, 52, 54, 48, 54, 49, 49, 57, 52, 51, 48, 49, 52, 57, 55, 51, 49, 51, 55, 52, 54, 57, 54, 54, 48, 52, 57, 56, 49, 53, 56, 50, 56, 54, 53, 57, 48, 57, 53, 56, 54, 51, 51, 48, 54, 57, 54, 48, 51, 56, 53, 53, 55, 51, 53, 49, 52, 56, 54, 53, 53, 54, 48, 49, 56, 49, 50, 52, 50, 55, 56, 55, 48, 54, 50, 57, 51, 48, 49, 57, 55, 54, 52, 50, 51, 54, 55, 57, 50, 51, 55, 57, 57, 51, 48, 55, 55, 51, 50, 56, 57, 55, 51, 48, 55, 56, 49, 51, 56, 55, 52, 48, 50, 51, 50, 49, 51, 48, 55, 50, 55, 53, 48, 54, 54, 53, 49, 50, 54, 50, 57, 53, 53, 56, 52, 55, 51, 54, 57, 54, 53, 50, 48, 49, 57, 55, 51, 57, 51, 55, 54, 50, 55, 49, 51, 56, 57, 52, 52, 52, 57, 57, 54, 56, 48, 53, 56, 52, 49, 53, 55, 53, 56, 50, 48, 48, 54, 52, 55, 50, 49, 54, 55, 54, 56, 48, 48, 52, 50, 52, 50, 52, 54, 48, 48, 49, 57, 57, 48, 57, 54, 48, 52, 55, 51, 51, 54, 49, 48, 55, 57, 52, 49, 48, 52, 49, 56, 48, 54, 50, 57, 49, 57, 48, 48, 56, 50, 57, 55, 56, 55, 55, 57, 55, 53, 55, 53, 57, 49, 55, 50, 54, 54, 54, 54, 51, 52, 48, 55, 50, 48, 55, 51, 55, 56, 51, 50, 56, 48, 57, 55, 55, 57, 50, 56, 49, 57, 52, 53, 51, 50, 51, 52, 51, 55, 52, 55, 53, 49, 53, 52, 51, 52, 48, 54, 49, 53, 55, 57, 56, 55, 55, 56, 51, 51, 55, 57, 54, 48, 55, 52, 56, 56, 51, 54, 52, 54, 56, 49, 57, 57, 52, 48, 55, 48, 48, 55, 55, 55, 53, 48, 51, 49, 54, 53, 55, 54, 56, 50, 51, 48, 50, 48, 51, 56, 53, 51, 51, 51, 57, 56, 48, 51, 57, 56, 48, 54, 52, 50, 55, 54, 55, 53, 55, 48, 57, 52, 53, 51, 51, 57, 53, 49, 52, 56, 56, 52, 49, 57, 53, 57, 52, 54, 50, 52, 55, 48, 56, 54, 49, 57, 49, 53, 55, 49, 50, 55, 56, 57, 52, 48, 51, 52, 54, 53, 55, 50, 50, 54, 53, 57, 57, 54, 48, 51, 52, 50, 49, 54, 53, 48, 52, 49, 50, 54, 48, 50, 54, 57, 52, 54, 51, 49, 48, 51, 55, 56, 50, 52, 52, 54, 49, 51, 50, 52, 55, 53, 54, 56, 56, 56, 50, 49, 56, 49, 48, 55, 55, 53, 50, 48, 50, 56, 50, 56, 50, 49, 48, 57, 55, 57, 51, 55, 51, 56, 50, 54, 54, 51, 54, 54, 53, 48, 49, 51, 56, 48, 54, 51, 57, 52, 50, 57, 54, 50, 49, 50, 49, 52, 54, 55, 56, 53, 52, 51, 52, 57, 54, 57, 56, 52, 54, 52, 53, 48, 49, 52, 53, 53, 48, 57, 56, 50, 53, 56, 50, 57, 51, 49, 48, 53, 53, 53, 52, 52, 48, 50, 52, 51, 53, 55, 55, 51, 51, 50, 56, 48, 51, 49, 50, 54, 49, 54, 51, 48, 51, 57, 48, 57, 49, 57, 57, 48, 55, 51, 55, 57, 54, 56, 54, 49, 55, 51, 53, 50, 56, 54, 53, 50, 52, 56, 49, 57, 49, 55, 48, 50, 50, 53, 53, 54, 57, 51, 49, 52, 56, 51, 48, 56, 57, 48, 51, 53, 55, 56, 54, 49, 52, 54, 53, 56, 48, 48, 50, 52, 52, 54, 56, 57, 50, 52, 55, 49, 52, 52, 57, 52, 57, 52, 56, 55, 51, 55, 55, 49, 49, 48, 48, 48, 51, 54, 49, 51, 57, 57, 55, 53, 51, 55, 49, 54, 49, 48, 49, 53, 54, 49, 55, 55, 57, 53, 57, 48, 92, 92, 92, 34, 44, 92, 92, 92, 34, 109, 115, 95, 99, 97, 112, 92, 92, 92, 34, 58, 92, 92, 92, 34, 54, 55, 49, 51, 55, 56, 53, 54, 56, 52, 50, 57, 50, 50, 56, 57, 55, 52, 56, 49, 53, 55, 53, 52, 52, 57, 48, 50, 48, 54, 51, 53, 57, 57, 48, 48, 52, 51, 51, 50, 51, 54, 51, 56, 49, 49, 48, 51, 51, 49, 53, 53, 56, 54, 49, 48, 56, 51, 57, 53, 54, 55, 53, 55, 48, 51, 51, 54, 56, 56, 57, 50, 49, 48, 49, 48, 52, 54, 50, 57, 52, 51, 49, 54, 57, 52, 54, 48, 57, 53, 49, 53, 53, 57, 53, 57, 53, 53, 49, 49, 56, 53, 55, 54, 49, 56, 56, 57, 54, 52, 51, 51, 51, 49, 49, 55, 52, 53, 53, 57, 49, 54, 49, 48, 56, 57, 50, 51, 55, 55, 55, 51, 53, 53, 54, 57, 49, 50, 50, 49, 54, 53, 57, 53, 56, 57, 54, 48, 57, 54, 53, 56, 48, 56, 51, 51, 48, 53, 53, 50, 52, 55, 50, 48, 57, 51, 51, 52, 54, 49, 54, 51, 52, 54, 48, 51, 54, 54, 92, 92, 92, 34, 125, 44, 92, 92, 92, 34, 110, 111, 110, 99, 101, 92, 92, 92, 34, 58, 92, 92, 92, 34, 49, 49, 53, 52, 53, 52, 57, 56, 56, 50, 51, 54, 53, 52, 49, 54, 56, 48, 51, 50, 57, 54, 55, 49, 51, 92, 92, 92, 34, 125, 92, 34, 44, 92, 34, 108, 105, 98, 105, 110, 100, 121, 95, 99, 114, 101, 100, 95, 114, 101, 113, 95, 109, 101, 116, 97, 92, 34, 58, 92, 34, 123, 92, 92, 92, 34, 109, 97, 115, 116, 101, 114, 95, 115, 101, 99, 114, 101, 116, 95, 98, 108, 105, 110, 100, 105, 110, 103, 95, 100, 97, 116, 97, 92, 92, 92, 34, 58, 123, 92, 92, 92, 34, 118, 95, 112, 114, 105, 109, 101, 92, 92, 92, 34, 58, 92, 92, 92, 34, 53, 51, 57, 53, 51, 53, 53, 49, 50, 56, 49, 55, 50, 50, 53, 48, 49, 52, 51, 49, 54, 57, 48, 54, 56, 48, 56, 57, 52, 51, 49, 57, 53, 54, 55, 56, 52, 55, 57, 50, 54, 52, 50, 53, 52, 50, 55, 54, 49, 56, 54, 52, 51, 54, 50, 52, 48, 50, 50, 50, 56, 52, 56, 48, 54, 48, 48, 57, 56, 57, 54, 57, 52, 56, 55, 52, 57, 54, 54, 48, 55, 53, 57, 52, 49, 51, 56, 52, 50, 54, 48, 49, 53, 53, 54, 52, 56, 53, 50, 48, 57, 51, 51, 52, 56, 50, 53, 56, 51, 54, 57, 53, 48, 49, 53, 54, 49, 51, 49, 53, 57, 56, 54, 50, 54, 51, 54, 50, 54, 48, 48, 55, 53, 51, 56, 57, 54, 49, 53, 55, 49, 54, 50, 50, 50, 49, 53, 57, 54, 54, 50, 53, 52, 54, 49, 54, 52, 49, 54, 56, 55, 56, 54, 52, 49, 49, 50, 57, 50, 57, 50, 57, 48, 53, 56, 51, 53, 48, 56, 50, 57, 49, 48, 57, 49, 49, 52, 48, 55, 54, 53, 56, 51, 50, 53, 51, 51, 49, 55, 51, 51, 53, 48, 54, 55, 50, 50, 56, 55, 57, 51, 50, 51, 57, 54, 52, 56, 54, 48, 50, 54, 48, 57, 50, 57, 56, 53, 56, 50, 52, 49, 56, 48, 49, 55, 53, 51, 49, 52, 54, 51, 53, 52, 48, 48, 52, 51, 57, 57, 56, 50, 52, 48, 57, 53, 55, 57, 57, 51, 51, 50, 48, 48, 57, 51, 50, 52, 57, 50, 57, 52, 49, 53, 56, 50, 53, 50, 54, 50, 54, 50, 51, 49, 56, 50, 50, 51, 55, 49, 48, 52, 48, 55, 56, 53, 51, 50, 52, 54, 51, 56, 53, 52, 50, 48, 51, 51, 55, 54, 49, 49, 50, 52, 57, 49, 56, 49, 50, 57, 55, 51, 57, 51, 50, 57, 53, 48, 53, 49, 54, 57, 52, 55, 48, 55, 53, 56, 54, 49, 51, 53, 50, 48, 56, 50, 52, 55, 56, 54, 48, 51, 48, 52, 57, 52, 52, 56, 57, 57, 50, 48, 50, 51, 48, 57, 52, 49, 52, 55, 52, 52, 52, 49, 49, 50, 55, 49, 55, 56, 52, 52, 48, 54, 49, 50, 53, 53, 48, 52, 54, 51, 52, 55, 54, 49, 56, 51, 57, 48, 50, 57, 49, 49, 57, 52, 55, 49, 51, 50, 54, 53, 49, 52, 50, 50, 54, 49, 52, 53, 55, 55, 57, 51, 52, 51, 48, 57, 57, 48, 57, 50, 52, 48, 53, 56, 55, 56, 50, 51, 52, 57, 53, 50, 51, 57, 50, 49, 49, 51, 52, 52, 51, 55, 52, 52, 48, 54, 55, 56, 57, 50, 49, 53, 53, 51, 49, 49, 56, 49, 55, 56, 55, 54, 57, 49, 48, 53, 49, 50, 52, 48, 48, 52, 49, 48, 51, 51, 51, 48, 52, 48, 56, 53, 53, 48, 57, 52, 48, 50, 56, 57, 54, 57, 51, 54, 49, 51, 56, 48, 55, 49, 57, 57, 49, 49, 53, 56, 50, 53, 56, 53, 56, 50, 56, 51, 57, 50, 55, 50, 51, 57, 57, 56, 50, 57, 57, 55, 51, 56, 56, 50, 48, 53, 55, 50, 48, 55, 48, 55, 51, 54, 48, 50, 55, 56, 56, 55, 54, 54, 56, 48, 56, 55, 49, 51, 57, 54, 50, 56, 53, 56, 53, 56, 48, 55, 55, 48, 52, 51, 57, 49, 57, 52, 51, 57, 55, 50, 55, 50, 48, 55, 48, 57, 48, 48, 51, 55, 50, 49, 50, 52, 57, 57, 56, 53, 52, 49, 56, 50, 56, 55, 48, 55, 53, 57, 48, 56, 49, 57, 52, 54, 56, 48, 53, 54, 53, 56, 56, 57, 56, 53, 50, 50, 56, 52, 57, 48, 57, 51, 52, 92, 92, 92, 34, 44, 92, 92, 92, 34, 118, 114, 95, 112, 114, 105, 109, 101, 92, 92, 92, 34, 58, 110, 117, 108, 108, 125, 44, 92, 92, 92, 34, 110, 111, 110, 99, 101, 92, 92, 92, 34, 58, 92, 92, 92, 34, 49, 49, 53, 52, 53, 52, 57, 56, 56, 50, 51, 54, 53, 52, 49, 54, 56, 48, 51, 50, 57, 54, 55, 49, 51, 92, 92, 92, 34, 44, 92, 92, 92, 34, 109, 97, 115, 116, 101, 114, 95, 115, 101, 99, 114, 101, 116, 95, 110, 97, 109, 101, 92, 92, 92, 34, 58, 92, 92, 92, 34, 109, 97, 105, 110, 92, 92, 92, 34, 125, 92, 34, 44, 92, 34, 99, 114, 101, 100, 95, 100, 101, 102, 95, 105, 100, 92, 34, 58, 92, 34, 50, 104, 111, 113, 118, 99, 119, 117, 112, 82, 84, 85, 78, 107, 88, 110, 54, 65, 114, 89, 122, 115, 58, 51, 58, 67, 76, 58, 49, 55, 54, 54, 92, 34, 44, 92, 34, 116, 105, 100, 92, 34, 58, 92, 34, 99, 67, 97, 110, 72, 110, 112, 70, 65, 68, 92, 34, 44, 92, 34, 116, 111, 95, 100, 105, 100, 92, 34, 58, 92, 34, 66, 110, 82, 88, 102, 56, 121, 68, 77, 85, 119, 71, 121, 90, 86, 68, 107, 83, 69, 78, 101, 113, 92, 34, 44, 92, 34, 102, 114, 111, 109, 95, 100, 105, 100, 92, 34, 58, 92, 34, 71, 120, 116, 110, 71, 78, 54, 121, 112, 90, 89, 103, 69, 113, 99, 102, 116, 83, 81, 70, 110, 67, 92, 34, 44, 92, 34, 118, 101, 114, 115, 105, 111, 110, 92, 34, 58, 92, 34, 48, 46, 49, 92, 34, 44, 92, 34, 109, 105, 100, 92, 34, 58, 92, 34, 92, 34, 125, 34, 44, 34, 108, 105, 98, 105, 110, 100, 121, 95, 99, 114, 101, 100, 95, 114, 101, 113, 95, 109, 101, 116, 97, 34, 58, 34, 34, 44, 34, 99, 114, 101, 100, 95, 100, 101, 102, 95, 105, 100, 34, 58, 34, 50, 104, 111, 113, 118, 99, 119, 117, 112, 82, 84, 85, 78, 107, 88, 110, 54, 65, 114, 89, 122, 115, 58, 51, 58, 67, 76, 58, 49, 55, 54, 54, 34, 44, 34, 116, 105, 100, 34, 58, 34, 34, 44, 34, 116, 111, 95, 100, 105, 100, 34, 58, 34, 34, 44, 34, 102, 114, 111, 109, 95, 100, 105, 100, 34, 58, 34, 56, 88, 70, 104, 56, 121, 66, 122, 114, 112, 74, 81, 109, 78, 121, 90, 122, 103, 111, 84, 113, 66, 34, 44, 34, 118, 101, 114, 115, 105, 111, 110, 34, 58, 34, 48, 46, 49, 34, 44, 34, 109, 105, 100, 34, 58, 34, 34, 125, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 87, 86, 115, 87, 86, 104, 56, 110, 76, 57, 54, 66, 69, 51, 84, 51, 113, 119, 97, 67, 100, 53, 204, 163, 117, 105, 100, 204, 167, 109, 109, 105, 51, 121, 122, 101, 204, 164, 116, 121, 112, 101, 204, 168, 99, 108, 97, 105, 109, 82, 101, 113, 204, 168, 114, 101, 102, 77, 115, 103, 73, 100, 204, 192, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 145, 204, 131, 204, 162, 116, 111, 204, 182, 51, 88, 107, 57, 118, 120, 75, 57, 106, 101, 105, 113, 86, 97, 67, 80, 114, 69, 81, 56, 98, 103, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 167, 77, 68, 83, 45, 49, 48, 49, 204, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 204, 189, 50, 48, 49, 55, 45, 49, 50, 45, 49, 52, 84, 48, 51, 58, 51, 53, 58, 50, 48, 46, 52, 52, 52, 90, 91, 85, 84, 67, 93]; pub const UPDATE_PROOF_RESPONSE: &'static [u8; 293] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 249, 208, 130, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 164, 77, 83, 71, 83, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48, 208, 164, 109, 115, 103, 115, 208, 145, 208, 135, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 166, 77, 83, 45, 49, 48, 52, 208, 167, 112, 97, 121, 108, 111, 97, 100, 208, 144, 208, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 208, 182, 78, 118, 74, 111, 56, 100, 102, 74, 78, 55, 67, 100, 78, 122, 105, 113, 53, 77, 56, 103, 68, 119, 208, 163, 117, 105, 100, 208, 167, 109, 103, 117, 119, 111, 100, 98, 208, 164, 116, 121, 112, 101, 208, 168, 112, 114, 111, 111, 102, 82, 101, 113, 208, 168, 114, 101, 102, 77, 115, 103, 73, 100, 208, 167, 121, 122, 102, 107, 110, 100, 100, 208, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 208, 145, 208, 131, 208, 162, 116, 111, 208, 182, 50, 110, 103, 77, 81, 103, 57, 100, 67, 82, 86, 50, 66, 100, 89, 54, 116, 65, 118, 57, 104, 76, 208, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 208, 167, 77, 68, 83, 45, 49, 48, 50, 208, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 208, 189, 50, 48, 49, 56, 45, 48, 49, 45, 48, 53, 84, 50, 48, 58, 52, 54, 58, 48, 50, 46, 57, 52, 51, 90, 91, 85, 84, 67, 93]; pub const PROOF_RESPONSE: &'static [u8; 18153] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 70, 166, 204, 130, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 164, 77, 83, 71, 83, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 164, 109, 115, 103, 115, 204, 145, 204, 135, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 166, 77, 83, 45, 49, 48, 51, 204, 167, 112, 97, 121, 108, 111, 97, 100, 204, 220, 69, 204, 170, 204, 208, 204, 130, 204, 208, 204, 165, 64, 116, 121, 112, 101, 204, 208, 204, 131, 204, 208, 204, 164, 110, 97, 109, 101, 204, 208, 204, 165, 80, 82, 79, 79, 70, 204, 208, 204, 163, 118, 101, 114, 204, 208, 204, 163, 49, 46, 48, 204, 208, 204, 163, 102, 109, 116, 204, 208, 204, 164, 106, 115, 111, 110, 204, 208, 204, 164, 64, 109, 115, 103, 204, 208, 204, 218, 69, 126, 123, 34, 118, 101, 114, 115, 105, 111, 110, 34, 58, 110, 117, 108, 108, 44, 34, 116, 111, 95, 100, 105, 100, 34, 58, 110, 117, 108, 108, 44, 34, 102, 114, 111, 109, 95, 100, 105, 100, 34, 58, 34, 50, 104, 111, 113, 118, 99, 119, 117, 112, 82, 84, 85, 78, 107, 88, 110, 54, 65, 114, 89, 122, 115, 34, 44, 34, 112, 114, 111, 111, 102, 95, 114, 101, 113, 117, 101, 115, 116, 95, 105, 100, 34, 58, 110, 117, 108, 108, 44, 34, 108, 105, 98, 105, 110, 100, 121, 95, 112, 114, 111, 111, 102, 34, 58, 34, 123, 92, 34, 112, 114, 111, 111, 102, 92, 34, 58, 123, 92, 34, 112, 114, 111, 111, 102, 115, 92, 34, 58, 91, 123, 92, 34, 112, 114, 105, 109, 97, 114, 121, 95, 112, 114, 111, 111, 102, 92, 34, 58, 123, 92, 34, 101, 113, 95, 112, 114, 111, 111, 102, 92, 34, 58, 123, 92, 34, 114, 101, 118, 101, 97, 108, 101, 100, 95, 97, 116, 116, 114, 115, 92, 34, 58, 123, 92, 34, 110, 97, 109, 101, 92, 34, 58, 92, 34, 49, 49, 51, 57, 52, 56, 49, 55, 49, 54, 52, 53, 55, 52, 56, 56, 54, 57, 48, 49, 55, 50, 50, 49, 55, 57, 49, 54, 50, 55, 56, 49, 48, 51, 51, 51, 53, 92, 34, 125, 44, 92, 34, 97, 95, 112, 114, 105, 109, 101, 92, 34, 58, 92, 34, 53, 51, 51, 49, 50, 56, 50, 57, 57, 52, 50, 54, 51, 53, 48, 51, 51, 50, 49, 51, 53, 52, 55, 55, 56, 53, 54, 54, 51, 48, 51, 50, 53, 50, 55, 55, 48, 48, 54, 54, 55, 53, 54, 57, 57, 55, 55, 55, 53, 56, 49, 53, 50, 55, 48, 50, 48, 54, 53, 57, 49, 49, 55, 50, 54, 48, 52, 48, 55, 56, 48, 53, 57, 48, 50, 51, 55, 56, 55, 48, 52, 56, 50, 54, 49, 52, 54, 52, 50, 53, 50, 48, 55, 52, 51, 57, 55, 51, 48, 52, 54, 56, 51, 49, 55, 53, 49, 51, 57, 55, 50, 50, 54, 51, 51, 48, 54, 50, 57, 52, 48, 50, 50, 56, 51, 57, 49, 53, 50, 57, 56, 48, 49, 48, 55, 53, 53, 50, 56, 54, 51, 53, 57, 48, 52, 50, 50, 49, 52, 50, 53, 52, 49, 56, 54, 48, 55, 51, 49, 51, 49, 50, 57, 51, 50, 53, 54, 54, 49, 55, 53, 50, 50, 50, 52, 51, 55, 56, 56, 56, 54, 57, 48, 54, 55, 48, 54, 50, 52, 53, 57, 48, 52, 56, 56, 49, 57, 48, 52, 57, 48, 57, 51, 48, 48, 48, 56, 54, 49, 55, 48, 54, 57, 55, 54, 53, 53, 57, 52, 53, 52, 51, 53, 51, 48, 53, 52, 52, 49, 53, 50, 50, 52, 50, 49, 55, 53, 52, 49, 53, 48, 56, 50, 53, 49, 56, 50, 56, 57, 48, 49, 50, 51, 48, 51, 49, 53, 55, 50, 55, 52, 53, 50, 49, 57, 52, 57, 48, 54, 55, 48, 55, 49, 52, 54, 49, 56, 50, 48, 51, 56, 50, 57, 50, 55, 55, 52, 56, 51, 55, 56, 55, 52, 49, 53, 56, 49, 50, 51, 57, 48, 53, 49, 51, 50, 50, 48, 52, 55, 53, 52, 52, 57, 52, 48, 57, 57, 57, 53, 55, 57, 51, 53, 56, 57, 51, 55, 49, 48, 51, 49, 49, 51, 48, 55, 54, 49, 49, 49, 56, 53, 53, 53, 54, 50, 53, 51, 53, 54, 50, 55, 51, 49, 51, 48, 50, 48, 56, 53, 54, 52, 51, 49, 57, 48, 51, 56, 48, 48, 57, 51, 55, 57, 54, 55, 49, 50, 49, 53, 48, 48, 55, 51, 56, 54, 51, 50, 51, 54, 51, 55, 52, 54, 55, 49, 55, 54, 54, 54, 56, 51, 56, 51, 48, 49, 49, 54, 54, 52, 51, 54, 52, 50, 56, 49, 52, 53, 49, 49, 49, 52, 49, 51, 56, 55, 50, 48, 50, 50, 55, 54, 54, 55, 55, 49, 55, 57, 57, 55, 56, 55, 55, 56, 48, 50, 51, 56, 54, 56, 49, 57, 49, 54, 50, 48, 56, 48, 51, 48, 51, 49, 53, 53, 53, 53, 55, 50, 48, 57, 54, 53, 48, 53, 52, 57, 51, 54, 57, 53, 52, 53, 56, 56, 52, 56, 51, 51, 54, 55, 53, 48, 48, 55, 50, 56, 55, 50, 56, 50, 52, 48, 56, 50, 57, 52, 54, 49, 54, 54, 54, 50, 52, 48, 50, 53, 56, 50, 54, 52, 48, 50, 49, 56, 53, 48, 55, 57, 48, 55, 56, 57, 53, 53, 53, 55, 49, 54, 52, 48, 54, 52, 51, 55, 56, 49, 54, 52, 52, 54, 48, 56, 53, 54, 57, 50, 56, 57, 55, 51, 55, 50, 52, 55, 50, 51, 57, 57, 52, 52, 50, 57, 51, 51, 55, 52, 52, 57, 53, 52, 54, 49, 50, 50, 53, 53, 48, 57, 48, 50, 57, 51, 57, 55, 56, 54, 55, 57, 50, 57, 50, 48, 57, 50, 57, 52, 48, 50, 52, 50, 49, 51, 55, 48, 57, 55, 56, 56, 92, 34, 44, 92, 34, 101, 92, 34, 58, 92, 34, 50, 48, 54, 56, 50, 51, 53, 57, 54, 52, 51, 52, 49, 50, 54, 56, 50, 50, 57, 53, 56, 51, 49, 48, 50, 55, 51, 54, 49, 56, 57, 48, 53, 55, 53, 52, 55, 53, 56, 51, 56, 53, 50, 51, 54, 52, 56, 55, 52, 49, 52, 50, 49, 53, 53, 49, 57, 48, 51, 48, 56, 48, 53, 57, 53, 49, 56, 56, 49, 56, 49, 56, 51, 51, 51, 51, 51, 53, 55, 54, 49, 56, 50, 57, 48, 55, 49, 48, 56, 50, 55, 48, 52, 51, 49, 49, 52, 50, 50, 55, 53, 56, 56, 51, 52, 50, 52, 53, 54, 52, 56, 51, 51, 50, 56, 51, 55, 51, 48, 55, 55, 52, 52, 48, 48, 54, 56, 55, 55, 54, 54, 55, 56, 51, 57, 51, 55, 92, 34, 44, 92, 34, 118, 92, 34, 58, 92, 34, 57, 55, 55, 57, 48, 52, 54, 51, 51, 54, 49, 54, 56, 51, 49, 50, 53, 56, 50, 53, 56, 50, 48, 56, 55, 57, 50, 48, 52, 52, 53, 53, 50, 53, 53, 56, 51, 49, 51, 48, 51, 49, 50, 50, 53, 50, 55, 52, 48, 56, 48, 55, 56, 54, 51, 54, 57, 50, 54, 48, 53, 57, 49, 51, 55, 57, 49, 55, 54, 51, 53, 54, 54, 57, 51, 54, 57, 57, 53, 52, 55, 53, 52, 54, 51, 53, 55, 53, 54, 52, 51, 50, 48, 56, 57, 52, 55, 56, 50, 53, 51, 56, 56, 57, 57, 57, 49, 54, 56, 49, 57, 49, 48, 54, 54, 49, 53, 56, 54, 49, 56, 55, 48, 49, 56, 52, 52, 48, 54, 49, 56, 48, 57, 48, 50, 53, 52, 57, 51, 52, 54, 49, 50, 56, 48, 48, 51, 53, 50, 49, 49, 55, 50, 55, 49, 53, 48, 56, 57, 49, 48, 54, 52, 48, 50, 50, 49, 48, 54, 50, 53, 51, 56, 48, 55, 48, 50, 57, 56, 55, 56, 54, 50, 50, 52, 49, 53, 56, 55, 53, 56, 53, 49, 53, 57, 56, 48, 57, 56, 54, 48, 48, 54, 55, 52, 49, 54, 50, 55, 48, 56, 56, 49, 50, 50, 54, 56, 52, 52, 53, 50, 50, 57, 48, 53, 51, 48, 49, 49, 50, 56, 50, 51, 55, 49, 51, 57, 49, 53, 52, 51, 53, 49, 55, 56, 56, 55, 53, 54, 48, 48, 54, 55, 52, 52, 51, 54, 49, 55, 56, 48, 48, 56, 55, 51, 49, 50, 50, 56, 49, 49, 52, 53, 49, 52, 57, 52, 55, 50, 57, 49, 50, 53, 50, 50, 55, 48, 50, 55, 56, 56, 57, 51, 50, 48, 56, 53, 52, 51, 54, 51, 54, 52, 50, 53, 54, 52, 55, 51, 55, 57, 57, 56, 51, 48, 52, 50, 48, 56, 53, 53, 49, 53, 55, 57, 51, 52, 54, 54, 56, 50, 54, 54, 57, 50, 52, 56, 55, 53, 56, 48, 49, 50, 49, 54, 49, 49, 57, 49, 50, 48, 48, 48, 52, 51, 51, 53, 54, 57, 53, 57, 57, 49, 54, 50, 49, 50, 56, 54, 50, 52, 48, 52, 56, 55, 48, 51, 51, 55, 56, 55, 56, 53, 51, 50, 54, 56, 48, 49, 48, 51, 54, 51, 50, 54, 57, 49, 53, 49, 56, 51, 49, 54, 50, 48, 52, 48, 50, 50, 54, 50, 50, 54, 54, 54, 48, 50, 52, 56, 51, 49, 54, 57, 56, 48, 52, 53, 49, 52, 52, 55, 55, 55, 48, 56, 55, 50, 52, 50, 50, 55, 53, 52, 53, 52, 56, 49, 53, 56, 50, 52, 55, 49, 49, 54, 48, 48, 50, 51, 54, 49, 49, 54, 52, 57, 48, 56, 53, 51, 56, 51, 50, 50, 49, 48, 53, 51, 54, 51, 57, 54, 53, 50, 51, 53, 53, 48, 50, 55, 57, 50, 56, 49, 56, 57, 55, 55, 57, 54, 55, 56, 48, 57, 54, 53, 54, 56, 48, 54, 54, 52, 56, 50, 53, 54, 55, 55, 54, 51, 53, 55, 49, 54, 50, 52, 57, 57, 52, 57, 55, 49, 53, 54, 52, 48, 55, 48, 57, 57, 56, 52, 52, 51, 49, 50, 56, 51, 50, 50, 54, 55, 52, 51, 49, 49, 54, 48, 51, 48, 52, 52, 50, 48, 55, 54, 55, 54, 57, 49, 53, 48, 48, 57, 54, 51, 49, 48, 49, 52, 55, 55, 56, 50, 55, 50, 49, 51, 51, 56, 48, 52, 48, 56, 54, 54, 48, 52, 52, 57, 57, 53, 54, 50, 57, 56, 50, 55, 52, 51, 54, 56, 53, 50, 55, 54, 55, 49, 48, 54, 48, 51, 57, 56, 50, 51, 52, 55, 50, 48, 52, 50, 48, 48, 57, 51, 53, 48, 56, 54, 51, 50, 52, 52, 50, 55, 51, 57, 50, 49, 57, 51, 49, 49, 50, 48, 53, 49, 57, 51, 52, 53, 56, 53, 48, 50, 53, 52, 48, 57, 51, 57, 54, 54, 54, 57, 55, 57, 48, 48, 48, 55, 53, 54, 52, 52, 53, 48, 57, 56, 53, 49, 52, 50, 50, 48, 55, 50, 49, 57, 51, 49, 49, 54, 51, 50, 52, 54, 57, 57, 55, 54, 48, 48, 56, 56, 48, 52, 50, 54, 50, 53, 54, 49, 49, 48, 50, 51, 57, 52, 52, 54, 50, 54, 55, 55, 51, 56, 49, 53, 55, 53, 49, 49, 51, 55, 52, 49, 51, 50, 49, 53, 48, 53, 54, 51, 51, 49, 57, 55, 54, 52, 49, 55, 53, 52, 52, 48, 53, 48, 57, 48, 57, 50, 50, 57, 54, 50, 48, 52, 48, 49, 48, 48, 51, 54, 57, 56, 54, 57, 55, 54, 51, 51, 54, 51, 51, 57, 53, 51, 48, 57, 55, 50, 50, 48, 57, 52, 50, 49, 52, 48, 57, 56, 54, 53, 55, 48, 48, 55, 50, 57, 50, 53, 50, 49, 56, 57, 50, 57, 52, 49, 56, 49, 51, 53, 50, 53, 57, 54, 53, 53, 53, 55, 51, 56, 55, 49, 56, 52, 51, 48, 54, 48, 50, 57, 50, 52, 53, 56, 49, 48, 53, 55, 56, 54, 56, 53, 49, 51, 54, 49, 56, 52, 54, 56, 50, 52, 54, 50, 50, 53, 48, 48, 56, 55, 55, 56, 48, 51, 49, 50, 51, 50, 50, 57, 54, 57, 52, 55, 56, 54, 55, 57, 48, 56, 48, 53, 56, 53, 54, 50, 53, 48, 50, 49, 53, 50, 48, 50, 49, 48, 92, 34, 44, 92, 34, 109, 92, 34, 58, 123, 92, 34, 104, 101, 105, 103, 104, 116, 92, 34, 58, 92, 34, 49, 50, 50, 54, 51, 50, 56, 57, 52, 49, 53, 56, 51, 50, 54, 56, 49, 50, 50, 50, 49, 57, 49, 50, 51, 49, 51, 48, 55, 55, 52, 50, 48, 48, 53, 55, 53, 55, 54, 50, 48, 49, 48, 54, 52, 52, 57, 51, 48, 53, 55, 49, 55, 48, 52, 55, 55, 56, 52, 54, 55, 48, 55, 57, 50, 55, 56, 56, 56, 55, 53, 54, 57, 53, 53, 51, 57, 55, 53, 51, 51, 54, 52, 55, 56, 49, 51, 55, 53, 52, 57, 50, 54, 55, 49, 52, 53, 52, 50, 56, 55, 55, 57, 51, 55, 54, 54, 49, 56, 52, 52, 52, 51, 51, 48, 50, 51, 52, 54, 57, 50, 50, 48, 52, 50, 53, 50, 49, 49, 56, 56, 57, 56, 48, 50, 54, 55, 48, 50, 49, 51, 48, 54, 57, 49, 50, 52, 51, 57, 56, 51, 55, 49, 56, 52, 57, 52, 50, 52, 54, 51, 56, 51, 49, 51, 52, 52, 50, 54, 55, 53, 49, 51, 49, 49, 52, 53, 51, 57, 92, 34, 44, 92, 34, 115, 101, 120, 92, 34, 58, 92, 34, 49, 53, 48, 51, 55, 49, 53, 53, 52, 53, 52, 48, 57, 52, 52, 53, 57, 53, 50, 55, 55, 51, 49, 52, 51, 52, 50, 48, 54, 52, 56, 49, 49, 49, 52, 51, 49, 57, 50, 52, 48, 53, 50, 49, 53, 48, 51, 55, 57, 52, 56, 50, 55, 56, 53, 50, 48, 55, 48, 55, 48, 49, 56, 48, 50, 51, 48, 55, 49, 54, 56, 50, 52, 49, 57, 52, 57, 57, 52, 54, 57, 50, 51, 48, 56, 51, 54, 54, 52, 55, 56, 52, 51, 53, 53, 50, 55, 52, 55, 53, 51, 50, 48, 53, 50, 57, 55, 49, 50, 50, 51, 56, 54, 55, 57, 49, 54, 54, 55, 53, 50, 54, 55, 53, 55, 56, 51, 57, 48, 48, 49, 48, 56, 52, 49, 49, 52, 52, 52, 54, 50, 57, 49, 56, 53, 53, 51, 50, 53, 51, 56, 52, 56, 56, 49, 55, 53, 53, 52, 55, 54, 49, 48, 56, 57, 48, 51, 48, 55, 54, 54, 52, 52, 49, 48, 50, 53, 50, 52, 92, 34, 44, 92, 34, 97, 103, 101, 92, 34, 58, 92, 34, 49, 52, 53, 48, 49, 56, 55, 50, 52, 48, 57, 57, 52, 48, 51, 50, 55, 57, 57, 56, 52, 49, 50, 56, 57, 51, 49, 53, 55, 48, 56, 49, 53, 49, 50, 51, 54, 51, 48, 56, 57, 55, 57, 48, 55, 53, 52, 48, 55, 57, 57, 52, 49, 54, 57, 57, 52, 51, 55, 53, 57, 52, 56, 53, 49, 52, 54, 55, 54, 54, 53, 48, 53, 57, 56, 48, 51, 54, 57, 51, 53, 50, 52, 49, 48, 48, 48, 55, 52, 52, 50, 56, 53, 52, 52, 57, 52, 52, 48, 56, 52, 53, 55, 48, 50, 49, 52, 49, 51, 56, 56, 57, 55, 49, 56, 52, 55, 50, 57, 55, 53, 56, 55, 50, 54, 54, 49, 51, 48, 55, 49, 54, 53, 48, 51, 49, 52, 52, 56, 48, 53, 55, 57, 48, 55, 52, 53, 53, 54, 55, 48, 48, 50, 48, 48, 51, 54, 54, 54, 56, 56, 56, 57, 53, 53, 54, 53, 49, 52, 53, 51, 56, 50, 51, 54, 48, 54, 57, 56, 92, 34, 125, 44, 92, 34, 109, 49, 92, 34, 58, 92, 34, 53, 49, 49, 49, 54, 49, 52, 52, 57, 50, 55, 51, 49, 50, 50, 50, 57, 51, 51, 54, 56, 50, 50, 51, 56, 54, 48, 54, 57, 56, 54, 55, 52, 50, 48, 49, 50, 54, 52, 57, 49, 56, 54, 56, 51, 50, 56, 48, 50, 54, 57, 53, 52, 51, 54, 50, 57, 51, 53, 56, 51, 56, 55, 56, 51, 49, 57, 57, 57, 50, 56, 56, 55, 57, 55, 49, 53, 56, 49, 49, 56, 56, 56, 55, 54, 56, 48, 54, 55, 53, 57, 52, 52, 55, 53, 57, 52, 51, 50, 54, 49, 55, 51, 57, 53, 55, 51, 54, 53, 56, 55, 57, 49, 49, 51, 56, 52, 56, 49, 52, 53, 57, 51, 49, 51, 51, 54, 56, 56, 57, 56, 57, 50, 51, 50, 53, 54, 50, 50, 53, 57, 48, 50, 56, 57, 49, 51, 51, 53, 56, 49, 54, 57, 52, 54, 57, 57, 51, 51, 53, 50, 49, 53, 56, 53, 56, 56, 48, 53, 49, 48, 53, 48, 54, 52, 51, 51, 49, 92, 34, 44, 92, 34, 109, 50, 92, 34, 58, 92, 34, 49, 53, 52, 53, 53, 54, 54, 50, 50, 53, 52, 51, 54, 54, 52, 53, 55, 53, 48, 51, 56, 49, 57, 55, 48, 49, 51, 52, 54, 53, 56, 48, 48, 56, 51, 55, 55, 52, 48, 51, 57, 52, 55, 53, 56, 53, 53, 55, 53, 56, 48, 52, 57, 54, 49, 53, 57, 52, 50, 55, 54, 48, 54, 54, 56, 49, 54, 57, 48, 49, 49, 56, 57, 52, 54, 54, 50, 55, 56, 48, 50, 48, 50, 56, 51, 54, 51, 49, 57, 52, 51, 51, 56, 54, 51, 50, 48, 53, 57, 53, 50, 49, 53, 50, 56, 55, 57, 57, 53, 57, 57, 57, 56, 52, 51, 52, 55, 50, 51, 49, 48, 54, 53, 51, 50, 55, 55, 57, 50, 49, 53, 52, 55, 55, 52, 52, 57, 55, 56, 49, 53, 51, 52, 51, 49, 56, 57, 57, 54, 57, 55, 52, 48, 48, 49, 53, 57, 57, 55, 49, 52, 57, 54, 54, 51, 57, 54, 56, 53, 54, 51, 55, 52, 53, 56, 49, 52, 56, 54, 92, 34, 125, 44, 92, 34, 103, 101, 95, 112, 114, 111, 111, 102, 115, 92, 34, 58, 91, 123, 92, 34, 117, 92, 34, 58, 123, 92, 34, 51, 92, 34, 58, 92, 34, 49, 51, 51, 51, 56, 55, 57, 55, 52, 49, 57, 48, 49, 48, 56, 49, 57, 52, 51, 48, 51, 49, 51, 49, 53, 56, 52, 49, 52, 50, 51, 57, 53, 56, 56, 57, 49, 49, 53, 51, 51, 55, 48, 50, 57, 57, 56, 55, 49, 49, 49, 49, 51, 54, 51, 54, 48, 54, 53, 55, 56, 54, 57, 55, 52, 52, 55, 53, 53, 49, 54, 56, 56, 48, 50, 56, 53, 57, 48, 53, 54, 57, 51, 56, 49, 50, 50, 53, 53, 49, 50, 57, 56, 54, 57, 53, 57, 50, 57, 55, 50, 51, 49, 48, 49, 49, 56, 50, 51, 52, 53, 52, 50, 52, 54, 53, 49, 57, 48, 50, 48, 50, 48, 51, 49, 52, 53, 56, 52, 55, 51, 52, 49, 54, 57, 53, 53, 54, 56, 48, 48, 56, 51, 55, 54, 50, 49, 54, 49, 55, 53, 53, 48, 57, 55, 51, 48, 56, 48, 49, 55, 54, 49, 51, 55, 51, 56, 52, 48, 57, 48, 49, 52, 52, 53, 48, 52, 49, 50, 92, 34, 44, 92, 34, 49, 92, 34, 58, 92, 34, 55, 57, 57, 52, 57, 50, 53, 52, 50, 48, 55, 53, 48, 52, 50, 52, 54, 48, 52, 54, 56, 55, 52, 51, 52, 50, 51, 50, 50, 52, 52, 52, 57, 53, 50, 54, 52, 48, 52, 50, 57, 57, 57, 51, 48, 53, 55, 48, 57, 48, 54, 53, 48, 48, 54, 48, 55, 57, 49, 51, 57, 52, 53, 55, 49, 54, 57, 52, 52, 53, 48, 50, 56, 48, 50, 48, 52, 53, 51, 54, 53, 56, 57, 53, 57, 55, 53, 49, 49, 56, 50, 48, 54, 53, 56, 53, 52, 51, 49, 55, 54, 57, 55, 54, 48, 55, 49, 56, 48, 55, 55, 50, 57, 56, 50, 52, 55, 49, 50, 57, 54, 53, 51, 52, 54, 50, 49, 52, 54, 55, 48, 53, 48, 56, 51, 49, 57, 57, 52, 56, 54, 54, 52, 48, 51, 50, 51, 51, 56, 56, 50, 56, 57, 51, 53, 48, 51, 55, 51, 53, 48, 50, 56, 51, 50, 51, 51, 54, 50, 50, 48, 55, 52, 55, 56, 49, 56, 92, 34, 44, 92, 34, 50, 92, 34, 58, 92, 34, 49, 52, 49, 48, 54, 54, 57, 55, 55, 53, 54, 54, 51, 49, 57, 52, 53, 48, 54, 48, 50, 57, 52, 50, 49, 54, 56, 57, 55, 50, 53, 49, 54, 48, 53, 50, 52, 51, 49, 51, 53, 51, 49, 48, 49, 56, 52, 53, 49, 50, 48, 52, 57, 53, 54, 52, 51, 50, 49, 52, 57, 55, 57, 57, 53, 53, 57, 52, 56, 49, 57, 55, 48, 56, 49, 49, 57, 57, 50, 53, 57, 56, 54, 51, 52, 54, 52, 57, 51, 54, 49, 56, 52, 57, 49, 57, 50, 49, 52, 54, 53, 55, 56, 53, 52, 56, 54, 55, 53, 56, 57, 49, 49, 54, 50, 57, 56, 55, 51, 55, 49, 55, 51, 54, 52, 50, 51, 51, 52, 56, 48, 48, 50, 55, 49, 52, 56, 53, 50, 57, 57, 55, 53, 54, 51, 56, 54, 51, 54, 55, 54, 53, 54, 52, 50, 50, 56, 57, 51, 57, 57, 54, 51, 48, 50, 55, 48, 54, 55, 55, 57, 52, 56, 55, 52, 56, 55, 49, 92, 34, 44, 92, 34, 48, 92, 34, 58, 92, 34, 50, 50, 56, 52, 57, 48, 56, 53, 52, 50, 52, 52, 55, 50, 56, 53, 53, 51, 49, 54, 52, 50, 50, 57, 51, 50, 51, 53, 50, 48, 53, 55, 54, 52, 55, 49, 57, 53, 57, 54, 49, 56, 57, 48, 57, 54, 52, 48, 49, 55, 53, 55, 55, 55, 50, 57, 57, 48, 54, 52, 56, 50, 52, 54, 56, 49, 49, 55, 52, 49, 56, 57, 57, 55, 52, 50, 48, 50, 55, 48, 50, 49, 55, 54, 48, 56, 55, 51, 57, 54, 50, 55, 53, 57, 56, 48, 56, 56, 50, 54, 55, 54, 55, 48, 57, 53, 51, 49, 56, 49, 53, 51, 57, 56, 51, 49, 49, 55, 52, 55, 56, 54, 48, 54, 55, 51, 51, 53, 53, 49, 56, 56, 50, 50, 56, 55, 52, 52, 51, 52, 49, 54, 57, 48, 53, 51, 54, 57, 50, 49, 50, 56, 51, 48, 52, 48, 50, 54, 50, 53, 48, 49, 57, 53, 50, 48, 51, 49, 54, 48, 48, 48, 54, 49, 57, 49, 50, 50, 92, 34, 125, 44, 92, 34, 114, 92, 34, 58, 123, 92, 34, 68, 69, 76, 84, 65, 92, 34, 58, 92, 34, 52, 52, 54, 52, 49, 55, 51, 55, 56, 54, 56, 54, 54, 56, 52, 53, 49, 49, 50, 51, 52, 48, 50, 54, 55, 55, 51, 51, 53, 53, 55, 48, 56, 49, 50, 53, 50, 51, 57, 56, 50, 52, 54, 51, 50, 54, 51, 52, 52, 51, 55, 54, 57, 50, 55, 55, 55, 49, 57, 57, 50, 48, 55, 53, 49, 48, 53, 57, 51, 55, 55, 53, 55, 54, 57, 54, 54, 49, 51, 50, 48, 53, 49, 55, 53, 48, 53, 52, 57, 53, 55, 56, 50, 56, 48, 56, 49, 50, 51, 57, 48, 49, 57, 51, 49, 53, 48, 57, 57, 54, 54, 48, 50, 52, 54, 51, 57, 48, 51, 57, 48, 51, 56, 49, 48, 56, 57, 57, 55, 56, 52, 57, 50, 51, 57, 52, 53, 55, 48, 48, 54, 54, 53, 48, 57, 49, 48, 49, 54, 54, 53, 55, 57, 53, 50, 49, 49, 56, 56, 49, 52, 53, 56, 48, 52, 53, 57, 50, 56, 57, 49, 49, 49, 52, 52, 50, 57, 53, 53, 49, 56, 56, 52, 49, 56, 56, 49, 54, 51, 49, 54, 56, 50, 48, 50, 50, 52, 48, 55, 49, 54, 57, 51, 49, 55, 49, 48, 52, 54, 55, 49, 52, 51, 57, 53, 50, 49, 56, 52, 57, 55, 56, 56, 57, 49, 54, 57, 52, 57, 57, 56, 51, 53, 57, 53, 48, 51, 49, 54, 49, 50, 49, 52, 54, 50, 52, 53, 54, 49, 56, 50, 53, 56, 51, 51, 57, 48, 56, 48, 55, 51, 55, 49, 49, 51, 57, 49, 54, 51, 55, 49, 51, 57, 50, 51, 57, 57, 48, 48, 52, 51, 51, 55, 55, 51, 55, 51, 54, 56, 56, 54, 51, 57, 56, 50, 52, 54, 53, 49, 54, 55, 54, 53, 56, 52, 52, 55, 57, 56, 53, 55, 52, 50, 54, 48, 48, 51, 56, 55, 50, 48, 54, 52, 53, 50, 56, 50, 56, 55, 52, 56, 52, 55, 57, 56, 56, 48, 50, 52, 55, 53, 55, 50, 54, 57, 48, 50, 53, 48, 54, 54, 56, 52, 57, 52, 56, 55, 49, 50, 48, 55, 54, 57, 48, 51, 51, 56, 51, 53, 50, 56, 52, 56, 57, 50, 54, 56, 52, 56, 50, 55, 57, 55, 52, 53, 57, 48, 56, 52, 55, 50, 48, 50, 57, 56, 48, 57, 50, 56, 51, 49, 56, 50, 56, 52, 56, 48, 50, 50, 57, 54, 49, 56, 52, 56, 55, 57, 52, 51, 48, 50, 54, 50, 51, 53, 50, 56, 51, 56, 53, 51, 55, 57, 57, 53, 51, 50, 57, 53, 54, 56, 51, 52, 55, 55, 48, 52, 52, 52, 51, 48, 51, 50, 51, 53, 56, 52, 51, 54, 52, 48, 49, 57, 50, 53, 57, 48, 55, 48, 48, 54, 50, 48, 51, 56, 48, 48, 55, 56, 49, 56, 48, 53, 51, 48, 50, 52, 49, 49, 50, 57, 48, 52, 49, 51, 55, 57, 55, 53, 52, 55, 55, 48, 51, 54, 52, 51, 54, 56, 48, 53, 50, 51, 56, 49, 54, 52, 53, 48, 57, 54, 52, 57, 48, 55, 50, 54, 57, 51, 54, 53, 55, 52, 48, 51, 51, 51, 57, 53, 52, 55, 54, 55, 50, 53, 48, 56, 55, 50, 48, 48, 53, 48, 56, 48, 51, 56, 51, 55, 56, 54, 57, 54, 50, 56, 51, 54, 51, 52, 57, 52, 51, 55, 57, 55, 50, 50, 51, 51, 49, 48, 50, 54, 56, 54, 48, 48, 55, 48, 55, 48, 49, 53, 49, 57, 49, 51, 50, 51, 49, 52, 48, 53, 54, 55, 51, 48, 53, 51, 49, 49, 49, 51, 53, 55, 50, 53, 55, 53, 52, 49, 48, 55, 48, 55, 57, 52, 49, 57, 48, 51, 52, 54, 56, 53, 52, 57, 52, 54, 49, 53, 53, 51, 52, 56, 48, 48, 48, 57, 51, 56, 55, 57, 52, 49, 54, 56, 51, 49, 51, 53, 53, 53, 48, 53, 52, 57, 51, 53, 48, 57, 55, 53, 49, 49, 50, 56, 48, 48, 53, 53, 56, 53, 55, 51, 53, 55, 55, 49, 52, 48, 52, 52, 53, 55, 53, 48, 57, 57, 55, 49, 51, 54, 48, 52, 53, 49, 52, 56, 54, 56, 48, 50, 54, 50, 49, 51, 92, 34, 44, 92, 34, 48, 92, 34, 58, 92, 34, 55, 54, 51, 50, 51, 52, 55, 49, 50, 56, 55, 53, 51, 55, 55, 50, 53, 55, 52, 53, 48, 53, 56, 57, 54, 56, 50, 52, 51, 57, 52, 54, 53, 51, 54, 57, 50, 51, 49, 51, 50, 48, 53, 57, 53, 50, 51, 56, 51, 50, 50, 55, 48, 49, 52, 51, 48, 56, 56, 52, 55, 54, 55, 52, 49, 53, 51, 48, 57, 51, 49, 55, 57, 52, 50, 57, 50, 51, 54, 50, 53, 57, 55, 56, 49, 56, 53, 57, 53, 50, 52, 54, 48, 50, 51, 50, 49, 53, 54, 52, 54, 54, 56, 53, 57, 54, 48, 56, 54, 48, 53, 52, 51, 57, 56, 53, 54, 54, 57, 48, 48, 51, 54, 51, 55, 51, 53, 54, 54, 53, 51, 57, 54, 56, 53, 56, 48, 55, 50, 54, 48, 49, 50, 56, 51, 49, 50, 55, 50, 57, 53, 50, 55, 50, 54, 54, 52, 56, 48, 57, 55, 51, 55, 57, 55, 48, 55, 57, 55, 56, 48, 50, 53, 56, 50, 55, 51, 50, 52, 52, 54, 49, 51, 55, 48, 55, 52, 54, 48, 56, 48, 51, 48, 50, 51, 51, 52, 57, 52, 54, 54, 49, 53, 54, 51, 54, 50, 51, 48, 57, 56, 50, 53, 55, 51, 48, 53, 55, 57, 50, 57, 49, 55, 56, 53, 55, 48, 55, 57, 53, 53, 55, 54, 48, 50, 53, 51, 55, 55, 57, 55, 53, 54, 55, 53, 55, 55, 50, 57, 49, 57, 56, 56, 51, 52, 52, 49, 48, 55, 49, 51, 49, 57, 49, 48, 57, 56, 55, 55, 54, 55, 52, 50, 53, 53, 50, 48, 57, 52, 50, 53, 55, 53, 49, 56, 51, 49, 51, 53, 49, 56, 55, 49, 49, 50, 50, 50, 54, 56, 54, 55, 55, 57, 52, 57, 56, 54, 54, 48, 57, 51, 55, 51, 50, 51, 55, 52, 57, 49, 52, 50, 49, 50, 48, 51, 53, 57, 48, 51, 53, 56, 56, 48, 48, 53, 55, 49, 56, 57, 57, 57, 57, 55, 55, 56, 51, 54, 54, 48, 49, 54, 57, 52, 50, 55, 52, 57, 51, 54, 54, 53, 51, 50, 57, 55, 50, 52, 57, 53, 57, 55, 51, 55, 55, 52, 53, 56, 51, 48, 54, 48, 49, 56, 54, 57, 48, 56, 51, 56, 56, 57, 55, 48, 55, 52, 57, 52, 56, 57, 48, 48, 54, 48, 49, 53, 48, 48, 54, 48, 56, 51, 54, 49, 54, 49, 48, 54, 50, 57, 56, 50, 57, 57, 53, 54, 55, 55, 56, 57, 53, 50, 52, 54, 51, 56, 56, 56, 53, 52, 53, 48, 52, 51, 51, 50, 57, 50, 55, 52, 49, 50, 55, 52, 54, 56, 56, 54, 55, 53, 54, 50, 56, 56, 54, 52, 55, 49, 55, 54, 54, 55, 53, 57, 53, 56, 55, 55, 55, 54, 52, 55, 49, 52, 50, 57, 57, 56, 50, 50, 50, 50, 48, 54, 48, 52, 53, 53, 54, 50, 56, 56, 51, 54, 52, 56, 52, 56, 53, 49, 52, 51, 53, 51, 52, 57, 56, 53, 56, 54, 53, 49, 51, 56, 54, 57, 52, 55, 50, 56, 50, 48, 50, 52, 50, 54, 51, 55, 53, 51, 57, 51, 53, 57, 49, 57, 57, 57, 49, 49, 56, 52, 51, 55, 48, 55, 54, 57, 53, 51, 50, 52, 52, 51, 51, 53, 53, 55, 52, 56, 48, 52, 48, 51, 54, 48, 57, 50, 57, 56, 56, 54, 57, 48, 54, 51, 57, 54, 55, 56, 49, 48, 53, 57, 52, 51, 49, 56, 54, 57, 50, 56, 54, 56, 48, 56, 49, 54, 53, 56, 55, 51, 52, 56, 49, 50, 57, 49, 53, 57, 52, 52, 51, 50, 51, 55, 53, 52, 55, 52, 50, 54, 55, 57, 52, 51, 55, 50, 54, 55, 56, 57, 52, 55, 57, 52, 57, 57, 52, 53, 49, 49, 49, 51, 57, 49, 52, 49, 48, 54, 53, 55, 55, 50, 55, 52, 52, 57, 49, 52, 51, 51, 51, 57, 54, 56, 52, 57, 48, 50, 49, 56, 54, 53, 56, 55, 54, 53, 57, 53, 54, 50, 53, 54, 55, 54, 48, 56, 55, 51, 57, 48, 50, 52, 51, 48, 48, 48, 48, 50, 51, 54, 50, 52, 55, 54, 50, 92, 34, 44, 92, 34, 50, 92, 34, 58, 92, 34, 57, 50, 50, 48, 49, 53, 49, 50, 49, 49, 54, 52, 57, 51, 56, 51, 54, 56, 50, 56, 54, 51, 49, 53, 50, 57, 55, 51, 51, 49, 50, 57, 48, 48, 49, 48, 54, 48, 49, 56, 54, 48, 50, 55, 52, 50, 56, 57, 48, 48, 50, 50, 54, 48, 48, 57, 54, 54, 55, 50, 48, 55, 57, 52, 54, 55, 55, 53, 54, 54, 51, 52, 49, 50, 55, 54, 51, 48, 52, 57, 51, 50, 51, 48, 54, 51, 53, 54, 54, 51, 56, 50, 52, 49, 48, 50, 57, 56, 54, 53, 57, 54, 56, 48, 56, 48, 57, 54, 51, 48, 51, 48, 56, 57, 49, 56, 56, 50, 54, 55, 55, 52, 55, 49, 53, 57, 54, 53, 57, 50, 52, 51, 52, 53, 51, 52, 56, 56, 55, 51, 57, 54, 52, 49, 54, 51, 51, 52, 57, 57, 53, 55, 54, 54, 54, 50, 51, 51, 51, 48, 51, 57, 48, 56, 57, 56, 50, 53, 49, 50, 53, 51, 51, 48, 53, 56, 52, 55, 55, 49, 48, 55, 52, 52, 48, 48, 52, 49, 49, 54, 52, 57, 55, 52, 52, 55, 49, 57, 50, 51, 57, 51, 50, 53, 50, 53, 51, 57, 50, 49, 51, 49, 53, 48, 55, 50, 48, 56, 48, 53, 56, 57, 55, 50, 49, 49, 52, 48, 49, 51, 53, 53, 52, 50, 54, 49, 49, 56, 54, 56, 55, 54, 49, 53, 54, 51, 57, 49, 48, 49, 51, 48, 51, 48, 50, 52, 57, 57, 52, 48, 49, 54, 53, 54, 55, 52, 51, 53, 48, 51, 50, 57, 57, 54, 57, 52, 54, 57, 52, 57, 51, 54, 57, 48, 49, 55, 50, 50, 48, 52, 52, 54, 50, 53, 50, 49, 54, 52, 51, 51, 48, 54, 53, 53, 52, 50, 53, 53, 53, 49, 52, 57, 53, 52, 56, 50, 48, 48, 53, 54, 51, 48, 48, 50, 55, 57, 50, 57, 52, 48, 56, 50, 54, 54, 53, 57, 57, 51, 57, 56, 50, 48, 54, 56, 52, 56, 57, 54, 51, 50, 55, 49, 55, 57, 57, 48, 50, 56, 56, 48, 56, 51, 53, 48, 49, 51, 51, 50, 50, 56, 54, 53, 50, 48, 48, 52, 52, 48, 53, 56, 56, 51, 54, 57, 54, 54, 57, 56, 55, 50, 49, 56, 52, 52, 54, 56, 51, 53, 48, 52, 48, 52, 56, 51, 51, 49, 51, 54, 50, 49, 49, 54, 53, 48, 49, 55, 50, 51, 52, 53, 54, 55, 52, 53, 49, 48, 49, 56, 51, 49, 57, 56, 56, 57, 56, 49, 49, 49, 49, 57, 53, 51, 56, 56, 54, 54, 55, 49, 55, 57, 53, 52, 49, 55, 55, 48, 56, 48, 52, 54, 48, 48, 52, 50, 52, 56, 57, 53, 54, 54, 48, 51, 50, 48, 52, 54, 52, 52, 55, 50, 53, 49, 49, 51, 48, 49, 51, 48, 50, 52, 53, 53, 55, 52, 54, 53, 57, 54, 51, 56, 54, 54, 52, 50, 53, 53, 52, 56, 57, 57, 57, 56, 55, 55, 55, 52, 56, 57, 52, 56, 50, 50, 49, 49, 57, 57, 48, 53, 54, 56, 51, 51, 56, 50, 54, 49, 50, 57, 52, 53, 57, 49, 52, 52, 50, 48, 54, 53, 54, 56, 57, 55, 50, 56, 52, 48, 57, 50, 51, 51, 53, 55, 48, 55, 51, 56, 50, 53, 52, 56, 52, 57, 51, 50, 48, 57, 50, 54, 52, 54, 54, 56, 53, 54, 56, 49, 57, 53, 53, 48, 50, 50, 52, 55, 49, 48, 52, 51, 55, 49, 53, 55, 57, 51, 51, 48, 55, 50, 52, 53, 53, 57, 48, 49, 54, 57, 55, 54, 49, 50, 55, 48, 52, 50, 54, 54, 49, 53, 56, 51, 50, 53, 56, 56, 56, 55, 56, 57, 54, 57, 50, 48, 50, 57, 48, 55, 51, 56, 48, 55, 56, 52, 55, 57, 54, 51, 51, 56, 57, 48, 56, 55, 53, 57, 53, 48, 48, 57, 55, 48, 57, 57, 52, 55, 49, 55, 56, 57, 56, 50, 50, 52, 48, 55, 52, 48, 54, 49, 49, 54, 56, 53, 54, 56, 49, 50, 56, 52, 50, 56, 51, 55, 55, 57, 48, 56, 53, 54, 57, 56, 54, 55, 53, 57, 52, 56, 92, 34, 44, 92, 34, 49, 92, 34, 58, 92, 34, 53, 50, 51, 53, 49, 57, 49, 56, 49, 54, 55, 50, 48, 52, 55, 51, 48, 56, 50, 52, 55, 55, 53, 57, 50, 53, 53, 55, 49, 48, 56, 57, 54, 56, 53, 53, 50, 49, 48, 54, 50, 50, 49, 51, 51, 48, 52, 56, 48, 53, 49, 50, 56, 56, 54, 56, 57, 54, 50, 56, 48, 53, 48, 53, 51, 48, 53, 57, 51, 56, 49, 57, 56, 50, 53, 48, 57, 50, 55, 52, 50, 56, 54, 56, 50, 53, 57, 48, 57, 54, 57, 53, 56, 48, 57, 49, 54, 51, 54, 51, 56, 56, 53, 57, 57, 53, 54, 55, 54, 48, 50, 57, 52, 55, 53, 55, 51, 56, 48, 51, 48, 48, 54, 49, 49, 55, 53, 52, 52, 55, 50, 50, 55, 49, 49, 52, 49, 57, 55, 57, 49, 50, 49, 54, 52, 57, 48, 52, 54, 50, 56, 48, 54, 56, 48, 56, 56, 55, 57, 57, 48, 51, 52, 52, 53, 49, 50, 54, 52, 56, 51, 49, 52, 52, 56, 55, 49, 54, 56, 52, 50, 50, 48, 57, 50, 50, 53, 55, 56, 50, 55, 49, 54, 54, 53, 50, 52, 57, 54, 54, 57, 48, 51, 54, 57, 50, 53, 57, 54, 56, 49, 55, 54, 50, 48, 53, 54, 49, 52, 49, 48, 49, 48, 48, 54, 56, 51, 49, 53, 55, 48, 52, 57, 55, 51, 50, 52, 52, 54, 50, 57, 50, 48, 54, 53, 51, 55, 55, 50, 55, 52, 49, 51, 55, 49, 52, 54, 50, 51, 54, 56, 50, 53, 56, 48, 52, 48, 51, 51, 55, 48, 53, 49, 55, 52, 51, 48, 56, 51, 55, 48, 51, 51, 55, 51, 50, 54, 56, 56, 54, 53, 49, 52, 57, 50, 49, 56, 50, 49, 53, 50, 49, 55, 48, 50, 56, 48, 57, 50, 53, 50, 52, 53, 50, 53, 55, 55, 51, 51, 48, 53, 55, 57, 55, 53, 52, 50, 57, 56, 48, 51, 54, 55, 52, 53, 53, 53, 51, 52, 56, 53, 52, 53, 50, 54, 48, 49, 49, 50, 54, 53, 57, 56, 50, 49, 50, 57, 49, 50, 51, 52, 51, 50, 57, 53, 56, 53, 54, 54, 56, 49, 53, 49, 57, 49, 52, 53, 52, 54, 48, 54, 53, 51, 57, 50, 50, 55, 49, 56, 51, 49, 51, 49, 49, 57, 52, 54, 51, 55, 56, 53, 57, 49, 53, 53, 48, 56, 57, 56, 54, 56, 49, 52, 53, 50, 52, 49, 49, 55, 51, 53, 57, 48, 57, 48, 49, 54, 53, 55, 49, 51, 53, 55, 51, 51, 56, 57, 49, 51, 50, 53, 51, 56, 56, 57, 50, 56, 57, 54, 48, 56, 50, 57, 54, 56, 54, 55, 57, 57, 50, 53, 50, 53, 55, 53, 51, 52, 52, 51, 56, 53, 50, 56, 48, 54, 51, 49, 49, 56, 53, 49, 52, 53, 52, 48, 48, 57, 55, 50, 56, 50, 50, 50, 49, 54, 53, 48, 57, 55, 48, 57, 51, 48, 52, 49, 48, 54, 51, 56, 56, 51, 50, 54, 50, 50, 54, 56, 56, 54, 50, 56, 51, 54, 52, 54, 54, 55, 56, 51, 55, 57, 48, 51, 56, 54, 56, 57, 49, 57, 53, 51, 57, 57, 56, 53, 53, 55, 56, 56, 53, 50, 49, 49, 51, 56, 49, 55, 53, 51, 49, 54, 51, 54, 49, 54, 56, 50, 53, 48, 56, 49, 52, 49, 57, 57, 53, 50, 48, 54, 48, 54, 48, 56, 49, 51, 56, 57, 53, 51, 51, 57, 53, 53, 48, 53, 50, 50, 53, 57, 51, 56, 49, 56, 48, 56, 54, 50, 48, 51, 48, 57, 48, 50, 52, 53, 49, 50, 48, 50, 52, 51, 52, 55, 53, 51, 54, 48, 54, 57, 57, 55, 52, 50, 57, 54, 51, 52, 53, 54, 57, 52, 55, 56, 51, 51, 57, 50, 55, 57, 52, 57, 53, 55, 57, 48, 48, 50, 56, 51, 53, 53, 57, 48, 50, 50, 54, 50, 52, 50, 51, 55, 53, 51, 57, 48, 56, 53, 50, 48, 48, 55, 51, 53, 49, 50, 56, 56, 49, 48, 53, 51, 54, 50, 51, 48, 54, 53, 55, 48, 49, 49, 53, 55, 53, 53, 55, 48, 56, 53, 52, 53, 57, 56, 53, 50, 49, 55, 92, 34, 44, 92, 34, 51, 92, 34, 58, 92, 34, 50, 49, 57, 55, 48, 56, 48, 53, 51, 53, 56, 49, 53, 55, 53, 48, 54, 50, 53, 56, 50, 53, 51, 51, 48, 48, 53, 55, 53, 50, 54, 51, 49, 55, 48, 55, 50, 48, 53, 50, 48, 56, 57, 57, 49, 49, 49, 56, 52, 56, 55, 54, 53, 54, 55, 54, 53, 54, 49, 54, 56, 51, 48, 55, 53, 49, 48, 50, 50, 50, 54, 57, 50, 57, 51, 56, 50, 55, 53, 55, 53, 52, 57, 55, 57, 50, 57, 52, 57, 54, 57, 54, 49, 52, 48, 53, 51, 49, 53, 54, 56, 54, 50, 52, 53, 52, 49, 49, 53, 54, 48, 57, 52, 51, 54, 57, 57, 56, 52, 57, 52, 50, 48, 52, 52, 57, 49, 56, 55, 48, 48, 55, 51, 56, 49, 52, 57, 50, 50, 52, 49, 51, 57, 50, 51, 56, 48, 51, 57, 50, 48, 56, 50, 49, 49, 48, 49, 56, 57, 57, 57, 51, 54, 57, 49, 53, 54, 49, 56, 48, 50, 52, 55, 51, 54, 57, 56, 50, 49, 56, 57, 51, 52, 51, 49, 56, 51, 56, 55, 48, 54, 50, 54, 53, 51, 56, 52, 49, 48, 57, 56, 52, 57, 56, 53, 52, 56, 50, 55, 57, 57, 50, 56, 51, 51, 50, 48, 55, 53, 57, 48, 57, 55, 54, 53, 53, 54, 54, 57, 53, 57, 48, 54, 53, 53, 49, 50, 50, 51, 53, 50, 53, 54, 53, 48, 57, 49, 52, 54, 52, 49, 51, 48, 55, 55, 48, 56, 52, 54, 51, 55, 49, 57, 50, 49, 50, 55, 56, 52, 49, 50, 55, 53, 50, 54, 53, 55, 50, 50, 54, 54, 49, 56, 54, 56, 52, 53, 49, 48, 53, 57, 52, 49, 57, 56, 50, 56, 49, 49, 48, 56, 55, 49, 50, 49, 57, 49, 53, 56, 53, 55, 53, 56, 54, 57, 55, 52, 52, 49, 57, 53, 48, 57, 57, 49, 56, 56, 57, 48, 51, 54, 57, 53, 49, 55, 55, 48, 57, 54, 53, 51, 48, 52, 53, 54, 54, 52, 52, 50, 56, 55, 50, 49, 52, 50, 50, 50, 48, 50, 48, 50, 51, 56, 50, 51, 57, 53, 49, 57, 49, 53, 51, 57, 49, 50, 52, 57, 55, 51, 50, 55, 48, 52, 55, 50, 50, 53, 54, 57, 53, 57, 52, 54, 51, 56, 50, 48, 53, 52, 57, 56, 48, 57, 52, 50, 57, 53, 51, 55, 53, 49, 48, 51, 48, 56, 53, 55, 50, 48, 51, 48, 49, 49, 49, 50, 50, 48, 54, 56, 53, 53, 57, 54, 53, 54, 49, 56, 55, 48, 51, 56, 54, 50, 54, 55, 57, 49, 52, 52, 54, 53, 49, 54, 54, 53, 52, 49, 56, 50, 49, 53, 53, 49, 53, 56, 53, 51, 57, 48, 53, 55, 55, 49, 50, 54, 57, 55, 55, 51, 55, 55, 54, 52, 55, 48, 48, 53, 53, 56, 51, 53, 50, 55, 55, 57, 50, 57, 54, 53, 48, 48, 52, 54, 54, 51, 50, 55, 56, 51, 48, 51, 57, 53, 51, 53, 55, 54, 56, 48, 51, 53, 48, 56, 52, 49, 52, 53, 56, 54, 49, 53, 51, 52, 52, 49, 50, 56, 55, 56, 57, 54, 55, 57, 56, 54, 55, 48, 51, 54, 54, 53, 54, 54, 57, 55, 54, 48, 53, 55, 50, 48, 51, 55, 54, 52, 51, 54, 51, 54, 54, 52, 51, 53, 49, 57, 57, 50, 54, 49, 54, 55, 48, 49, 49, 52, 48, 51, 50, 49, 55, 56, 52, 54, 54, 53, 50, 56, 50, 53, 54, 52, 51, 53, 49, 53, 54, 56, 51, 52, 48, 55, 56, 56, 56, 57, 50, 48, 49, 53, 54, 55, 53, 57, 52, 52, 57, 49, 50, 54, 54, 52, 54, 52, 51, 52, 53, 52, 49, 53, 49, 51, 53, 53, 55, 49, 57, 50, 52, 56, 48, 56, 55, 51, 48, 57, 53, 53, 54, 54, 51, 57, 54, 51, 49, 48, 55, 56, 48, 53, 56, 57, 56, 52, 53, 50, 49, 54, 52, 54, 48, 51, 56, 56, 51, 56, 49, 53, 55, 54, 48, 50, 50, 50, 56, 56, 48, 56, 48, 51, 49, 56, 51, 48, 57, 48, 49, 50, 50, 57, 50, 55, 48, 50, 49, 57, 48, 54, 92, 34, 125, 44, 92, 34, 109, 106, 92, 34, 58, 92, 34, 49, 52, 53, 48, 49, 56, 55, 50, 52, 48, 57, 57, 52, 48, 51, 50, 55, 57, 57, 56, 52, 49, 50, 56, 57, 51, 49, 53, 55, 48, 56, 49, 53, 49, 50, 51, 54, 51, 48, 56, 57, 55, 57, 48, 55, 53, 52, 48, 55, 57, 57, 52, 49, 54, 57, 57, 52, 51, 55, 53, 57, 52, 56, 53, 49, 52, 54, 55, 54, 54, 53, 48, 53, 57, 56, 48, 51, 54, 57, 51, 53, 50, 52, 49, 48, 48, 48, 55, 52, 52, 50, 56, 53, 52, 52, 57, 52, 52, 48, 56, 52, 53, 55, 48, 50, 49, 52, 49, 51, 56, 56, 57, 55, 49, 56, 52, 55, 50, 57, 55, 53, 56, 55, 50, 54, 54, 49, 51, 48, 55, 49, 54, 53, 48, 51, 49, 52, 52, 56, 48, 53, 55, 57, 48, 55, 52, 53, 53, 54, 55, 48, 48, 50, 48, 48, 51, 54, 54, 54, 56, 56, 56, 57, 53, 53, 54, 53, 49, 52, 53, 51, 56, 50, 51, 54, 48, 54, 57, 56, 92, 34, 44, 92, 34, 97, 108, 112, 104, 97, 92, 34, 58, 92, 34, 51, 49, 57, 49, 56, 55, 48, 51, 57, 49, 56, 52, 50, 52, 54, 48, 53, 52, 50, 49, 56, 54, 55, 51, 48, 54, 54, 51, 55, 53, 50, 57, 51, 56, 48, 56, 50, 55, 57, 56, 55, 55, 56, 53, 55, 56, 56, 52, 48, 53, 48, 53, 48, 54, 55, 50, 55, 55, 52, 49, 51, 56, 55, 51, 54, 49, 54, 54, 51, 57, 52, 49, 57, 51, 57, 48, 52, 54, 50, 49, 48, 56, 57, 53, 50, 52, 53, 51, 51, 57, 52, 52, 55, 53, 48, 49, 57, 53, 49, 49, 52, 49, 50, 57, 48, 57, 54, 49, 49, 57, 55, 53, 53, 48, 53, 49, 53, 50, 54, 56, 52, 54, 55, 50, 53, 50, 53, 52, 55, 54, 51, 56, 50, 52, 50, 48, 48, 48, 54, 54, 49, 51, 56, 49, 54, 49, 49, 51, 56, 55, 49, 50, 55, 50, 56, 49, 57, 49, 56, 49, 49, 54, 54, 51, 57, 56, 57, 55, 57, 48, 53, 57, 53, 51, 57, 57, 53, 55, 55, 57, 51, 49, 55, 55, 55, 48, 53, 55, 48, 54, 57, 54, 52, 52, 56, 50, 54, 55, 54, 48, 55, 49, 54, 49, 55, 52, 50, 49, 53, 53, 48, 50, 55, 54, 48, 51, 51, 50, 56, 50, 51, 48, 56, 55, 51, 53, 51, 50, 48, 56, 50, 48, 57, 48, 54, 50, 55, 53, 48, 51, 49, 54, 51, 52, 56, 48, 57, 54, 56, 48, 48, 55, 53, 49, 52, 48, 48, 55, 55, 53, 54, 49, 54, 51, 54, 55, 54, 49, 51, 56, 52, 54, 53, 57, 49, 48, 49, 57, 51, 52, 49, 57, 57, 56, 53, 49, 56, 55, 51, 57, 49, 55, 54, 56, 50, 55, 53, 57, 49, 56, 56, 52, 56, 50, 56, 56, 48, 51, 52, 53, 55, 55, 54, 57, 56, 51, 54, 48, 50, 50, 54, 53, 56, 55, 51, 54, 56, 57, 52, 51, 48, 55, 52, 55, 48, 50, 50, 56, 48, 50, 49, 49, 48, 55, 51, 57, 48, 57, 56, 53, 51, 53, 53, 51, 52, 49, 48, 48, 54, 51, 53, 56, 48, 54, 51, 55, 56, 51, 51, 56, 48, 51, 53, 50, 53, 53, 51, 50, 48, 51, 54, 56, 54, 56, 52, 52, 49, 49, 55, 53, 53, 52, 52, 53, 54, 56, 52, 49, 56, 54, 50, 54, 54, 52, 54, 57, 56, 48, 51, 48, 52, 49, 57, 51, 49, 57, 48, 54, 48, 48, 49, 54, 56, 53, 53, 49, 54, 48, 52, 50, 52, 55, 48, 53, 52, 54, 48, 50, 54, 55, 52, 56, 56, 50, 48, 52, 50, 53, 52, 55, 57, 57, 52, 56, 55, 55, 51, 49, 53, 55, 56, 57, 54, 54, 52, 56, 54, 51, 53, 48, 56, 54, 52, 50, 57, 55, 54, 57, 50, 49, 54, 57, 56, 54, 52, 50, 54, 57, 54, 51, 50, 49, 55, 52, 54, 51, 51, 56, 52, 57, 52, 56, 57, 56, 52, 49, 57, 55, 52, 50, 54, 55, 50, 55, 54, 49, 54, 57, 56, 54, 53, 50, 51, 52, 54, 56, 49, 53, 50, 52, 51, 49, 55, 51, 53, 51, 54, 54, 55, 51, 57, 57, 50, 53, 48, 54, 53, 53, 56, 48, 50, 48, 55, 54, 52, 55, 56, 49, 57, 51, 55, 57, 48, 49, 57, 56, 57, 51, 49, 55, 48, 51, 57, 57, 55, 48, 52, 51, 50, 55, 57, 51, 49, 49, 54, 54, 48, 54, 49, 57, 56, 53, 51, 51, 50, 49, 54, 57, 50, 51, 50, 54, 51, 55, 48, 54, 55, 55, 56, 56, 48, 55, 56, 57, 51, 48, 49, 48, 56, 49, 57, 55, 51, 56, 48, 51, 51, 53, 53, 50, 48, 54, 48, 53, 48, 56, 53, 52, 48, 48, 54, 49, 54, 51, 53, 56, 53, 50, 52, 54, 56, 50, 50, 55, 57, 53, 56, 57, 56, 54, 54, 56, 54, 55, 51, 49, 52, 51, 55, 48, 55, 50, 50, 55, 52, 50, 54, 48, 50, 52, 48, 56, 55, 50, 51, 48, 51, 57, 52, 50, 55, 50, 49, 56, 51, 50, 56, 57, 49, 50, 57, 49, 49, 54, 56, 54, 49, 48, 48, 49, 52, 56, 56, 51, 56, 48, 48, 50, 49, 56, 52, 53, 52, 54, 48, 51, 52, 55, 51, 53, 52, 51, 51, 57, 49, 50, 51, 51, 49, 54, 50, 55, 48, 54, 55, 54, 49, 53, 57, 51, 56, 52, 52, 48, 51, 54, 56, 55, 52, 49, 51, 51, 57, 54, 57, 56, 49, 52, 57, 55, 57, 53, 55, 54, 50, 51, 54, 53, 50, 55, 49, 52, 56, 50, 53, 56, 57, 51, 56, 52, 52, 50, 50, 52, 52, 54, 48, 57, 56, 49, 52, 54, 57, 51, 51, 52, 50, 54, 53, 55, 56, 54, 53, 54, 57, 51, 52, 48, 56, 54, 54, 57, 52, 56, 50, 52, 53, 51, 56, 54, 49, 55, 55, 55, 56, 54, 57, 52, 51, 92, 34, 44, 92, 34, 116, 92, 34, 58, 123, 92, 34, 51, 92, 34, 58, 92, 34, 51, 55, 57, 55, 50, 57, 50, 56, 48, 52, 48, 50, 56, 55, 48, 49, 57, 57, 54, 54, 50, 55, 57, 55, 48, 53, 50, 57, 48, 48, 55, 55, 49, 55, 55, 49, 50, 48, 52, 51, 56, 57, 49, 54, 56, 56, 49, 49, 54, 54, 53, 57, 53, 55, 50, 57, 52, 51, 51, 54, 53, 54, 56, 52, 53, 50, 51, 54, 56, 57, 52, 55, 54, 52, 50, 48, 51, 52, 53, 48, 56, 50, 53, 51, 53, 50, 51, 53, 56, 55, 52, 53, 56, 55, 50, 53, 51, 48, 54, 55, 56, 55, 50, 51, 49, 57, 51, 54, 55, 51, 49, 54, 56, 54, 57, 57, 50, 54, 49, 53, 53, 57, 50, 53, 50, 51, 52, 55, 50, 48, 54, 49, 51, 52, 57, 51, 49, 56, 53, 49, 57, 48, 48, 55, 57, 50, 51, 53, 52, 57, 50, 57, 56, 49, 49, 55, 48, 49, 52, 48, 57, 53, 57, 52, 50, 54, 52, 52, 54, 52, 50, 50, 52, 57, 53, 51, 52, 49, 57, 48, 55, 57, 52, 51, 56, 55, 49, 50, 52, 54, 56, 55, 50, 48, 53, 56, 53, 52, 50, 48, 56, 56, 52, 57, 55, 55, 52, 56, 50, 57, 52, 51, 48, 54, 48, 51, 55, 57, 48, 54, 52, 49, 54, 57, 52, 51, 54, 57, 55, 52, 51, 57, 48, 49, 49, 49, 55, 56, 50, 55, 48, 48, 50, 55, 56, 53, 50, 50, 56, 49, 49, 50, 56, 53, 51, 55, 50, 57, 49, 52, 48, 49, 52, 54, 57, 57, 52, 48, 50, 48, 51, 55, 57, 50, 48, 52, 53, 48, 49, 52, 53, 48, 51, 54, 50, 51, 50, 54, 48, 55, 54, 52, 51, 49, 57, 48, 55, 48, 50, 56, 55, 55, 50, 55, 54, 48, 52, 55, 53, 50, 57, 54, 57, 51, 57, 48, 51, 51, 49, 51, 50, 55, 52, 52, 56, 49, 53, 54, 51, 56, 57, 56, 49, 52, 53, 56, 56, 49, 50, 56, 57, 57, 52, 55, 50, 57, 56, 49, 57, 49, 51, 50, 50, 49, 54, 53, 50, 54, 52, 53, 48, 49, 52, 50, 52, 51, 54, 48, 53, 57, 54, 50, 49, 49, 54, 54, 48, 49, 48, 52, 54, 57, 50, 50, 51, 55, 52, 55, 51, 51, 48, 55, 50, 57, 52, 55, 57, 51, 57, 57, 55, 53, 52, 57, 49, 54, 56, 57, 53, 56, 52, 49, 50, 49, 56, 54, 55, 51, 52, 51, 48, 56, 57, 57, 52, 56, 52, 57, 52, 56, 48, 51, 50, 53, 49, 51, 54, 48, 57, 56, 54, 48, 51, 49, 54, 52, 54, 48, 48, 50, 52, 52, 49, 56, 57, 48, 51, 51, 51, 54, 56, 57, 51, 55, 50, 49, 54, 48, 52, 49, 50, 51, 50, 55, 48, 48, 54, 56, 52, 55, 49, 55, 49, 57, 53, 49, 52, 51, 52, 52, 56, 56, 57, 55, 51, 48, 57, 57, 50, 49, 54, 57, 54, 48, 51, 55, 57, 57, 54, 56, 50, 49, 54, 56, 50, 49, 54, 49, 50, 52, 53, 54, 51, 51, 48, 57, 57, 53, 49, 52, 48, 51, 50, 54, 55, 50, 49, 48, 56, 51, 54, 50, 52, 55, 49, 56, 52, 55, 50, 56, 55, 55, 56, 48, 55, 54, 55, 53, 51, 54, 53, 50, 55, 57, 50, 50, 49, 50, 53, 50, 57, 48, 51, 53, 52, 48, 48, 55, 50, 48, 56, 52, 54, 49, 53, 51, 52, 53, 48, 54, 54, 56, 48, 52, 50, 57, 48, 55, 57, 51, 50, 53, 54, 55, 51, 51, 48, 51, 56, 52, 55, 49, 50, 50, 54, 48, 50, 92, 34, 44, 92, 34, 49, 92, 34, 58, 92, 34, 56, 51, 55, 57, 55, 57, 50, 51, 49, 49, 49, 49, 50, 52, 54, 57, 56, 51, 51, 55, 49, 57, 48, 51, 53, 48, 55, 52, 48, 54, 50, 53, 52, 49, 57, 52, 54, 49, 51, 51, 49, 54, 55, 52, 53, 57, 55, 51, 49, 55, 52, 57, 57, 50, 56, 53, 55, 49, 49, 49, 57, 54, 48, 53, 57, 50, 48, 49, 49, 49, 54, 50, 51, 51, 54, 57, 54, 51, 53, 49, 52, 54, 50, 50, 49, 57, 54, 53, 53, 52, 55, 51, 57, 55, 52, 50, 56, 53, 55, 50, 56, 52, 49, 55, 48, 52, 50, 54, 51, 54, 51, 50, 49, 48, 48, 50, 54, 54, 50, 53, 52, 48, 48, 56, 52, 56, 54, 53, 48, 53, 57, 56, 55, 55, 52, 49, 53, 57, 56, 56, 52, 57, 50, 54, 53, 56, 48, 48, 50, 52, 53, 53, 54, 56, 49, 56, 57, 50, 51, 53, 55, 57, 54, 53, 55, 51, 52, 52, 49, 50, 55, 55, 56, 52, 52, 49, 51, 53, 57, 54, 57, 52, 51, 54, 51, 57, 53, 54, 49, 53, 48, 53, 48, 52, 50, 48, 55, 48, 51, 52, 51, 54, 52, 55, 55, 52, 54, 51, 50, 50, 54, 57, 54, 50, 54, 53, 56, 56, 54, 49, 54, 56, 50, 48, 56, 54, 55, 55, 56, 54, 56, 52, 53, 54, 56, 49, 54, 50, 57, 51, 48, 56, 53, 55, 51, 56, 55, 55, 54, 54, 52, 50, 50, 53, 53, 52, 53, 55, 54, 56, 53, 54, 57, 48, 48, 52, 55, 50, 56, 54, 53, 51, 54, 48, 56, 50, 53, 54, 51, 48, 57, 54, 52, 57, 55, 53, 55, 55, 57, 55, 55, 57, 57, 55, 48, 49, 54, 57, 52, 55, 51, 52, 57, 53, 51, 53, 49, 49, 52, 48, 55, 57, 57, 49, 57, 52, 53, 54, 48, 54, 50, 51, 51, 48, 49, 53, 55, 48, 52, 52, 57, 56, 51, 53, 49, 51, 52, 57, 54, 55, 57, 48, 50, 56, 48, 57, 54, 55, 50, 55, 49, 50, 55, 53, 57, 50, 56, 50, 52, 49, 54, 55, 52, 55, 48, 50, 51, 57, 49, 50, 49, 54, 49, 55, 53, 50, 49, 50, 51, 54, 50, 56, 52, 57, 52, 52, 53, 53, 50, 48, 50, 50, 48, 52, 50, 57, 56, 57, 49, 57, 53, 48, 52, 53, 55, 57, 54, 53, 53, 48, 50, 48, 54, 57, 51, 48, 53, 51, 53, 48, 49, 52, 56, 57, 48, 57, 52, 54, 57, 54, 51, 55, 49, 52, 53, 51, 50, 56, 54, 53, 52, 49, 51, 55, 55, 51, 51, 48, 50, 53, 53, 54, 57, 50, 49, 48, 51, 51, 56, 48, 55, 52, 48, 56, 57, 52, 49, 48, 53, 50, 49, 52, 51, 52, 54, 50, 56, 54, 49, 50, 53, 51, 48, 51, 54, 56, 53, 55, 50, 51, 53, 51, 55, 52, 49, 52, 50, 56, 51, 49, 54, 56, 49, 54, 48, 57, 54, 51, 56, 55, 50, 51, 50, 54, 54, 49, 49, 51, 50, 57, 50, 53, 51, 57, 54, 57, 54, 48, 51, 49, 54, 48, 52, 49, 51, 56, 54, 57, 55, 54, 53, 49, 54, 54, 51, 53, 56, 57, 50, 51, 55, 48, 56, 51, 50, 55, 53, 49, 56, 50, 53, 56, 57, 48, 55, 55, 53, 51, 55, 56, 54, 53, 56, 49, 50, 50, 48, 51, 54, 55, 53, 51, 54, 51, 57, 51, 49, 50, 55, 54, 48, 49, 52, 56, 53, 52, 55, 50, 48, 57, 56, 55, 55, 55, 56, 54, 53, 55, 54, 49, 52, 49, 48, 50, 55, 52, 52, 92, 34, 44, 92, 34, 48, 92, 34, 58, 92, 34, 50, 54, 53, 48, 53, 48, 51, 55, 53, 51, 50, 54, 56, 53, 53, 57, 50, 51, 52, 51, 50, 53, 48, 52, 53, 54, 48, 53, 48, 56, 56, 55, 55, 52, 50, 57, 49, 52, 50, 54, 55, 49, 52, 52, 52, 55, 53, 51, 48, 57, 50, 48, 48, 51, 50, 54, 56, 54, 54, 57, 57, 54, 54, 48, 51, 51, 49, 49, 51, 50, 56, 49, 56, 52, 49, 56, 50, 57, 52, 52, 48, 49, 51, 56, 54, 52, 53, 56, 49, 49, 51, 57, 50, 57, 48, 49, 53, 54, 54, 57, 57, 55, 48, 48, 53, 52, 57, 56, 55, 48, 52, 54, 56, 54, 57, 57, 53, 50, 53, 53, 57, 57, 51, 56, 50, 53, 48, 48, 55, 50, 51, 50, 51, 50, 48, 50, 52, 50, 56, 53, 57, 53, 48, 53, 48, 50, 54, 52, 49, 52, 56, 52, 53, 49, 53, 57, 55, 51, 52, 50, 48, 50, 52, 57, 57, 57, 49, 57, 53, 57, 56, 56, 57, 53, 54, 56, 50, 53, 57, 57, 53, 53, 56, 53, 53, 55, 54, 57, 49, 51, 48, 51, 53, 48, 53, 55, 55, 50, 55, 48, 54, 55, 53, 55, 52, 53, 56, 53, 55, 54, 53, 48, 48, 55, 53, 55, 51, 54, 51, 49, 54, 54, 49, 49, 57, 48, 49, 48, 54, 51, 50, 53, 57, 53, 49, 53, 54, 50, 54, 52, 55, 57, 55, 51, 57, 57, 57, 53, 53, 54, 51, 48, 55, 57, 48, 52, 49, 53, 54, 54, 48, 50, 57, 55, 50, 50, 53, 54, 55, 55, 50, 51, 54, 56, 54, 50, 54, 49, 50, 52, 57, 53, 54, 51, 53, 57, 49, 49, 51, 57, 52, 56, 52, 55, 57, 51, 51, 55, 57, 57, 56, 52, 55, 51, 55, 48, 48, 49, 54, 51, 55, 51, 54, 57, 49, 51, 57, 52, 57, 57, 49, 52, 54, 49, 56, 52, 54, 56, 55, 56, 54, 57, 56, 50, 48, 55, 56, 57, 54, 49, 56, 54, 52, 48, 53, 52, 49, 53, 53, 55, 49, 54, 48, 57, 56, 57, 54, 55, 50, 51, 51, 52, 57, 51, 50, 57, 56, 51, 51, 49, 52, 50, 57, 48, 57, 52, 57, 54, 49, 56, 53, 50, 48, 53, 48, 50, 53, 49, 52, 56, 48, 57, 51, 55, 50, 52, 52, 48, 57, 55, 48, 56, 52, 52, 56, 48, 48, 55, 57, 51, 51, 56, 54, 53, 48, 48, 54, 57, 52, 55, 52, 51, 52, 51, 56, 52, 57, 54, 53, 51, 52, 57, 56, 50, 48, 52, 56, 51, 54, 54, 52, 55, 50, 48, 56, 52, 50, 53, 54, 55, 51, 57, 48, 57, 57, 52, 57, 51, 51, 56, 51, 52, 52, 48, 51, 57, 56, 54, 52, 57, 54, 50, 57, 51, 48, 51, 54, 48, 48, 57, 57, 56, 56, 56, 51, 55, 57, 49, 49, 50, 50, 50, 55, 56, 55, 57, 49, 52, 55, 49, 50, 52, 52, 55, 57, 54, 55, 52, 52, 53, 52, 50, 49, 57, 51, 54, 48, 53, 54, 52, 48, 49, 54, 51, 51, 51, 54, 57, 50, 50, 56, 55, 54, 49, 50, 55, 57, 53, 50, 53, 53, 50, 52, 57, 56, 51, 57, 53, 49, 54, 53, 55, 57, 54, 56, 53, 54, 52, 52, 50, 49, 54, 54, 48, 49, 55, 49, 48, 55, 54, 51, 57, 53, 49, 55, 51, 48, 55, 48, 52, 52, 49, 52, 55, 56, 48, 56, 56, 57, 52, 55, 57, 55, 53, 55, 55, 54, 52, 55, 55, 49, 56, 50, 52, 54, 56, 54, 49, 50, 49, 49, 51, 53, 54, 54, 52, 92, 34, 44, 92, 34, 68, 69, 76, 84, 65, 92, 34, 58, 92, 34, 52, 51, 48, 54, 53, 56, 51, 53, 51, 55, 53, 54, 54, 53, 56, 49, 57, 52, 52, 48, 57, 57, 57, 53, 49, 53, 52, 50, 49, 56, 51, 53, 54, 54, 51, 51, 55, 48, 48, 48, 51, 54, 57, 56, 55, 54, 54, 57, 57, 57, 49, 51, 54, 48, 56, 49, 54, 52, 53, 56, 48, 52, 53, 50, 56, 54, 57, 51, 49, 49, 54, 50, 52, 50, 56, 51, 53, 50, 52, 50, 50, 54, 56, 57, 55, 54, 56, 56, 54, 53, 52, 49, 53, 48, 48, 56, 56, 53, 51, 55, 50, 57, 49, 57, 49, 57, 51, 53, 57, 53, 53, 50, 49, 54, 52, 57, 55, 52, 50, 53, 56, 51, 56, 52, 55, 52, 49, 50, 48, 55, 56, 57, 51, 55, 53, 53, 56, 53, 57, 52, 49, 51, 52, 54, 53, 50, 56, 57, 56, 51, 50, 57, 53, 51, 49, 51, 52, 53, 52, 55, 52, 57, 55, 51, 54, 57, 52, 52, 54, 57, 52, 55, 52, 48, 52, 56, 49, 52, 51, 48, 55, 55, 55, 48, 50, 50, 50, 54, 56, 55, 54, 51, 50, 51, 49, 52, 56, 51, 56, 52, 53, 48, 48, 49, 51, 52, 57, 48, 48, 49, 50, 54, 57, 56, 51, 55, 55, 54, 48, 48, 53, 48, 52, 56, 56, 49, 53, 57, 51, 56, 48, 49, 48, 57, 56, 52, 56, 53, 50, 54, 55, 49, 56, 54, 52, 57, 57, 52, 51, 52, 57, 55, 49, 53, 49, 56, 48, 53, 56, 50, 53, 55, 52, 54, 51, 53, 57, 56, 54, 55, 54, 55, 56, 52, 55, 49, 52, 51, 52, 53, 55, 49, 57, 49, 48, 57, 53, 53, 52, 48, 50, 57, 51, 57, 51, 51, 53, 54, 52, 52, 48, 52, 54, 50, 55, 50, 55, 53, 57, 53, 49, 49, 55, 54, 54, 54, 57, 53, 56, 57, 52, 52, 54, 56, 55, 52, 56, 48, 51, 52, 50, 50, 56, 48, 53, 52, 57, 50, 52, 53, 57, 56, 56, 54, 51, 53, 52, 53, 56, 57, 57, 50, 49, 53, 54, 54, 53, 48, 52, 57, 53, 53, 53, 48, 53, 48, 55, 50, 57, 48, 55, 50, 48, 49, 54, 48, 48, 56, 57, 55, 50, 57, 50, 52, 52, 54, 52, 52, 53, 50, 55, 51, 50, 50, 54, 55, 53, 57, 54, 52, 53, 49, 53, 50, 51, 52, 55, 55, 54, 48, 48, 52, 53, 48, 51, 48, 51, 50, 54, 57, 53, 52, 55, 52, 50, 48, 55, 53, 55, 49, 48, 49, 52, 56, 52, 56, 49, 48, 55, 50, 49, 55, 52, 57, 48, 56, 56, 49, 52, 52, 57, 48, 53, 51, 53, 54, 54, 52, 50, 49, 51, 49, 54, 49, 48, 54, 51, 50, 55, 57, 48, 52, 57, 55, 52, 53, 51, 54, 55, 49, 57, 51, 51, 48, 57, 51, 50, 57, 48, 51, 52, 48, 55, 54, 49, 54, 51, 48, 51, 53, 53, 56, 53, 55, 56, 54, 52, 54, 54, 50, 52, 56, 54, 54, 49, 56, 53, 55, 52, 48, 54, 55, 54, 49, 51, 52, 55, 57, 57, 52, 54, 48, 51, 52, 52, 50, 57, 48, 52, 51, 57, 49, 55, 53, 57, 54, 48, 51, 50, 54, 50, 54, 53, 51, 54, 48, 53, 54, 52, 51, 55, 51, 55, 49, 56, 55, 53, 49, 49, 54, 54, 51, 50, 55, 56, 57, 48, 52, 55, 50, 50, 49, 51, 51, 49, 48, 57, 53, 57, 55, 56, 55, 54, 49, 57, 56, 51, 52, 50, 50, 53, 55, 57, 53, 57, 56, 53, 49, 55, 50, 49, 56, 51, 52, 49, 57, 50, 92, 34, 44, 92, 34, 50, 92, 34, 58, 92, 34, 52, 54, 54, 50, 56, 57, 53, 50, 50, 57, 56, 57, 53, 57, 51, 51, 51, 48, 56, 48, 49, 50, 49, 55, 49, 48, 56, 56, 50, 51, 48, 56, 54, 48, 49, 54, 57, 52, 56, 52, 49, 49, 48, 55, 56, 56, 52, 48, 49, 54, 54, 55, 49, 50, 54, 50, 52, 56, 49, 49, 50, 48, 49, 51, 57, 56, 53, 50, 51, 50, 54, 48, 55, 56, 50, 55, 48, 57, 56, 53, 53, 53, 56, 52, 55, 52, 50, 49, 49, 52, 54, 56, 52, 49, 51, 53, 51, 53, 50, 53, 49, 51, 54, 53, 56, 57, 55, 51, 52, 51, 48, 51, 57, 52, 55, 51, 57, 56, 53, 52, 50, 51, 51, 57, 52, 54, 54, 51, 52, 51, 57, 57, 49, 53, 56, 56, 54, 53, 52, 51, 55, 48, 57, 53, 56, 53, 57, 52, 55, 57, 49, 57, 53, 49, 48, 56, 57, 55, 55, 56, 48, 57, 52, 53, 48, 50, 57, 50, 55, 57, 51, 50, 49, 57, 49, 50, 57, 49, 57, 54, 53, 52, 48, 57, 56, 50, 48, 50, 53, 57, 49, 48, 52, 49, 51, 51, 51, 53, 52, 54, 51, 48, 53, 51, 52, 53, 50, 50, 54, 56, 57, 49, 52, 57, 49, 57, 51, 52, 55, 53, 50, 53, 56, 53, 54, 52, 52, 53, 53, 55, 57, 49, 53, 52, 56, 57, 53, 51, 53, 49, 53, 52, 50, 53, 52, 54, 55, 51, 53, 52, 51, 57, 48, 49, 52, 57, 54, 48, 54, 50, 55, 57, 53, 50, 57, 55, 49, 50, 51, 56, 50, 51, 57, 53, 57, 53, 49, 55, 49, 57, 48, 50, 54, 57, 50, 50, 56, 53, 51, 48, 49, 49, 49, 55, 56, 50, 54, 48, 53, 48, 51, 52, 48, 57, 56, 53, 56, 54, 57, 50, 56, 57, 49, 55, 48, 57, 56, 55, 56, 50, 54, 56, 54, 48, 49, 56, 57, 51, 54, 55, 51, 48, 50, 54, 57, 55, 49, 50, 55, 51, 57, 53, 52, 53, 56, 57, 56, 48, 48, 56, 49, 48, 50, 48, 50, 50, 56, 55, 50, 56, 51, 50, 56, 49, 51, 57, 49, 56, 50, 57, 56, 51, 49, 53, 54, 53, 54, 48, 56, 53, 51, 54, 50, 50, 51, 55, 56, 53, 53, 57, 52, 52, 51, 54, 51, 57, 50, 55, 54, 55, 54, 48, 55, 53, 57, 48, 57, 49, 56, 50, 54, 56, 51, 48, 54, 57, 48, 48, 51, 55, 57, 49, 55, 50, 48, 48, 57, 53, 56, 57, 56, 48, 49, 49, 49, 52, 56, 50, 57, 52, 54, 57, 48, 53, 57, 57, 55, 56, 51, 52, 50, 50, 51, 54, 53, 51, 49, 49, 50, 49, 55, 55, 51, 55, 55, 56, 49, 50, 50, 56, 48, 56, 56, 53, 54, 51, 53, 56, 48, 56, 55, 52, 54, 49, 57, 51, 51, 48, 54, 55, 49, 51, 48, 55, 50, 53, 56, 57, 57, 53, 51, 56, 50, 51, 49, 48, 49, 54, 57, 55, 48, 56, 51, 56, 56, 56, 48, 52, 52, 55, 52, 49, 48, 49, 48, 52, 56, 51, 52, 56, 53, 53, 55, 51, 53, 51, 49, 53, 50, 51, 48, 49, 53, 55, 48, 52, 55, 50, 55, 57, 48, 49, 56, 54, 51, 48, 57, 50, 55, 51, 49, 54, 52, 49, 49, 53, 56, 48, 54, 56, 51, 53, 57, 53, 48, 49, 51, 49, 55, 48, 49, 51, 49, 52, 52, 53, 53, 48, 55, 52, 54, 54, 49, 55, 57, 55, 55, 54, 50, 57, 51, 50, 54, 49, 55, 52, 53, 48, 54, 57, 55, 55, 48, 49, 48, 53, 56, 92, 34, 125, 44, 92, 34, 112, 114, 101, 100, 105, 99, 97, 116, 101, 92, 34, 58, 123, 92, 34, 97, 116, 116, 114, 95, 110, 97, 109, 101, 92, 34, 58, 92, 34, 97, 103, 101, 92, 34, 44, 92, 34, 112, 95, 116, 121, 112, 101, 92, 34, 58, 92, 34, 71, 69, 92, 34, 44, 92, 34, 118, 97, 108, 117, 101, 92, 34, 58, 49, 56, 125, 125, 93, 125, 44, 92, 34, 110, 111, 110, 95, 114, 101, 118, 111, 99, 95, 112, 114, 111, 111, 102, 92, 34, 58, 110, 117, 108, 108, 125, 93, 44, 92, 34, 97, 103, 103, 114, 101, 103, 97, 116, 101, 100, 95, 112, 114, 111, 111, 102, 92, 34, 58, 123, 92, 34, 99, 95, 104, 97, 115, 104, 92, 34, 58, 92, 34, 49, 53, 49, 48, 55, 53, 57, 49, 49, 52, 56, 49, 50, 51, 57, 50, 49, 49, 51, 55, 49, 52, 54, 49, 57, 52, 51, 53, 55, 49, 56, 53, 51, 49, 54, 52, 49, 54, 54, 53, 56, 49, 48, 54, 52, 52, 54, 53, 51, 51, 54, 51, 51, 53, 49, 54, 55, 54, 56, 51, 54, 52, 51, 49, 54, 57, 52, 51, 48, 56, 57, 53, 56, 48, 48, 52, 50, 92, 34, 44, 92, 34, 99, 95, 108, 105, 115, 116, 92, 34, 58, 91, 91, 49, 44, 49, 54, 54, 44, 56, 49, 44, 49, 54, 55, 44, 49, 50, 57, 44, 49, 54, 56, 44, 57, 44, 49, 57, 53, 44, 50, 48, 54, 44, 50, 48, 57, 44, 49, 48, 54, 44, 49, 56, 49, 44, 49, 53, 48, 44, 49, 54, 44, 49, 57, 53, 44, 49, 49, 55, 44, 54, 51, 44, 49, 55, 55, 44, 52, 52, 44, 50, 49, 53, 44, 56, 44, 51, 54, 44, 57, 54, 44, 49, 54, 44, 49, 57, 49, 44, 50, 48, 49, 44, 49, 50, 51, 44, 49, 55, 51, 44, 50, 52, 50, 44, 57, 48, 44, 50, 53, 50, 44, 49, 52, 55, 44, 50, 57, 44, 49, 54, 52, 44, 50, 51, 48, 44, 50, 50, 44, 49, 52, 56, 44, 50, 48, 49, 44, 55, 48, 44, 50, 49, 57, 44, 49, 44, 49, 55, 52, 44, 54, 56, 44, 50, 49, 50, 44, 49, 55, 50, 44, 50, 48, 44, 50, 52, 55, 44, 49, 48, 54, 44, 50, 51, 57, 44, 57, 54, 44, 56, 52, 44, 54, 50, 44, 50, 49, 51, 44, 50, 48, 53, 44, 50, 50, 44, 50, 55, 44, 53, 54, 44, 51, 50, 44, 49, 51, 44, 56, 55, 44, 56, 54, 44, 49, 53, 52, 44, 52, 55, 44, 56, 55, 44, 50, 50, 51, 44, 49, 51, 51, 44, 52, 56, 44, 49, 48, 51, 44, 49, 56, 49, 44, 49, 55, 51, 44, 56, 44, 49, 48, 49, 44, 49, 44, 54, 51, 44, 57, 53, 44, 49, 55, 50, 44, 49, 48, 57, 44, 50, 53, 52, 44, 49, 54, 48, 44, 50, 51, 56, 44, 52, 52, 44, 49, 56, 52, 44, 49, 54, 44, 49, 52, 51, 44, 53, 57, 44, 51, 56, 44, 51, 48, 44, 49, 55, 48, 44, 52, 57, 44, 49, 50, 53, 44, 49, 57, 55, 44, 50, 50, 49, 44, 50, 50, 50, 44, 53, 52, 44, 53, 56, 44, 50, 49, 48, 44, 50, 53, 50, 44, 49, 51, 55, 44, 49, 52, 53, 44, 55, 48, 44, 57, 57, 44, 49, 52, 50, 44, 50, 51, 51, 44, 49, 53, 56, 44, 49, 54, 50, 44, 49, 55, 52, 44, 54, 44, 49, 48, 55, 44, 51, 49, 44, 49, 52, 44, 53, 48, 44, 49, 49, 49, 44, 50, 52, 52, 44, 49, 51, 55, 44, 49, 50, 50, 44, 50, 44, 49, 54, 44, 50, 49, 56, 44, 50, 44, 56, 56, 44, 50, 48, 48, 44, 55, 50, 44, 52, 48, 44, 49, 52, 49, 44, 49, 51, 57, 44, 49, 56, 56, 44, 52, 51, 44, 52, 56, 44, 50, 51, 55, 44, 50, 52, 53, 44, 49, 54, 57, 44, 49, 54, 50, 44, 56, 57, 44, 49, 49, 50, 44, 56, 49, 44, 48, 44, 50, 51, 44, 52, 54, 44, 49, 57, 49, 44, 49, 53, 50, 44, 50, 50, 49, 44, 57, 51, 44, 49, 50, 53, 44, 49, 48, 53, 44, 50, 51, 56, 44, 49, 44, 50, 50, 50, 44, 49, 53, 55, 44, 54, 56, 44, 54, 49, 44, 50, 51, 44, 49, 56, 57, 44, 55, 44, 49, 49, 51, 44, 49, 54, 50, 44, 54, 49, 44, 50, 51, 48, 44, 49, 55, 50, 44, 49, 52, 51, 44, 56, 44, 49, 53, 55, 44, 49, 51, 44, 50, 50, 57, 44, 50, 50, 49, 44, 50, 49, 52, 44, 55, 57, 44, 56, 52, 44, 50, 52, 54, 44, 55, 53, 44, 49, 53, 54, 44, 50, 52, 48, 44, 55, 54, 44, 49, 50, 52, 44, 57, 51, 44, 51, 57, 44, 51, 48, 44, 49, 54, 55, 44, 49, 50, 50, 44, 49, 55, 53, 44, 50, 52, 54, 44, 49, 49, 55, 44, 49, 48, 53, 44, 54, 44, 50, 48, 51, 44, 50, 48, 55, 44, 56, 55, 44, 50, 49, 55, 44, 52, 48, 44, 50, 49, 53, 44, 50, 48, 44, 50, 48, 57, 44, 49, 56, 56, 44, 49, 55, 53, 44, 54, 44, 50, 53, 48, 44, 51, 49, 44, 49, 51, 44, 54, 52, 44, 49, 44, 50, 53, 48, 44, 54, 52, 44, 49, 53, 52, 44, 50, 51, 50, 44, 54, 52, 44, 52, 54, 44, 56, 52, 44, 55, 44, 49, 56, 48, 44, 49, 50, 49, 44, 53, 50, 44, 49, 44, 50, 51, 48, 44, 49, 50, 50, 44, 51, 48, 44, 57, 56, 44, 49, 52, 54, 44, 50, 50, 48, 44, 54, 44, 49, 54, 56, 44, 49, 57, 44, 53, 55, 44, 55, 56, 44, 55, 55, 44, 49, 49, 52, 44, 56, 52, 44, 57, 54, 44, 52, 56, 44, 49, 54, 50, 44, 53, 52, 44, 51, 53, 44, 51, 48, 44, 49, 52, 49, 44, 49, 56, 54, 44, 49, 54, 51, 44, 57, 57, 44, 49, 56, 53, 44, 49, 50, 51, 44, 50, 52, 44, 50, 49, 55, 44, 49, 51, 57, 44, 50, 49, 56, 44, 50, 50, 55, 44, 49, 52, 49, 44, 50, 51, 54, 44, 49, 48, 53, 44, 49, 54, 48, 44, 50, 52, 49, 44, 56, 51, 44, 50, 48, 49, 44, 49, 53, 50, 44, 54, 54, 44, 57, 56, 44, 51, 55, 44, 50, 53, 51, 44, 49, 54, 50, 44, 49, 57, 53, 44, 50, 50, 48, 93, 44, 91, 50, 48, 44, 50, 53, 52, 44, 50, 53, 50, 44, 50, 50, 44, 50, 51, 49, 44, 55, 53, 44, 49, 56, 44, 49, 55, 48, 44, 49, 55, 57, 44, 49, 48, 57, 44, 50, 50, 48, 44, 50, 51, 48, 44, 50, 55, 44, 50, 49, 57, 44, 49, 52, 57, 44, 51, 50, 44, 50, 49, 52, 44, 50, 48, 57, 44, 49, 52, 57, 44, 49, 51, 51, 44, 53, 48, 44, 56, 56, 44, 50, 49, 55, 44, 55, 56, 44, 53, 44, 57, 54, 44, 49, 52, 53, 44, 49, 51, 49, 44, 50, 53, 48, 44, 49, 53, 57, 44, 54, 49, 44, 49, 48, 56, 44, 54, 53, 44, 50, 49, 57, 44, 57, 52, 44, 55, 53, 44, 53, 50, 44, 56, 52, 44, 50, 53, 49, 44, 49, 54, 57, 44, 49, 57, 50, 44, 56, 52, 44, 49, 51, 53, 44, 53, 56, 44, 49, 51, 49, 44, 50, 54, 44, 51, 54, 44, 49, 52, 57, 44, 50, 55, 44, 50, 50, 52, 44, 49, 48, 54, 44, 54, 49, 44, 53, 44, 49, 57, 52, 44, 49, 57, 54, 44, 50, 52, 55, 44, 53, 51, 44, 55, 49, 44, 50, 49, 55, 44, 49, 49, 53, 44, 49, 49, 53, 44, 49, 51, 50, 44, 50, 49, 53, 44, 50, 52, 48, 44, 50, 51, 49, 44, 49, 57, 44, 49, 51, 49, 44, 49, 48, 54, 44, 50, 53, 50, 44, 57, 44, 56, 56, 44, 54, 54, 44, 50, 51, 55, 44, 49, 57, 44, 49, 48, 53, 44, 50, 50, 49, 44, 49, 50, 55, 44, 49, 55, 55, 44, 50, 53, 48, 44, 52, 44, 49, 50, 55, 44, 50, 51, 44, 49, 54, 55, 44, 54, 56, 44, 50, 53, 53, 44, 49, 56, 50, 44, 50, 51, 52, 44, 53, 53, 44, 50, 48, 50, 44, 49, 57, 57, 44, 49, 53, 57, 44, 54, 54, 44, 49, 44, 49, 56, 49, 44, 50, 50, 44, 52, 48, 44, 49, 49, 50, 44, 49, 52, 52, 44, 50, 49, 57, 44, 55, 56, 44, 50, 53, 49, 44, 49, 55, 50, 44, 56, 44, 49, 57, 51, 44, 49, 51, 57, 44, 49, 55, 53, 44, 51, 44, 49, 54, 48, 44, 54, 44, 50, 53, 53, 44, 55, 54, 44, 50, 51, 50, 44, 50, 49, 53, 44, 54, 55, 44, 49, 53, 55, 44, 50, 51, 57, 44, 49, 51, 44, 49, 55, 57, 44, 49, 55, 51, 44, 49, 55, 52, 44, 49, 53, 56, 44, 49, 50, 48, 44, 55, 44, 50, 50, 54, 44, 52, 56, 44, 57, 57, 44, 51, 54, 44, 49, 50, 57, 44, 49, 52, 54, 44, 56, 53, 44, 49, 57, 52, 44, 54, 52, 44, 56, 54, 44, 50, 54, 44, 50, 52, 50, 44, 50, 52, 56, 44, 49, 57, 50, 44, 49, 56, 50, 44, 50, 50, 53, 44, 49, 57, 51, 44, 49, 48, 44, 49, 52, 54, 44, 49, 49, 51, 44, 50, 52, 57, 44, 49, 56, 51, 44, 54, 52, 44, 49, 56, 57, 44, 49, 48, 49, 44, 54, 57, 44, 49, 49, 56, 44, 50, 52, 57, 44, 52, 54, 44, 49, 53, 53, 44, 50, 48, 54, 44, 56, 53, 44, 49, 53, 48, 44, 50, 52, 53, 44, 54, 54, 44, 52, 44, 49, 54, 51, 44, 50, 49, 50, 44, 49, 54, 56, 44, 50, 50, 50, 44, 55, 54, 44, 49, 51, 54, 44, 53, 54, 44, 49, 51, 53, 44, 50, 50, 57, 44, 49, 56, 56, 44, 49, 50, 53, 44, 49, 55, 56, 44, 49, 56, 56, 44, 50, 49, 44, 54, 53, 44, 52, 52, 44, 50, 51, 52, 44, 53, 44, 49, 56, 48, 44, 49, 52, 48, 44, 54, 53, 44, 53, 51, 44, 49, 54, 54, 44, 49, 57, 49, 44, 50, 44, 49, 56, 57, 44, 50, 48, 55, 44, 55, 51, 44, 53, 48, 44, 49, 50, 57, 44, 49, 57, 49, 44, 56, 50, 44, 49, 54, 54, 44, 54, 48, 44, 49, 56, 55, 44, 55, 57, 44, 50, 49, 49, 44, 54, 51, 44, 53, 54, 44, 50, 50, 54, 44, 50, 53, 44, 49, 57, 50, 44, 48, 44, 49, 50, 56, 44, 49, 57, 50, 44, 55, 44, 50, 51, 56, 44, 49, 56, 57, 44, 57, 48, 44, 56, 54, 44, 49, 48, 52, 44, 50, 55, 44, 49, 48, 57, 44, 50, 55, 44, 50, 57, 44, 49, 55, 51, 44, 55, 57, 44, 49, 52, 55, 44, 56, 52, 44, 50, 51, 51, 44, 55, 53, 44, 50, 51, 57, 44, 50, 52, 53, 44, 50, 54, 44, 49, 55, 57, 44, 49, 52, 56, 44, 53, 48, 44, 49, 51, 52, 44, 49, 48, 57, 44, 50, 50, 51, 44, 53, 57, 44, 49, 56, 52, 44, 57, 56, 44, 49, 48, 55, 44, 49, 56, 54, 44, 49, 56, 55, 44, 51, 56, 44, 56, 54, 44, 49, 53, 54, 44, 49, 51, 51, 44, 49, 52, 52, 44, 50, 53, 49, 44, 49, 56, 56, 44, 49, 57, 57, 44, 55, 50, 44, 50, 51, 54, 44, 49, 56, 49, 44, 49, 50, 49, 44, 56, 51, 44, 52, 50, 44, 52, 48, 44, 49, 44, 49, 57, 52, 44, 53, 55, 44, 49, 55, 54, 44, 49, 55, 52, 44, 52, 56, 93, 44, 91, 50, 44, 49, 53, 49, 44, 50, 48, 54, 44, 49, 55, 56, 44, 50, 50, 48, 44, 49, 57, 57, 44, 49, 49, 51, 44, 49, 49, 56, 44, 49, 49, 50, 44, 49, 53, 52, 44, 49, 48, 51, 44, 55, 56, 44, 53, 54, 44, 49, 49, 51, 44, 49, 52, 49, 44, 55, 52, 44, 49, 48, 44, 53, 54, 44, 49, 53, 50, 44, 57, 51, 44, 49, 49, 54, 44, 49, 56, 53, 44, 49, 52, 54, 44, 50, 49, 49, 44, 52, 50, 44, 50, 44, 50, 53, 52, 44, 49, 50, 57, 44, 49, 50, 48, 44, 49, 54, 55, 44, 49, 57, 51, 44, 49, 49, 49, 44, 54, 50, 44, 56, 51, 44, 49, 51, 54, 44, 49, 48, 48, 44, 49, 51, 55, 44, 54, 48, 44, 49, 48, 44, 56, 57, 44, 56, 53, 44, 49, 50, 51, 44, 50, 50, 50, 44, 55, 57, 44, 50, 48, 56, 44, 53, 53, 44, 50, 48, 50, 44, 49, 49, 53, 44, 50, 51, 52, 44, 52, 51, 44, 49, 57, 52, 44, 50, 52, 56, 44, 50, 49, 48, 44, 49, 51, 56, 44, 49, 57, 51, 44, 49, 52, 52, 44, 49, 53, 55, 44, 55, 49, 44, 49, 48, 49, 44, 56, 49, 44, 52, 51, 44, 51, 51, 44, 49, 53, 49, 44, 49, 52, 49, 44, 53, 53, 44, 57, 50, 44, 52, 50, 44, 49, 49, 52, 44, 50, 57, 44, 49, 57, 50, 44, 49, 56, 57, 44, 49, 53, 49, 44, 50, 50, 48, 44, 49, 51, 49, 44, 50, 52, 54, 44, 49, 55, 51, 44, 49, 48, 57, 44, 49, 57, 53, 44, 50, 52, 57, 44, 49, 50, 53, 44, 49, 49, 49, 44, 49, 54, 57, 44, 51, 51, 44, 50, 50, 53, 44, 52, 56, 44, 50, 50, 50, 44, 50, 49, 50, 44, 49, 55, 51, 44, 52, 53, 44, 50, 49, 50, 44, 49, 50, 50, 44, 54, 53, 44, 50, 49, 49, 44, 49, 54, 53, 44, 49, 55, 49, 44, 51, 49, 44, 55, 49, 44, 57, 50, 44, 50, 52, 53, 44, 49, 50, 54, 44, 54, 44, 50, 52, 51, 44, 50, 52, 53, 44, 50, 48, 53, 44, 49, 50, 53, 44, 54, 54, 44, 50, 44, 50, 51, 57, 44, 50, 52, 56, 44, 49, 48, 44, 50, 48, 53, 44, 49, 50, 56, 44, 49, 53, 44, 56, 49, 44, 56, 44, 49, 57, 51, 44, 49, 51, 49, 44, 49, 52, 50, 44, 50, 49, 49, 44, 49, 53, 50, 44, 50, 51, 57, 44, 52, 55, 44, 49, 48, 55, 44, 49, 51, 50, 44, 49, 54, 53, 44, 49, 52, 56, 44, 49, 52, 51, 44, 49, 52, 54, 44, 49, 48, 57, 44, 50, 50, 51, 44, 49, 50, 48, 44, 50, 51, 56, 44, 51, 49, 44, 50, 56, 44, 57, 54, 44, 50, 53, 44, 49, 53, 50, 44, 50, 49, 53, 44, 56, 53, 44, 49, 51, 53, 44, 50, 53, 51, 44, 50, 51, 51, 44, 49, 57, 44, 49, 57, 57, 44, 50, 48, 49, 44, 57, 57, 44, 50, 50, 50, 44, 49, 54, 54, 44, 55, 57, 44, 49, 55, 54, 44, 55, 49, 44, 52, 49, 44, 49, 54, 49, 44, 49, 51, 52, 44, 49, 55, 53, 44, 49, 49, 57, 44, 49, 51, 57, 44, 57, 44, 49, 51, 49, 44, 49, 56, 54, 44, 49, 56, 49, 44, 49, 51, 54, 44, 49, 49, 51, 44, 49, 51, 56, 44, 51, 53, 44, 57, 56, 44, 49, 49, 48, 44, 49, 49, 55, 44, 50, 49, 48, 44, 50, 51, 56, 44, 50, 51, 48, 44, 54, 49, 44, 49, 57, 48, 44, 49, 52, 57, 44, 51, 57, 44, 50, 50, 53, 44, 54, 55, 44, 52, 50, 44, 49, 51, 56, 44, 55, 55, 44, 53, 53, 44, 50, 52, 54, 44, 55, 44, 49, 56, 48, 44, 52, 49, 44, 51, 44, 49, 52, 56, 44, 49, 52, 54, 44, 52, 53, 44, 52, 51, 44, 49, 51, 48, 44, 49, 51, 53, 44, 54, 51, 44, 53, 51, 44, 49, 54, 55, 44, 49, 56, 53, 44, 50, 52, 50, 44, 56, 48, 44, 51, 56, 44, 49, 53, 44, 57, 49, 44, 50, 51, 56, 44, 49, 51, 44, 49, 51, 44, 49, 51, 55, 44, 49, 50, 52, 44, 49, 52, 44, 49, 48, 49, 44, 49, 53, 48, 44, 50, 53, 51, 44, 53, 48, 44, 52, 55, 44, 49, 49, 49, 44, 50, 52, 48, 44, 49, 48, 52, 44, 50, 48, 55, 44, 55, 53, 44, 49, 50, 55, 44, 49, 53, 48, 44, 49, 48, 52, 44, 49, 48, 56, 44, 49, 56, 50, 44, 49, 57, 44, 54, 44, 49, 54, 57, 44, 49, 48, 48, 44, 49, 48, 48, 44, 49, 48, 53, 44, 49, 54, 54, 44, 49, 50, 50, 44, 51, 54, 44, 52, 54, 44, 49, 55, 57, 44, 49, 48, 50, 44, 50, 55, 44, 55, 53, 44, 52, 56, 44, 49, 49, 50, 44, 51, 54, 44, 49, 55, 55, 44, 50, 48, 44, 53, 48, 44, 55, 56, 44, 55, 49, 44, 54, 48, 44, 50, 51, 48, 44, 49, 53, 50, 44, 55, 52, 44, 49, 52, 48, 44, 50, 52, 44, 54, 54, 44, 49, 49, 48, 44, 54, 49, 44, 49, 57, 54, 44, 50, 48, 53, 44, 48, 44, 50, 49, 54, 93, 44, 91, 49, 44, 49, 49, 51, 44, 57, 53, 44, 56, 57, 44, 49, 49, 44, 54, 57, 44, 49, 53, 50, 44, 57, 48, 44, 49, 56, 44, 50, 49, 54, 44, 50, 52, 44, 49, 53, 54, 44, 54, 54, 44, 49, 57, 49, 44, 50, 48, 51, 44, 49, 49, 55, 44, 49, 48, 44, 50, 48, 56, 44, 57, 57, 44, 49, 51, 51, 44, 54, 52, 44, 52, 50, 44, 49, 50, 50, 44, 57, 54, 44, 49, 57, 52, 44, 49, 55, 55, 44, 55, 48, 44, 49, 51, 56, 44, 49, 55, 55, 44, 49, 53, 57, 44, 51, 51, 44, 49, 50, 52, 44, 49, 56, 52, 44, 49, 56, 51, 44, 49, 49, 50, 44, 49, 53, 52, 44, 53, 56, 44, 50, 50, 48, 44, 49, 56, 50, 44, 56, 49, 44, 56, 54, 44, 49, 51, 49, 44, 49, 56, 57, 44, 50, 48, 57, 44, 51, 53, 44, 49, 50, 52, 44, 49, 57, 51, 44, 50, 51, 53, 44, 49, 50, 56, 44, 49, 50, 54, 44, 49, 53, 48, 44, 49, 57, 56, 44, 49, 55, 56, 44, 49, 49, 53, 44, 49, 56, 52, 44, 49, 56, 52, 44, 56, 57, 44, 51, 51, 44, 50, 51, 48, 44, 49, 55, 48, 44, 49, 54, 54, 44, 53, 51, 44, 49, 55, 50, 44, 50, 50, 49, 44, 56, 49, 44, 49, 49, 54, 44, 49, 57, 54, 44, 49, 57, 57, 44, 49, 56, 57, 44, 49, 54, 48, 44, 50, 50, 53, 44, 49, 49, 55, 44, 50, 52, 56, 44, 49, 48, 50, 44, 49, 49, 57, 44, 49, 51, 54, 44, 51, 55, 44, 51, 50, 44, 52, 51, 44, 49, 52, 56, 44, 50, 53, 52, 44, 49, 55, 51, 44, 49, 52, 50, 44, 51, 55, 44, 50, 51, 49, 44, 49, 54, 48, 44, 49, 55, 56, 44, 49, 52, 55, 44, 56, 54, 44, 57, 55, 44, 49, 55, 57, 44, 50, 51, 44, 50, 50, 49, 44, 49, 57, 57, 44, 50, 48, 51, 44, 49, 49, 49, 44, 49, 52, 52, 44, 50, 48, 51, 44, 56, 56, 44, 53, 56, 44, 57, 55, 44, 49, 55, 55, 44, 50, 53, 49, 44, 49, 52, 50, 44, 50, 55, 44, 50, 53, 52, 44, 49, 56, 52, 44, 55, 57, 44, 49, 50, 55, 44, 49, 49, 53, 44, 50, 53, 53, 44, 50, 50, 48, 44, 49, 51, 53, 44, 50, 51, 48, 44, 50, 52, 52, 44, 50, 50, 54, 44, 54, 52, 44, 49, 53, 53, 44, 49, 55, 55, 44, 57, 57, 44, 51, 49, 44, 49, 48, 49, 44, 50, 57, 44, 49, 51, 55, 44, 56, 50, 44, 49, 51, 56, 44, 49, 51, 48, 44, 50, 48, 54, 44, 50, 55, 44, 50, 49, 52, 44, 52, 52, 44, 54, 48, 44, 49, 50, 51, 44, 49, 54, 53, 44, 50, 52, 48, 44, 57, 51, 44, 49, 50, 48, 44, 50, 50, 49, 44, 49, 55, 53, 44, 49, 57, 55, 44, 56, 54, 44, 50, 48, 57, 44, 49, 54, 53, 44, 49, 54, 57, 44, 49, 50, 54, 44, 49, 50, 48, 44, 50, 54, 44, 56, 55, 44, 50, 48, 56, 44, 55, 54, 44, 49, 52, 55, 44, 50, 52, 53, 44, 57, 55, 44, 49, 52, 54, 44, 49, 57, 44, 53, 48, 44, 49, 50, 50, 44, 49, 53, 48, 44, 55, 56, 44, 49, 50, 50, 44, 57, 49, 44, 50, 48, 52, 44, 52, 51, 44, 53, 44, 50, 51, 44, 49, 54, 53, 44, 56, 55, 44, 49, 57, 52, 44, 49, 53, 54, 44, 50, 51, 51, 44, 49, 56, 49, 44, 49, 57, 52, 44, 49, 49, 51, 44, 51, 48, 44, 52, 49, 44, 53, 52, 44, 57, 50, 44, 53, 54, 44, 50, 48, 50, 44, 56, 57, 44, 49, 57, 51, 44, 50, 50, 49, 44, 57, 50, 44, 49, 55, 48, 44, 49, 48, 54, 44, 49, 57, 56, 44, 56, 54, 44, 50, 49, 54, 44, 49, 56, 54, 44, 50, 57, 44, 50, 49, 57, 44, 52, 50, 44, 50, 53, 44, 49, 51, 55, 44, 49, 54, 44, 50, 53, 50, 44, 49, 54, 51, 44, 49, 50, 49, 44, 49, 48, 52, 44, 57, 49, 44, 50, 49, 50, 44, 56, 44, 49, 55, 48, 44, 57, 52, 44, 53, 55, 44, 49, 49, 50, 44, 50, 50, 57, 44, 50, 51, 53, 44, 49, 55, 53, 44, 56, 55, 44, 49, 52, 54, 44, 51, 56, 44, 50, 52, 48, 44, 49, 52, 51, 44, 56, 53, 44, 49, 56, 52, 44, 50, 50, 49, 44, 49, 49, 50, 44, 55, 53, 44, 50, 44, 53, 51, 44, 50, 49, 56, 44, 55, 49, 44, 50, 48, 49, 44, 49, 54, 57, 44, 49, 57, 44, 49, 53, 44, 52, 54, 44, 49, 53, 52, 44, 50, 50, 57, 44, 49, 56, 55, 44, 52, 49, 44, 50, 51, 54, 44, 50, 48, 50, 44, 50, 48, 44, 49, 51, 52, 44, 50, 48, 50, 44, 49, 53, 52, 44, 52, 50, 44, 49, 56, 48, 44, 49, 54, 55, 44, 55, 48, 44, 50, 49, 49, 44, 51, 49, 44, 49, 48, 52, 44, 49, 50, 51, 44, 50, 53, 53, 44, 56, 49, 44, 50, 53, 44, 53, 49, 44, 53, 57, 44, 49, 54, 57, 44, 49, 50, 55, 44, 52, 56, 44, 50, 52, 50, 44, 49, 56, 50, 44, 49, 57, 52, 93, 44, 91, 49, 44, 52, 52, 44, 50, 48, 53, 44, 49, 56, 48, 44, 55, 52, 44, 55, 51, 44, 56, 57, 44, 50, 50, 54, 44, 50, 50, 44, 51, 56, 44, 49, 54, 50, 44, 49, 54, 57, 44, 49, 54, 49, 44, 50, 48, 55, 44, 49, 56, 51, 44, 53, 56, 44, 53, 57, 44, 55, 51, 44, 51, 56, 44, 52, 57, 44, 50, 51, 53, 44, 49, 55, 49, 44, 49, 57, 48, 44, 49, 51, 48, 44, 49, 52, 49, 44, 50, 53, 53, 44, 49, 51, 57, 44, 50, 52, 55, 44, 55, 51, 44, 50, 51, 44, 49, 56, 49, 44, 49, 51, 48, 44, 49, 48, 48, 44, 55, 56, 44, 49, 55, 48, 44, 52, 50, 44, 49, 56, 48, 44, 49, 56, 48, 44, 52, 53, 44, 49, 52, 57, 44, 51, 52, 44, 52, 55, 44, 49, 57, 57, 44, 49, 50, 56, 44, 51, 50, 44, 54, 53, 44, 49, 49, 44, 52, 49, 44, 52, 57, 44, 54, 52, 44, 49, 53, 52, 44, 50, 50, 56, 44, 49, 52, 51, 44, 49, 56, 48, 44, 49, 54, 50, 44, 50, 52, 50, 44, 49, 49, 49, 44, 49, 53, 51, 44, 51, 57, 44, 50, 52, 48, 44, 55, 50, 44, 49, 51, 53, 44, 49, 53, 54, 44, 56, 48, 44, 50, 49, 51, 44, 49, 49, 57, 44, 53, 49, 44, 50, 50, 49, 44, 50, 48, 48, 44, 52, 54, 44, 49, 54, 48, 44, 50, 53, 49, 44, 48, 44, 49, 54, 51, 44, 49, 44, 57, 55, 44, 49, 57, 56, 44, 49, 57, 48, 44, 49, 55, 51, 44, 49, 52, 56, 44, 50, 51, 49, 44, 54, 44, 50, 48, 56, 44, 53, 44, 50, 52, 54, 44, 49, 55, 54, 44, 50, 51, 54, 44, 53, 48, 44, 49, 55, 44, 50, 53, 49, 44, 50, 53, 49, 44, 56, 49, 44, 50, 49, 49, 44, 57, 56, 44, 50, 50, 48, 44, 49, 53, 54, 44, 49, 51, 55, 44, 50, 52, 50, 44, 49, 49, 48, 44, 52, 44, 56, 44, 51, 51, 44, 49, 53, 48, 44, 50, 50, 56, 44, 54, 48, 44, 49, 54, 53, 44, 49, 53, 50, 44, 56, 54, 44, 49, 54, 54, 44, 50, 50, 50, 44, 49, 57, 56, 44, 49, 54, 54, 44, 49, 52, 54, 44, 56, 52, 44, 54, 49, 44, 49, 49, 51, 44, 49, 48, 48, 44, 54, 49, 44, 50, 44, 49, 55, 50, 44, 55, 52, 44, 51, 52, 44, 50, 50, 48, 44, 49, 50, 55, 44, 50, 51, 51, 44, 49, 49, 57, 44, 50, 48, 54, 44, 57, 50, 44, 49, 48, 55, 44, 53, 51, 44, 52, 48, 44, 49, 50, 52, 44, 50, 48, 54, 44, 53, 54, 44, 49, 56, 49, 44, 50, 51, 56, 44, 49, 53, 52, 44, 52, 53, 44, 57, 54, 44, 49, 55, 49, 44, 50, 49, 57, 44, 52, 54, 44, 49, 54, 48, 44, 55, 44, 54, 44, 50, 53, 53, 44, 53, 53, 44, 49, 54, 57, 44, 49, 49, 54, 44, 49, 55, 48, 44, 49, 52, 51, 44, 51, 53, 44, 49, 50, 56, 44, 50, 51, 56, 44, 56, 52, 44, 50, 48, 54, 44, 49, 51, 44, 50, 50, 52, 44, 49, 52, 57, 44, 57, 55, 44, 50, 51, 56, 44, 49, 57, 53, 44, 49, 48, 56, 44, 52, 55, 44, 54, 55, 44, 50, 53, 51, 44, 49, 57, 53, 44, 49, 48, 51, 44, 49, 57, 52, 44, 49, 53, 53, 44, 53, 50, 44, 50, 51, 49, 44, 57, 49, 44, 53, 55, 44, 54, 44, 50, 53, 44, 49, 50, 51, 44, 52, 53, 44, 49, 49, 44, 54, 56, 44, 50, 51, 44, 49, 55, 52, 44, 49, 48, 56, 44, 52, 48, 44, 49, 54, 53, 44, 51, 57, 44, 54, 51, 44, 50, 51, 57, 44, 52, 54, 44, 49, 50, 49, 44, 50, 51, 52, 44, 49, 44, 50, 52, 50, 44, 49, 56, 50, 44, 55, 53, 44, 56, 51, 44, 55, 57, 44, 50, 49, 56, 44, 50, 53, 49, 44, 49, 55, 51, 44, 50, 50, 55, 44, 49, 57, 51, 44, 49, 55, 49, 44, 51, 48, 44, 56, 55, 44, 57, 53, 44, 50, 56, 44, 49, 55, 53, 44, 49, 55, 53, 44, 49, 51, 52, 44, 50, 51, 54, 44, 54, 54, 44, 50, 57, 44, 49, 49, 57, 44, 55, 54, 44, 50, 50, 52, 44, 56, 52, 44, 55, 55, 44, 50, 49, 53, 44, 50, 57, 44, 49, 56, 56, 44, 49, 50, 44, 50, 48, 49, 44, 50, 50, 54, 44, 50, 50, 44, 50, 52, 52, 44, 49, 52, 57, 44, 51, 48, 44, 49, 55, 55, 44, 49, 53, 57, 44, 49, 56, 49, 44, 50, 51, 44, 51, 48, 44, 55, 55, 44, 49, 49, 50, 44, 52, 54, 44, 49, 56, 48, 44, 49, 54, 48, 44, 53, 54, 44, 57, 51, 44, 49, 50, 52, 44, 50, 48, 44, 51, 57, 44, 50, 51, 50, 44, 49, 49, 57, 44, 51, 56, 44, 49, 57, 56, 44, 55, 44, 50, 51, 53, 44, 50, 48, 55, 44, 51, 56, 44, 49, 57, 55, 44, 50, 50, 57, 44, 49, 48, 50, 44, 49, 53, 56, 44, 49, 56, 50, 44, 49, 55, 48, 93, 44, 91, 49, 44, 56, 53, 44, 51, 55, 44, 49, 55, 48, 44, 55, 49, 44, 50, 50, 51, 44, 49, 51, 54, 44, 50, 48, 57, 44, 49, 56, 57, 44, 54, 54, 44, 56, 53, 44, 50, 53, 48, 44, 49, 50, 57, 44, 51, 50, 44, 50, 52, 51, 44, 54, 50, 44, 49, 49, 56, 44, 50, 49, 49, 44, 49, 54, 56, 44, 53, 44, 57, 53, 44, 50, 56, 44, 52, 52, 44, 49, 50, 57, 44, 50, 53, 48, 44, 49, 56, 53, 44, 50, 48, 51, 44, 49, 50, 51, 44, 49, 52, 55, 44, 53, 51, 44, 51, 52, 44, 50, 52, 53, 44, 49, 54, 55, 44, 50, 56, 44, 49, 54, 57, 44, 49, 52, 55, 44, 49, 56, 48, 44, 52, 50, 44, 51, 57, 44, 49, 57, 57, 44, 50, 50, 48, 44, 49, 53, 53, 44, 49, 51, 56, 44, 55, 57, 44, 50, 49, 55, 44, 50, 53, 50, 44, 49, 52, 53, 44, 49, 53, 52, 44, 55, 56, 44, 54, 49, 44, 57, 55, 44, 49, 57, 48, 44, 49, 50, 49, 44, 53, 44, 53, 44, 56, 55, 44, 53, 54, 44, 49, 52, 51, 44, 49, 54, 54, 44, 49, 51, 53, 44, 49, 56, 44, 49, 51, 53, 44, 50, 57, 44, 49, 49, 49, 44, 55, 52, 44, 49, 57, 49, 44, 50, 50, 50, 44, 55, 52, 44, 49, 49, 54, 44, 54, 48, 44, 56, 56, 44, 50, 52, 55, 44, 49, 53, 44, 49, 53, 49, 44, 50, 50, 55, 44, 50, 48, 48, 44, 50, 51, 51, 44, 54, 51, 44, 52, 52, 44, 49, 54, 55, 44, 57, 44, 50, 52, 54, 44, 55, 50, 44, 50, 48, 48, 44, 50, 53, 50, 44, 56, 48, 44, 49, 49, 48, 44, 49, 54, 52, 44, 49, 53, 44, 53, 55, 44, 49, 57, 44, 52, 53, 44, 51, 57, 44, 54, 56, 44, 50, 48, 55, 44, 49, 50, 55, 44, 49, 52, 44, 49, 57, 50, 44, 51, 44, 49, 51, 54, 44, 50, 51, 51, 44, 56, 53, 44, 50, 51, 50, 44, 55, 57, 44, 49, 53, 51, 44, 57, 57, 44, 53, 55, 44, 50, 49, 54, 44, 49, 53, 50, 44, 49, 53, 56, 44, 57, 52, 44, 50, 51, 52, 44, 55, 54, 44, 49, 56, 49, 44, 52, 53, 44, 49, 57, 57, 44, 52, 50, 44, 52, 52, 44, 53, 52, 44, 54, 44, 55, 57, 44, 55, 56, 44, 49, 52, 54, 44, 50, 49, 53, 44, 49, 57, 52, 44, 49, 49, 50, 44, 49, 55, 48, 44, 57, 53, 44, 49, 55, 54, 44, 50, 48, 52, 44, 49, 54, 55, 44, 51, 44, 49, 55, 44, 53, 49, 44, 49, 54, 48, 44, 49, 57, 55, 44, 49, 55, 44, 50, 51, 55, 44, 49, 44, 49, 50, 53, 44, 50, 50, 49, 44, 53, 49, 44, 50, 50, 57, 44, 50, 48, 55, 44, 49, 48, 57, 44, 50, 49, 49, 44, 50, 50, 51, 44, 50, 50, 57, 44, 53, 44, 49, 53, 52, 44, 55, 56, 44, 49, 54, 51, 44, 50, 51, 51, 44, 51, 52, 44, 57, 51, 44, 49, 57, 55, 44, 50, 49, 57, 44, 49, 55, 56, 44, 57, 50, 44, 49, 57, 49, 44, 50, 50, 57, 44, 49, 51, 44, 49, 53, 56, 44, 50, 48, 51, 44, 51, 55, 44, 53, 51, 44, 49, 57, 55, 44, 57, 54, 44, 52, 48, 44, 49, 53, 57, 44, 54, 49, 44, 49, 48, 54, 44, 55, 52, 44, 53, 50, 44, 49, 57, 48, 44, 49, 52, 44, 55, 53, 44, 49, 56, 48, 44, 56, 44, 50, 48, 50, 44, 50, 52, 55, 44, 56, 52, 44, 49, 57, 56, 44, 49, 53, 48, 44, 49, 48, 52, 44, 49, 52, 49, 44, 56, 56, 44, 53, 53, 44, 49, 51, 54, 44, 49, 57, 49, 44, 49, 55, 44, 49, 57, 48, 44, 53, 55, 44, 50, 49, 48, 44, 57, 54, 44, 52, 49, 44, 52, 52, 44, 49, 55, 57, 44, 49, 54, 57, 44, 53, 55, 44, 50, 51, 54, 44, 49, 55, 54, 44, 51, 48, 44, 49, 57, 48, 44, 53, 50, 44, 57, 55, 44, 49, 54, 53, 44, 53, 51, 44, 53, 49, 44, 48, 44, 49, 51, 52, 44, 56, 50, 44, 56, 54, 44, 54, 52, 44, 49, 49, 53, 44, 49, 51, 56, 44, 56, 57, 44, 49, 49, 44, 49, 57, 50, 44, 50, 53, 48, 44, 49, 54, 49, 44, 49, 54, 48, 44, 52, 52, 44, 57, 52, 44, 51, 53, 44, 49, 53, 54, 44, 50, 52, 57, 44, 53, 49, 44, 49, 48, 48, 44, 50, 52, 54, 44, 55, 56, 44, 55, 48, 44, 52, 56, 44, 50, 52, 44, 50, 50, 54, 44, 54, 51, 44, 54, 55, 44, 50, 50, 49, 44, 50, 49, 54, 44, 50, 51, 48, 44, 54, 53, 44, 50, 56, 44, 49, 52, 57, 44, 53, 57, 44, 55, 55, 44, 49, 57, 55, 44, 49, 55, 50, 44, 49, 56, 57, 44, 50, 48, 56, 44, 54, 44, 49, 57, 53, 44, 50, 49, 57, 44, 49, 48, 49, 44, 56, 51, 44, 49, 51, 55, 44, 54, 50, 44, 50, 48, 56, 93, 93, 125, 125, 44, 92, 34, 114, 101, 113, 117, 101, 115, 116, 101, 100, 95, 112, 114, 111, 111, 102, 92, 34, 58, 123, 92, 34, 114, 101, 118, 101, 97, 108, 101, 100, 95, 97, 116, 116, 114, 115, 92, 34, 58, 123, 92, 34, 97, 116, 116, 114, 49, 95, 114, 101, 102, 101, 114, 101, 110, 116, 92, 34, 58, 123, 92, 34, 115, 117, 98, 95, 112, 114, 111, 111, 102, 95, 105, 110, 100, 101, 120, 92, 34, 58, 48, 44, 92, 34, 114, 97, 119, 92, 34, 58, 92, 34, 65, 108, 101, 120, 92, 34, 44, 92, 34, 101, 110, 99, 111, 100, 101, 100, 92, 34, 58, 92, 34, 49, 49, 51, 57, 52, 56, 49, 55, 49, 54, 52, 53, 55, 52, 56, 56, 54, 57, 48, 49, 55, 50, 50, 49, 55, 57, 49, 54, 50, 55, 56, 49, 48, 51, 51, 51, 53, 92, 34, 125, 125, 44, 92, 34, 115, 101, 108, 102, 95, 97, 116, 116, 101, 115, 116, 101, 100, 95, 97, 116, 116, 114, 115, 92, 34, 58, 123, 92, 34, 97, 116, 116, 114, 51, 95, 114, 101, 102, 101, 114, 101, 110, 116, 92, 34, 58, 92, 34, 56, 45, 56, 48, 48, 45, 51, 48, 48, 92, 34, 125, 44, 92, 34, 117, 110, 114, 101, 118, 101, 97, 108, 101, 100, 95, 97, 116, 116, 114, 115, 92, 34, 58, 123, 92, 34, 97, 116, 116, 114, 50, 95, 114, 101, 102, 101, 114, 101, 110, 116, 92, 34, 58, 123, 92, 34, 115, 117, 98, 95, 112, 114, 111, 111, 102, 95, 105, 110, 100, 101, 120, 92, 34, 58, 48, 125, 125, 44, 92, 34, 112, 114, 101, 100, 105, 99, 97, 116, 101, 115, 92, 34, 58, 123, 92, 34, 112, 114, 101, 100, 105, 99, 97, 116, 101, 49, 95, 114, 101, 102, 101, 114, 101, 110, 116, 92, 34, 58, 123, 92, 34, 115, 117, 98, 95, 112, 114, 111, 111, 102, 95, 105, 110, 100, 101, 120, 92, 34, 58, 48, 125, 125, 125, 44, 92, 34, 105, 100, 101, 110, 116, 105, 102, 105, 101, 114, 115, 92, 34, 58, 91, 123, 92, 34, 115, 99, 104, 101, 109, 97, 95, 105, 100, 92, 34, 58, 92, 34, 78, 99, 89, 120, 105, 68, 88, 107, 112, 89, 105, 54, 111, 118, 53, 70, 99, 89, 68, 105, 49, 101, 58, 50, 58, 103, 118, 116, 58, 49, 46, 48, 92, 34, 44, 92, 34, 99, 114, 101, 100, 95, 100, 101, 102, 95, 105, 100, 92, 34, 58, 92, 34, 78, 99, 89, 120, 105, 68, 88, 107, 112, 89, 105, 54, 111, 118, 53, 70, 99, 89, 68, 105, 49, 101, 58, 51, 58, 67, 76, 58, 78, 99, 89, 120, 105, 68, 88, 107, 112, 89, 105, 54, 111, 118, 53, 70, 99, 89, 68, 105, 49, 101, 58, 50, 58, 103, 118, 116, 58, 49, 46, 48, 92, 34, 44, 92, 34, 114, 101, 118, 95, 114, 101, 103, 95, 105, 100, 92, 34, 58, 110, 117, 108, 108, 44, 92, 34, 116, 105, 109, 101, 115, 116, 97, 109, 112, 92, 34, 58, 110, 117, 108, 108, 125, 93, 125, 34, 125, 204, 169, 115, 101, 110, 100, 101, 114, 68, 73, 68, 204, 182, 87, 86, 115, 87, 86, 104, 56, 110, 76, 57, 54, 66, 69, 51, 84, 51, 113, 119, 97, 67, 100, 53, 204, 163, 117, 105, 100, 204, 167, 109, 109, 105, 51, 121, 122, 101, 204, 164, 116, 121, 112, 101, 204, 165, 112, 114, 111, 111, 102, 204, 168, 114, 101, 102, 77, 115, 103, 73, 100, 204, 192, 204, 175, 100, 101, 108, 105, 118, 101, 114, 121, 68, 101, 116, 97, 105, 108, 115, 204, 145, 204, 131, 204, 162, 116, 111, 204, 182, 51, 88, 107, 57, 118, 120, 75, 57, 106, 101, 105, 113, 86, 97, 67, 80, 114, 69, 81, 56, 98, 103, 204, 170, 115, 116, 97, 116, 117, 115, 67, 111, 100, 101, 204, 167, 77, 68, 83, 45, 49, 48, 49, 204, 179, 108, 97, 115, 116, 85, 112, 100, 97, 116, 101, 100, 68, 97, 116, 101, 84, 105, 109, 101, 204, 189, 50, 48, 49, 55, 45, 49, 50, 45, 49, 52, 84, 48, 51, 58, 51, 53, 58, 50, 48, 46, 52, 52, 52, 90, 91, 85, 84, 67, 93]; -#[cfg(test)] -pub const MY1_SEED: &str = "00000000000000000000000000000My1"; -#[cfg(test)] -pub const MY2_SEED: &str = "00000000000000000000000000000My2"; -#[cfg(test)] -pub const MY3_SEED: &str = "00000000000000000000000000000My3"; -#[cfg(test)] -pub const MY4_SEED: &str = "00000000000000000000000000000My4"; pub const DID: &str = "FhrSrYtQcw3p9xwf7NYemf"; pub const VERKEY: &str = "91qMFrZjXDoi2Vc8Mm14Ys112tEZdDegBZZoembFEATE"; #[cfg(test)] diff --git a/libvcx/src/utils/devsetup.rs b/libvcx/src/utils/devsetup.rs index 6836ed21c2..b03e8526cc 100644 --- a/libvcx/src/utils/devsetup.rs +++ b/libvcx/src/utils/devsetup.rs @@ -6,10 +6,9 @@ use indy::WalletHandle; use rand::Rng; use serde_json::Value; -use ::{indy, init}; -use ::{settings, utils}; -use agency_comm::agency_settings; -use agency_comm::mocking::AgencyMockDecrypted; +use ::{init, settings, utils}; +use agency_client::agency_settings; +use agency_client::mocking::{AgencyMockDecrypted, enable_agency_mocks, disable_agency_mocks}; use libindy::utils::pool::reset_pool_handle; use libindy::utils::pool::tests::{create_test_ledger_config, delete_test_pool, open_test_pool}; use libindy::utils::wallet::{close_main_wallet, create_wallet, delete_wallet, reset_wallet_handle}; @@ -79,6 +78,7 @@ fn tear_down() { settings::clear_config(); reset_wallet_handle(); reset_pool_handle(); + disable_agency_mocks(); AgencyMockDecrypted::clear_mocks(); } @@ -112,7 +112,7 @@ impl SetupMocks { pub fn init() -> SetupMocks { setup(); settings::set_config_value(settings::CONFIG_ENABLE_TEST_MODE, "true"); - agency_settings::set_config_value(settings::CONFIG_ENABLE_TEST_MODE, "true"); + enable_agency_mocks(); SetupMocks } } @@ -211,7 +211,7 @@ impl SetupIndyMocks { pub fn init() -> SetupIndyMocks { setup(); settings::set_config_value(settings::CONFIG_ENABLE_TEST_MODE, "true"); - agency_settings::set_config_value(settings::CONFIG_ENABLE_TEST_MODE, "true"); + enable_agency_mocks(); SetupIndyMocks {} } } @@ -435,7 +435,7 @@ pub fn set_consumer(consumer_handle: Option) { fn change_wallet_handle() { let wallet_handle = settings::get_config_value(settings::CONFIG_WALLET_HANDLE).unwrap(); - unsafe { wallet::WALLET_HANDLE = WalletHandle(wallet_handle.parse::().unwrap()) } + wallet::set_wallet_handle(WalletHandle(wallet_handle.parse::().unwrap())); } fn assign_trustee_role(institution_handle: Option) { @@ -477,7 +477,7 @@ pub fn setup_agency_env(use_zero_fees: bool) { }); debug!("setup_agency_env >> Going to provision enterprise using config: {:?}", &config); - let enterprise_config = ::agency_comm::utils::agent_utils::connect_register_provision(&config.to_string()).unwrap(); + let enterprise_config = ::utils::provision::connect_register_provision(&config.to_string()).unwrap(); ::api::vcx::vcx_shutdown(false); @@ -498,7 +498,7 @@ pub fn setup_agency_env(use_zero_fees: bool) { }); debug!("setup_agency_env >> Going to provision consumer using config: {:?}", &config); - let consumer_config = ::agency_comm::utils::agent_utils::connect_register_provision(&config.to_string()).unwrap(); + let consumer_config = ::utils::provision::connect_register_provision(&config.to_string()).unwrap(); unsafe { INSTITUTION_CONFIG = CONFIG_STRING.add(config_with_wallet_handle(&enterprise_wallet_name, &enterprise_config)).unwrap(); @@ -548,7 +548,7 @@ pub fn create_consumer_config() -> u32 { }); debug!("create_consumer_config >> Going to provision consumer using config: {:?}", &config); - let consumer_config = ::agency_comm::utils::agent_utils::connect_register_provision(&config.to_string()).unwrap(); + let consumer_config = ::utils::provision::connect_register_provision(&config.to_string()).unwrap(); CONFIG_STRING.add(config_with_wallet_handle(&consumer_wallet_name, &consumer_config.to_string())).unwrap() } @@ -577,7 +577,7 @@ pub fn create_institution_config() -> u32 { }); debug!("create_institution_config >> Going to provision enterprise using config: {:?}", &config); - let enterprise_config = ::agency_comm::utils::agent_utils::connect_register_provision(&config.to_string()).unwrap(); + let enterprise_config = ::utils::provision::connect_register_provision(&config.to_string()).unwrap(); let handle = CONFIG_STRING.add(config_with_wallet_handle(&enterprise_wallet_name, &enterprise_config.to_string())).unwrap(); diff --git a/libvcx/src/utils/error.rs b/libvcx/src/utils/error.rs index f74b203eaa..023aa47bde 100644 --- a/libvcx/src/utils/error.rs +++ b/libvcx/src/utils/error.rs @@ -243,6 +243,12 @@ pub struct Error { pub message: &'static str, } +impl Error { + pub fn get_code(&self) -> u32 { + self.code_num + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let msg = error_message(&self.code_num); diff --git a/libvcx/src/utils/mockdata/mockdata_agency.rs b/libvcx/src/utils/mockdata/mockdata_agency.rs deleted file mode 100644 index 908d5d7319..0000000000 --- a/libvcx/src/utils/mockdata/mockdata_agency.rs +++ /dev/null @@ -1,20 +0,0 @@ -pub const AGENCY_MSG_STATUS_UPDATED_BY_CONNS: &str = r#" -{ - "@type": "did:sov:123456789abcdefghi1234;spec/pairwise/1.0/MSG_STATUS_UPDATED_BY_CONNS", - "failed": [], - "updatedUidsByConns": [ - { - "pairwiseDID": "6FRuB95abcmzz1nURoHyWE", - "uids": [ - "Br4CoNP4TU" - ] - } - ] -}"#; - -pub const AGENCY_CONFIGS_UPDATED: &str = r#" -{ - "@type": "did:sov:123456789abcdefghi1234;spec/configs/1.0/CONFIGS_UPDATED" -}"#; - - diff --git a/libvcx/src/utils/mockdata/mockdata_connection.rs b/libvcx/src/utils/mockdata/mockdata_connection.rs index 40cf315e11..18440c0b84 100644 --- a/libvcx/src/utils/mockdata/mockdata_connection.rs +++ b/libvcx/src/utils/mockdata/mockdata_connection.rs @@ -17,7 +17,7 @@ pub const ARIES_CONNECTION_INVITATION: &str = r#" // Alice created and serialized connection created from received invitation pub const CONNECTION_SM_INVITEE_INVITED: &str = r#" { - "version": "3.0", + "version": "1.0", "source_id": "alice-670c6360-5c0e-4495-bd25-2ee58c39fc7e", "data": { "pw_did": "", @@ -93,7 +93,7 @@ pub const ARIES_CONNECTION_REQUEST: &str = r#" // Alice sends connection request to Faber pub const CONNECTION_SM_INVITEE_REQUESTED: &str = r#" { - "version": "3.0", + "version": "1.0", "source_id": "alice-670c6360-5c0e-4495-bd25-2ee58c39fc7e", "data": { "pw_did": "KC6NKcpXcpVnpjL8uKH3tV", @@ -204,7 +204,7 @@ pub const ARIES_CONNECTION_RESPONSE: &str = r#" // Alice (invitee) connection SM after Faber accepted connection by sending connection response pub const CONNECTION_SM_INVITEE_COMPLETED: &str = r#" { - "version": "3.0", + "version": "1.0", "source_id": "alice-670c6360-5c0e-4495-bd25-2ee58c39fc7e", "data": { "pw_did": "KC6NKcpXcpVnpjL8uKH3tV", @@ -270,7 +270,7 @@ pub const ARIES_CONNECTION_ACK: &str = r#" // Inviter (Faber) after finished connection protocol by sending connection ack pub const CONNECTION_SM_INVITER_COMPLETED: &str = r#" { - "version": "3.0", + "version": "1.0", "source_id": "alice-131bc1e2-fa29-404c-a87c-69983e02084d", "data": { "pw_did": "2ZHFFhzA2XtTD6hJqzL7ux", @@ -322,7 +322,7 @@ pub const CONNECTION_SM_INVITER_COMPLETED: &str = r#" pub const DEFAULT_SERIALIZED_CONNECTION: &str = r#" { - "version": "3.0", + "version": "1.0", "source_id": "test_serialize_deserialize", "data": { "pw_did": "", diff --git a/libvcx/src/utils/mockdata/mod.rs b/libvcx/src/utils/mockdata/mod.rs index 810fc7f11d..99656fbe93 100644 --- a/libvcx/src/utils/mockdata/mod.rs +++ b/libvcx/src/utils/mockdata/mod.rs @@ -1,5 +1,4 @@ pub mod mockdata_credex; pub mod mockdata_connection; pub mod mockdata_proof; -pub mod mockdata_agency; pub mod mock_settings; diff --git a/libvcx/src/utils/mod.rs b/libvcx/src/utils/mod.rs index ce2efb3bd4..93e850bb16 100644 --- a/libvcx/src/utils/mod.rs +++ b/libvcx/src/utils/mod.rs @@ -40,7 +40,6 @@ macro_rules! map ( ); pub mod error; -pub mod httpclient; pub mod constants; pub mod timeout; pub mod openssl; @@ -50,8 +49,8 @@ pub mod uuid; pub mod author_agreement; pub mod qualifier; pub mod file; -pub mod option_util; pub mod mockdata; +pub mod provision; #[cfg(test)] pub mod plugins; diff --git a/libvcx/src/utils/option_util.rs b/libvcx/src/utils/option_util.rs index 70438e0964..e69de29bb2 100644 --- a/libvcx/src/utils/option_util.rs +++ b/libvcx/src/utils/option_util.rs @@ -1,10 +0,0 @@ -use error::{VcxError, VcxErrorKind, VcxResult}; - -pub fn get_or_default(config: &Option, default: &str) -> String { - config.to_owned().unwrap_or(default.to_string()) -} - -pub fn get_or_err(config: &Option, err: Option) -> VcxResult { - let e = VcxError::from(err.unwrap_or(VcxErrorKind::InvalidOption)); - config.to_owned().ok_or(e) -} diff --git a/libvcx/src/agency_comm/utils/agent_utils.rs b/libvcx/src/utils/provision.rs similarity index 52% rename from libvcx/src/agency_comm/utils/agent_utils.rs rename to libvcx/src/utils/provision.rs index 97cc689545..c9ae8ddb72 100644 --- a/libvcx/src/agency_comm/utils/agent_utils.rs +++ b/libvcx/src/utils/provision.rs @@ -1,151 +1,10 @@ -use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; -use serde_json::Value; +use serde::Deserialize; -use agency_comm::{A2AMessage, A2AMessageKinds, A2AMessageV2, agency_settings, parse_response_from_agency, prepare_message_for_agency}; -use crate::agency_comm::mocking::agency_mocks_enabled; -use agency_comm::message_type::MessageTypes; -use agency_comm::mocking::AgencyMockDecrypted; +use agency_client::agency_settings; +use agency_client::utils::agent_utils; +use libindy::utils::{anoncreds, wallet, signus}; use error::prelude::*; -use libindy::utils::{anoncreds, wallet}; -use libindy::utils::signus::create_and_store_my_did; -use libindy::utils::wallet::get_wallet_handle; use settings; -use utils::{constants, error, httpclient}; -use utils::option_util::get_or_default; -use agency_comm::utils::comm::post_to_agency; - -#[derive(Serialize, Deserialize, Debug)] -pub struct Connect { - #[serde(rename = "@type")] - msg_type: MessageTypes, - #[serde(rename = "fromDID")] - from_did: String, - #[serde(rename = "fromDIDVerKey")] - from_vk: String, -} - -impl Connect { - fn build(from_did: &str, from_vk: &str) -> Connect { - Connect { - msg_type: MessageTypes::build(A2AMessageKinds::Connect), - from_did: from_did.to_string(), - from_vk: from_vk.to_string(), - } - } -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct ConnectResponse { - #[serde(rename = "@type")] - msg_type: MessageTypes, - #[serde(rename = "withPairwiseDID")] - from_did: String, - #[serde(rename = "withPairwiseDIDVerKey")] - from_vk: String, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct SignUp { - #[serde(rename = "@type")] - msg_type: MessageTypes, -} - -impl SignUp { - fn build() -> SignUp { - SignUp { - msg_type: MessageTypes::build(A2AMessageKinds::SignUp), - } - } -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct SignUpResponse { - #[serde(rename = "@type")] - msg_type: MessageTypes, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct CreateAgent { - #[serde(rename = "@type")] - msg_type: MessageTypes, -} - -impl CreateAgent { - fn build() -> CreateAgent { - CreateAgent { - msg_type: MessageTypes::build(A2AMessageKinds::CreateAgent), - } - } -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct CreateAgentResponse { - #[serde(rename = "@type")] - msg_type: MessageTypes, - #[serde(rename = "withPairwiseDID")] - from_did: String, - #[serde(rename = "withPairwiseDIDVerKey")] - from_vk: String, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct ComMethodUpdated { - #[serde(rename = "@type")] - msg_type: MessageTypes, - id: String, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct UpdateComMethod { - #[serde(rename = "@type")] - msg_type: MessageTypes, - #[serde(rename = "comMethod")] - com_method: ComMethod, -} - -#[derive(Debug, PartialEq)] -pub enum ComMethodType { - A2A, - Webhook, -} - -impl Serialize for ComMethodType { - fn serialize(&self, serializer: S) -> Result where S: Serializer { - let value = match self { - ComMethodType::A2A => "1", - ComMethodType::Webhook => "2", - }; - Value::String(value.to_string()).serialize(serializer) - } -} - -impl<'de> Deserialize<'de> for ComMethodType { - fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { - let value = Value::deserialize(deserializer).map_err(de::Error::custom)?; - match value.as_str() { - Some("1") => Ok(ComMethodType::A2A), - Some("2") => Ok(ComMethodType::Webhook), - _ => Err(de::Error::custom("Unexpected communication method type.")) - } - } -} - -impl UpdateComMethod { - fn build(com_method: ComMethod) -> UpdateComMethod { - UpdateComMethod { - msg_type: MessageTypes::build(A2AMessageKinds::UpdateComMethod), - com_method, - } - } -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct ComMethod { - id: String, - #[serde(rename = "type")] - e_type: ComMethodType, - value: String, -} #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Config { @@ -168,6 +27,21 @@ pub struct Config { use_latest_protocols: Option, } +pub fn parse_config(config: &str) -> VcxResult { + let my_config: Config = ::serde_json::from_str(&config) + .map_err(|err| + VcxError::from_msg( + VcxErrorKind::InvalidConfiguration, + format!("Cannot parse config: {}", err), + ) + )?; + Ok(my_config) +} + +pub fn get_or_default(config: &Option, default: &str) -> String { + config.to_owned().unwrap_or(default.to_string()) +} + pub fn set_config_values(my_config: &Config) { let wallet_name = get_or_default(&my_config.wallet_name, settings::DEFAULT_WALLET_NAME); @@ -187,17 +61,6 @@ pub fn set_config_values(my_config: &Config) { settings::set_opt_config_value(settings::CONFIG_WEBHOOK_URL, &my_config.webhook_url); } -fn _create_issuer_keys(my_did: &str, my_vk: &str, my_config: &Config) -> VcxResult<(String, String)> { - if my_config.enterprise_seed == my_config.agent_seed { - Ok((my_did.to_string(), my_vk.to_string())) - } else { - create_and_store_my_did( - my_config.enterprise_seed.as_ref().map(String::as_str), - my_config.did_method.as_ref().map(String::as_str), - ) - } -} - pub fn configure_wallet(my_config: &Config) -> VcxResult<(String, String, String)> { let wallet_name = get_or_default(&my_config.wallet_name, settings::DEFAULT_WALLET_NAME); @@ -214,7 +77,7 @@ pub fn configure_wallet(my_config: &Config) -> VcxResult<(String, String, String // If MS is already in wallet then just continue anoncreds::libindy_prover_create_master_secret(::settings::DEFAULT_LINK_SECRET_ALIAS).ok(); - let (my_did, my_vk) = create_and_store_my_did( + let (my_did, my_vk) = signus::create_and_store_my_did( my_config.agent_seed.as_ref().map(String::as_str), my_config.did_method.as_ref().map(String::as_str), )?; @@ -225,6 +88,17 @@ pub fn configure_wallet(my_config: &Config) -> VcxResult<(String, String, String Ok((my_did, my_vk, wallet_name)) } +fn _create_issuer_keys(my_did: &str, my_vk: &str, my_config: &Config) -> VcxResult<(String, String)> { + if my_config.enterprise_seed == my_config.agent_seed { + Ok((my_did.to_string(), my_vk.to_string())) + } else { + signus::create_and_store_my_did( + my_config.enterprise_seed.as_ref().map(String::as_str), + my_config.did_method.as_ref().map(String::as_str), + ) + } +} + pub fn get_final_config(my_did: &str, my_vk: &str, agent_did: &str, @@ -274,17 +148,6 @@ pub fn get_final_config(my_did: &str, Ok(final_config.to_string()) } -pub fn parse_config(config: &str) -> VcxResult { - let my_config: Config = ::serde_json::from_str(&config) - .map_err(|err| - VcxError::from_msg( - VcxErrorKind::InvalidConfiguration, - format!("Cannot parse config: {}", err), - ) - )?; - Ok(my_config) -} - pub fn connect_register_provision(config: &str) -> VcxResult { debug!("connect_register_provision >>> config: {:?}", config); let my_config = parse_config(config)?; @@ -298,7 +161,7 @@ pub fn connect_register_provision(config: &str) -> VcxResult { debug!("connect_register_provision:: Final settings: {:?}", settings::settings_as_string()); trace!("Connecting to Agency"); - let (agent_did, agent_vk) = onboarding_v2(&my_did, &my_vk, &my_config.agency_did)?; + let (agent_did, agent_vk) = agent_utils::onboarding_v2(&my_did, &my_vk, &my_config.agency_did)?; let config = get_final_config(&my_did, &my_vk, &agent_did, &agent_vk, &wallet_name, &my_config)?; @@ -307,112 +170,13 @@ pub fn connect_register_provision(config: &str) -> VcxResult { Ok(config) } -pub fn connect_v2(my_did: &str, my_vk: &str, agency_did: &str) -> VcxResult<(String, String)> { - /* STEP 1 - CONNECT */ - let message = A2AMessage::Version2( - A2AMessageV2::Connect(Connect::build(my_did, my_vk)) - ); - - let mut response = send_message_to_agency(&message, agency_did)?; - - let ConnectResponse { from_vk: agency_pw_vk, from_did: agency_pw_did, .. } = - match response.remove(0) { - A2AMessage::Version2(A2AMessageV2::ConnectResponse(resp)) => - resp, - _ => return - Err(VcxError::from_msg( - VcxErrorKind::InvalidHttpResponse, - "Message does not match any variant of ConnectResponse") - ) - }; - - agency_settings::set_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_VERKEY, &agency_pw_vk); - Ok((agency_pw_did, agency_pw_vk)) -} - -// it will be changed next -fn onboarding_v2(my_did: &str, my_vk: &str, agency_did: &str) -> VcxResult<(String, String)> { - AgencyMockDecrypted::set_next_decrypted_response(constants::CONNECTED_RESPONSE_DECRYPTED); - let (agency_pw_did, _) = connect_v2(my_did, my_vk, agency_did)?; - - /* STEP 2 - REGISTER */ - let message = A2AMessage::Version2( - A2AMessageV2::SignUp(SignUp::build()) - ); - - AgencyMockDecrypted::set_next_decrypted_response(constants::REGISTER_RESPONSE_DECRYPTED); - let mut response = send_message_to_agency(&message, &agency_pw_did)?; - - let _response: SignUpResponse = - match response.remove(0) { - A2AMessage::Version2(A2AMessageV2::SignUpResponse(resp)) => resp, - _ => return Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of SignUpResponse")) - }; - - /* STEP 3 - CREATE AGENT */ - let message = A2AMessage::Version2( - A2AMessageV2::CreateAgent(CreateAgent::build()) - ); - AgencyMockDecrypted::set_next_decrypted_response(constants::AGENT_CREATED_DECRYPTED); - let mut response = send_message_to_agency(&message, &agency_pw_did)?; - - let response: CreateAgentResponse = - match response.remove(0) { - A2AMessage::Version2(A2AMessageV2::CreateAgentResponse(resp)) => resp, - _ => return Err(VcxError::from_msg(VcxErrorKind::InvalidHttpResponse, "Message does not match any variant of CreateAgentResponse")) - }; - - Ok((response.from_did, response.from_vk)) -} - -pub fn update_agent_webhook(webhook_url: &str) -> VcxResult<()> { - info!("update_agent_webhook >>> webhook_url: {:?}", webhook_url); - - let com_method: ComMethod = ComMethod { - id: String::from("123"), - e_type: ComMethodType::Webhook, - value: String::from(webhook_url), - }; - - match agency_settings::get_config_value(agency_settings::CONFIG_REMOTE_TO_SDK_DID) { - Ok(to_did) => { - update_agent_webhook_v2(&to_did, com_method)?; - } - Err(e) => warn!("Unable to update webhook (did you provide remote did in the config?): {}", e) - } - Ok(()) -} - -fn update_agent_webhook_v2(to_did: &str, com_method: ComMethod) -> VcxResult<()> { - info!("> update_agent_webhook_v2"); - if agency_mocks_enabled() { - warn!("update_agent_webhook_v2 ::: Indy mocks enabled, skipping updating webhook url."); - return Ok(()); - } - - let message = A2AMessage::Version2( - A2AMessageV2::UpdateComMethod(UpdateComMethod::build(com_method)) - ); - send_message_to_agency(&message, &to_did)?; - Ok(()) -} - -pub fn send_message_to_agency(message: &A2AMessage, did: &str) -> VcxResult> { - let data = prepare_message_for_agency(message, &did)?; - - let response = post_to_agency(&data) - .map_err(|err| err.map(VcxErrorKind::InvalidHttpResponse, error::INVALID_HTTP_RESPONSE.message))?; - - parse_response_from_agency(&response) -} - #[cfg(test)] mod tests { use std::env; + use super::*; use api::vcx::vcx_shutdown; use utils::devsetup::{SetupDefaults, SetupLibraryAgencyV2, SetupMocks}; - use agency_comm::utils::agent_utils::{connect_register_provision, configure_wallet, Config, ComMethodType, update_agent_webhook}; #[test] #[cfg(feature = "agency")] @@ -486,20 +250,6 @@ mod tests { assert_eq!(expected, ::serde_json::from_str::(&result).unwrap()); } - #[test] - #[cfg(feature = "general_test")] - fn test_method_type_serialization() { - assert_eq!("\"1\"", serde_json::to_string::(&ComMethodType::A2A).unwrap()); - assert_eq!("\"2\"", serde_json::to_string::(&ComMethodType::Webhook).unwrap()); - } - - #[test] - #[cfg(feature = "general_test")] - fn test_method_type_deserialization() { - assert_eq!(ComMethodType::A2A, serde_json::from_str::("\"1\"").unwrap()); - assert_eq!(ComMethodType::Webhook, serde_json::from_str::("\"2\"").unwrap()); - } - #[ignore] #[test] #[cfg(feature = "general_test")] @@ -520,22 +270,4 @@ mod tests { let result = connect_register_provision(&config.to_string()).unwrap(); assert!(result.len() > 0); } - - #[test] - #[cfg(feature = "general_test")] - #[cfg(feature = "to_restore")] - fn test_update_agent_info() { - let _setup = SetupMocks::init(); - // todo: Need to mock agency v2 response, only agency v1 mocking works - update_agent_info("123", "value").unwrap(); - } - - #[cfg(feature = "agency_pool_tests")] - #[test] - fn test_update_agent_webhook_real() { - let _setup = SetupLibraryAgencyV2::init(); - - ::utils::devsetup::set_consumer(None); - update_agent_webhook("https://example.org").unwrap(); - } } diff --git a/libvcx/src/utils/validation.rs b/libvcx/src/utils/validation.rs index 7cf6e5cc84..e58c902eb3 100644 --- a/libvcx/src/utils/validation.rs +++ b/libvcx/src/utils/validation.rs @@ -1,8 +1,6 @@ extern crate openssl; extern crate rust_base58; -use url::Url; - use error::prelude::*; use settings::Actors; use utils::qualifier; @@ -55,12 +53,6 @@ pub fn validate_key_delegate(delegate: &str) -> VcxResult { Ok(check_delegate) } -pub fn validate_url(url: &str) -> VcxResult { - Url::parse(url) - .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidUrl, err))?; - Ok(url.to_string()) -} - pub fn validate_actors(actors: &str) -> VcxResult> { ::serde_json::from_str(&actors) .map_err(|err| VcxError::from_msg(VcxErrorKind::InvalidOption, format!("Invalid actors: {:?}", err))) @@ -170,4 +162,4 @@ mod tests { assert_eq!(validate_payment_method("").unwrap_err().kind(), VcxErrorKind::MissingPaymentMethod); } -} \ No newline at end of file +} diff --git a/wrappers/ios/ci/build.sh b/wrappers/ios/ci/build.sh index 820dc7ab81..74721ce502 100755 --- a/wrappers/ios/ci/build.sh +++ b/wrappers/ios/ci/build.sh @@ -227,7 +227,7 @@ copy_libvcx_architectures() { mkdir -p $OUTPUT_DIR/libs/$LIB_NAME/$ARCH - cp -v $REPO_DIR/libvcx/target/$TRIPLET/release/libvcx.a $OUTPUT_DIR/libs/$LIB_NAME/$ARCH/libvcx.a + cp -v $REPO_DIR/target/$TRIPLET/release/libvcx.a $OUTPUT_DIR/libs/$LIB_NAME/$ARCH/libvcx.a done } diff --git a/wrappers/java/ci/android.build.sh b/wrappers/java/ci/android.build.sh index 47fef520af..1acebf8327 100755 --- a/wrappers/java/ci/android.build.sh +++ b/wrappers/java/ci/android.build.sh @@ -4,7 +4,7 @@ set -ex REPO_DIR=$PWD SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )" -LIBVCX_DIR="${REPO_DIR}/libvcx" +LIBVCX_DIR="${REPO_DIR}/" JAVA_WRAPPER_DIR="${REPO_DIR}/wrappers/java" TARGET_ARCHS="$@" diff --git a/wrappers/node/src/api/vcx-mock.ts b/wrappers/node/src/api/vcx-mock.ts index d6e4fbcb78..177ac0157b 100644 --- a/wrappers/node/src/api/vcx-mock.ts +++ b/wrappers/node/src/api/vcx-mock.ts @@ -2,8 +2,6 @@ import { rustAPI } from '../rustlib' export enum VCXMockMessage { - CreateKey = 1, // create keys response - UpdateProfile = 2, // update profile response GetMessages = 3, // get_message response for connection acceptance UpdateIssuerCredential = 4, // get_message response for claim offer UpdateProof = 5, // get_message response for updating proof state