diff --git a/Cargo.lock b/Cargo.lock index f3432bee4c..abc0d4b2ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3254,6 +3254,16 @@ 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" @@ -8326,7 +8336,7 @@ dependencies = [ [[package]] name = "ya-client" version = "0.8.0" -source = "git+https://github.com/golemfactory/ya-client.git?rev=2539fcefd02b12e0078dc1ddcc9bcc0e841e685f#2539fcefd02b12e0078dc1ddcc9bcc0e841e685f" +source = "git+https://github.com/golemfactory/ya-client.git?rev=4fb874b81f9dbad2281601d2351383a356c89dd6#4fb874b81f9dbad2281601d2351383a356c89dd6" dependencies = [ "actix-codec", "awc", @@ -8375,11 +8385,12 @@ dependencies = [ [[package]] name = "ya-client-model" version = "0.6.0" -source = "git+https://github.com/golemfactory/ya-client.git?rev=2539fcefd02b12e0078dc1ddcc9bcc0e841e685f#2539fcefd02b12e0078dc1ddcc9bcc0e841e685f" +source = "git+https://github.com/golemfactory/ya-client.git?rev=4fb874b81f9dbad2281601d2351383a356c89dd6#4fb874b81f9dbad2281601d2351383a356c89dd6" 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 bd52f04d8b..73b47154d8 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 = "2539fcefd02b12e0078dc1ddcc9bcc0e841e685f" } +ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "4fb874b81f9dbad2281601d2351383a356c89dd6" } #ya-client = { path = "../ya-client" } -ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "2539fcefd02b12e0078dc1ddcc9bcc0e841e685f" } +ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "4fb874b81f9dbad2281601d2351383a356c89dd6" } #ya-client-model = "0.7" golem-certificate = { git = "https://github.com/golemfactory/golem-certificate.git", rev = "f2d7514c18fc066e9cfb796090b90f5b27cfe1c6" } diff --git a/core/model/src/driver.rs b/core/model/src/driver.rs index 74f349d9c7..8885214c12 100644 --- a/core/model/src/driver.rs +++ b/core/model/src/driver.rs @@ -413,6 +413,7 @@ pub enum ValidateAllocationResult { MalformedDepositId, DepositReused, DepositSpenderMismatch, + DepositValidationError(String), Valid, } diff --git a/core/payment-driver/erc20/src/driver.rs b/core/payment-driver/erc20/src/driver.rs index e3812912fe..e96c0e77d5 100644 --- a/core/payment-driver/erc20/src/driver.rs +++ b/core/payment-driver/erc20/src/driver.rs @@ -526,6 +526,17 @@ impl Erc20Driver { return Ok(ValidateAllocationResult::TimeoutExceedsDeposit); }; + if let Some(_extra_validation) = deposit.validate { + let validation_result: Result<(), String> = { + //self.payment_runtime.blah(); + unimplemented!("awaiting implementation in erc20_payment_lib") + }; + + if let Err(e) = validation_result { + return Ok(ValidateAllocationResult::DepositValidationError(e)); + } + } + Ok(ValidateAllocationResult::Valid) } }