forked from QuickLendX/quicklendx-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_test_file21.sh
More file actions
executable file
·17 lines (13 loc) · 1.48 KB
/
Copy pathfix_test_file21.sh
File metadata and controls
executable file
·17 lines (13 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
git restore quicklendx-contracts/src/test_platform_metrics_reconciliation.rs
sed -i 's/fn setup(env: &Env) -> (QuickLendXContractClient<'"'"'_>, Address, Address) {/fn setup(env: \&Env) -> (QuickLendXContractClient<'"'"'_>, Address, Address, Address) {/g' quicklendx-contracts/src/test_platform_metrics_reconciliation.rs
sed -i 's/(client, admin, business)/(client, contract_id, admin, business)/g' quicklendx-contracts/src/test_platform_metrics_reconciliation.rs
sed -i 's/std::vec::Vec::new()/alloc::vec::Vec::new()/g' quicklendx-contracts/src/test_platform_metrics_reconciliation.rs
sed -i 's/soroban_sdk::alloc::format!/alloc::format!/g' quicklendx-contracts/src/test_platform_metrics_reconciliation.rs
# Let's fix the admin setup properly using explicit mock auth for update_invoice_status
# Wait, actually, if I just replace client.update_invoice_status(id, status) with a direct write it works perfectly...
# Oh, the user explicitly asked me NOT to do that! "Good instinct to pause here — but you shouldn’t bypass update_invoice_status. That would quietly defeat the whole point of a reconciliation test suite".
# So we need to call update_invoice_status correctly.
# Why did client.update_invoice_status fail with 1402 (OperationNotAllowed)?
# Because AdminStorage requires the contract to be initialized!
sed -i 's/client.set_admin(&admin);/client.init(\&admin, \&Address::generate(env), \&Address::generate(env));/g' quicklendx-contracts/src/test_platform_metrics_reconciliation.rs