10bf70b22b
* Remove check for bandwidth for incoming packets We should only accunt for packets that the client inputs to the mixnet * Introduce BandwidthController for both types of bandwidth creds * Add some non-coconut token bandwidth handling * Use thiserror for gateway-client lib * Add error handling * Unable to build for wasm for now * Fix wasm strange error * Disable non-coconut credentials for wasm client * Check for status and throw the error up * Send encrypted token cred from client * Gateway receive message and signature validation * Put the correct amount of tokens that were burned * [ci skip] Generate TS types * Eth endpoint and secret key as config parameters * Add eth_endpoint config argument for gateway * Update test as well * Separate panicable code from the safe one * Move some bandwidth controller panics up the call stack * Save contract corresponding to the eth endpoint * Fix template * Pass the web3 interface as well * Made event reads possible in gateway * Add checks for event data * Cosmos contract for double spending prevention * Add workflow for the new contract * Add validator rest URL to config * Rename eth_events to erc20_bridge * Pass cosmos mnemonic as well, and put the nymd client in ERC20Bridge * Call cosmos contract for final verification * Ask for config parameters in cli * Fix various stuff * Increase timeout to allow gateway to check the two chains * Put some logs for the new flow * Set consumed bandwidth invariantly of coconut feature * Fix clippy error * Add non-coconut checks * Use 2018 rust instead of 2021 * More verbose nymd error * Explicitly specify TOKENS_TO_BURN constant * Put eth burn function in a constant * Replace to_vec & append with iter & chain * Test for (de)serialization of TokenCredential * Minor rename * Separate credential creation from bandwidth claiming * Switch from panics to errors when claiming coconut bandwidth * Another append changed to chain * Update QA cosmos contract address * Simplify build/test/clippy separation on coconut feature * Fix bad features arg positioning * Use the start_after in cosmos contract query * Set a limit in line with a range on cosmos queries * Added unit tests for new cosmos contract * Fix bandwidth_remaining comparation * Get remaining bandwidth from gateway * Add contract build flag * Add a useful info log * Use a more robust eth depth for release builds * Include recipt logs in error message * Fix clippy for tests * Use Arc instead of clone * Rename as_bytes to to_bytes * Make signature verification in contract more verbose * Missed rename of paging constant * Fix gateway start with coconut enabled * Rename function to claim_token * Simplify nymd client setup * Check with block buffer on gateway as well * Update comment of double spending protection * Correct contract address * Backup the keypairs used for buying tokens, in case of error cases * Don't take any chances with the gateway timeout * [ci skip] Generate TS types * Updated cosmos contract to latest QA address * Add cli options for eth * Update network monitor timeout value as well Co-authored-by: neacsu <neacsu@users.noreply.github.com>
73 lines
2.3 KiB
TOML
73 lines
2.3 KiB
TOML
[package]
|
|
name = "gateway-client"
|
|
version = "0.1.0"
|
|
authors = ["Jędrzej Stuczyński <andrew@nymtech.net>"]
|
|
edition = "2018"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[dependencies]
|
|
# TODO: (for this and other crates), similarly to 'tokio', import only required "futures" modules rather than
|
|
# the entire crate
|
|
futures = "0.3"
|
|
json = "0.12.4"
|
|
log = "0.4"
|
|
thiserror = "1.0"
|
|
url = "2.2"
|
|
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
|
|
|
|
# internal
|
|
credentials = { path = "../../credentials" }
|
|
crypto = { path = "../../crypto" }
|
|
gateway-requests = { path = "../../../gateway/gateway-requests" }
|
|
nymsphinx = { path = "../../nymsphinx" }
|
|
coconut-interface = { path = "../../coconut-interface", optional = true }
|
|
network-defaults = { path = "../../network-defaults" }
|
|
|
|
[dependencies.tungstenite]
|
|
version = "0.13"
|
|
default-features = false
|
|
|
|
# non-wasm-only dependencies
|
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio]
|
|
version = "1.4"
|
|
features = ["macros", "rt", "net", "sync", "time"]
|
|
|
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio-tungstenite]
|
|
version = "0.14"
|
|
|
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.secp256k1]
|
|
version = "0.20.3"
|
|
|
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.web3]
|
|
version = "0.17.0"
|
|
|
|
# wasm-only dependencies
|
|
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen]
|
|
version = "0.2"
|
|
|
|
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen-futures]
|
|
version = "0.4"
|
|
|
|
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-utils]
|
|
path = "../../wasm-utils"
|
|
|
|
# only import it in wasm. Prefer proper tokio timer in non-wasm
|
|
[target."cfg(target_arch = \"wasm32\")".dependencies.fluvio-wasm-timer]
|
|
version = "0.2.5"
|
|
|
|
# this is due to tungstenite using `rand` 0.8 and associated changes in `getrandom` crate
|
|
# which now does not support wasm32-unknown-unknown target by default.
|
|
# using the below, we assume our client is going to be run in environment
|
|
# containing javascript (such as a web browser or node.js).
|
|
# refer to https://docs.rs/getrandom/0.2.2/getrandom/#webassembly-support for more information
|
|
[target."cfg(target_arch = \"wasm32\")".dependencies.getrandom]
|
|
version = "0.2"
|
|
features = ["js"]
|
|
|
|
[dev-dependencies]
|
|
# for tests
|
|
#url = "2.1"
|
|
|
|
[features]
|
|
coconut = ["gateway-requests/coconut", "coconut-interface"] |