| 65 | } |
| 66 | |
| 67 | pub(super) async fn validate_commit_proposed_batch( |
| 68 | &self, |
| 69 | batch_id: Nat, |
| 70 | evidence: String, |
| 71 | ) -> anyhow::Result<()> { |
| 72 | let evidence = hex::decode(evidence)?; |
| 73 | let arg = CommitProposedBatchArguments { |
| 74 | batch_id, |
| 75 | evidence: ByteBuf::from(evidence), |
| 76 | }; |
| 77 | |
| 78 | let method: AsyncCaller<'_, (Result<String, String>,)> = self |
| 79 | .canister_agent |
| 80 | .update("validate_commit_proposed_batch") |
| 81 | .with_arg(arg) |
| 82 | .build(); |
| 83 | |
| 84 | let result: Result<String, String> = method |
| 85 | .call_and_wait_one() |
| 86 | .await |
| 87 | .with_context(|| "Failed to fetch current upload proposal from asset canister")?; |
| 88 | result.map_err(|str| anyhow!(str))?; |
| 89 | |
| 90 | Ok(()) |
| 91 | } |
| 92 | } |