forked from QuickLendX/quicklendx-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_test_file29.sh
More file actions
executable file
·12 lines (10 loc) · 1.23 KB
/
Copy pathfix_test_file29.sh
File metadata and controls
executable file
·12 lines (10 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
#!/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
# In test_analytics_consistency, they use `client.update_invoice_status` which seems to exist but only in test builds maybe? Let's check where it is defined.
# I will use `client.update_invoice_status` as it IS defined in lib.rs for tests or public use.
# BUT we need to fix the OperationNotAllowed error by making sure the contract is initialized with an admin.
# Let's see how `test_analytics_consistency` does it... Wait! `setup()` in test_analytics_consistency DOES NOT call AdminStorage::initialize. It calls `client.set_admin(&admin)`.