diff --git a/Cargo.lock b/Cargo.lock index abc0d4b2ec..5f04c7a192 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3254,16 +3254,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "humantime-serde" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" -dependencies = [ - "humantime 2.1.0", - "serde", -] - [[package]] name = "hyper" version = "0.14.29" @@ -8336,7 +8326,7 @@ dependencies = [ [[package]] name = "ya-client" version = "0.8.0" -source = "git+https://github.com/golemfactory/ya-client.git?rev=4fb874b81f9dbad2281601d2351383a356c89dd6#4fb874b81f9dbad2281601d2351383a356c89dd6" +source = "git+https://github.com/golemfactory/ya-client.git?rev=699c62a628070708edb39e3692f7b2052fcd9afa#699c62a628070708edb39e3692f7b2052fcd9afa" dependencies = [ "actix-codec", "awc", @@ -8385,12 +8375,11 @@ dependencies = [ [[package]] name = "ya-client-model" version = "0.6.0" -source = "git+https://github.com/golemfactory/ya-client.git?rev=4fb874b81f9dbad2281601d2351383a356c89dd6#4fb874b81f9dbad2281601d2351383a356c89dd6" +source = "git+https://github.com/golemfactory/ya-client.git?rev=699c62a628070708edb39e3692f7b2052fcd9afa#699c62a628070708edb39e3692f7b2052fcd9afa" dependencies = [ "bigdecimal 0.2.2", "chrono", "derive_more", - "humantime-serde", "rand 0.8.5", "serde", "serde_bytes", diff --git a/Cargo.toml b/Cargo.toml index 73b47154d8..8501e93d47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -280,9 +280,9 @@ ya-service-api-interfaces = { path = "core/serv-api/interfaces" } ya-service-api-web = { path = "core/serv-api/web" } ## CLIENT -ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "4fb874b81f9dbad2281601d2351383a356c89dd6" } +ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "699c62a628070708edb39e3692f7b2052fcd9afa" } #ya-client = { path = "../ya-client" } -ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "4fb874b81f9dbad2281601d2351383a356c89dd6" } +ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "699c62a628070708edb39e3692f7b2052fcd9afa" } #ya-client-model = "0.7" golem-certificate = { git = "https://github.com/golemfactory/golem-certificate.git", rev = "f2d7514c18fc066e9cfb796090b90f5b27cfe1c6" } diff --git a/core/payment-driver/erc20/src/driver.rs b/core/payment-driver/erc20/src/driver.rs index e96c0e77d5..110402d83e 100644 --- a/core/payment-driver/erc20/src/driver.rs +++ b/core/payment-driver/erc20/src/driver.rs @@ -527,11 +527,13 @@ impl Erc20Driver { }; if let Some(_extra_validation) = deposit.validate { + #[allow(unused)] let validation_result: Result<(), String> = { //self.payment_runtime.blah(); unimplemented!("awaiting implementation in erc20_payment_lib") }; + #[allow(unreachable_code)] if let Err(e) = validation_result { return Ok(ValidateAllocationResult::DepositValidationError(e)); } diff --git a/core/payment/src/api/allocations.rs b/core/payment/src/api/allocations.rs index fc567368f7..7ff47900ca 100644 --- a/core/payment/src/api/allocations.rs +++ b/core/payment/src/api/allocations.rs @@ -375,6 +375,9 @@ async fn create_allocation( Ok(ValidateAllocationResult::DepositSpenderMismatch) => { return bad_req_and_log("Deposit spender doesn't match allocation address".to_string()); } + Ok(ValidateAllocationResult::DepositValidationError(message)) => { + return bad_req_and_log(format!("Deposit contract rejected the deposit: {message}")); + } Err(Error::Rpc(RpcMessageError::ValidateAllocation( ValidateAllocationError::AccountNotRegistered, ))) => { @@ -557,6 +560,9 @@ async fn amend_allocation( Ok(ValidateAllocationResult::DepositSpenderMismatch) => { return bad_req_and_log("Deposit spender doesn't match allocation address".to_string()); } + Ok(ValidateAllocationResult::DepositValidationError(message)) => { + return bad_req_and_log(format!("Deposit contract rejected the deposit: {message}")); + } Err(Error::Rpc(RpcMessageError::ValidateAllocation( ValidateAllocationError::AccountNotRegistered, ))) => return response::bad_request(&"Account not registered"),