Skip to content

Commit

Permalink
wip: deposit validation on contract
Browse files Browse the repository at this point in the history
  • Loading branch information
kamirr committed Jul 9, 2024
1 parent d8fc8da commit f1d1b3c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
15 changes: 13 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
1 change: 1 addition & 0 deletions core/model/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ pub enum ValidateAllocationResult {
MalformedDepositId,
DepositReused,
DepositSpenderMismatch,
DepositValidationError(String),
Valid,
}

Expand Down
11 changes: 11 additions & 0 deletions core/payment-driver/erc20/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit f1d1b3c

Please sign in to comment.