Revert "[CONTRACTS] Contracts branch update for 1.80 (#718)"

This reverts commit cdd63fb565.
This commit is contained in:
yeastplume
2024-09-19 09:05:44 +00:00
parent cdd63fb565
commit 7ac35f134b
78 changed files with 220 additions and 10170 deletions
-103
View File
@@ -16,7 +16,6 @@
use chrono::prelude::*;
use ed25519_dalek::SecretKey as DalekSecretKey;
use grin_wallet_libwallet::contract::proofs::InvoiceProof;
use grin_wallet_libwallet::RetrieveTxQueryArgs;
use uuid::Uuid;
@@ -28,10 +27,6 @@ use crate::impls::SlateSender as _;
use crate::keychain::{Identifier, Keychain};
use crate::libwallet::api_impl::owner_updater::{start_updater_log_thread, StatusMessage};
use crate::libwallet::api_impl::{owner, owner_updater};
use crate::libwallet::contract::types::{
ContractNewArgsAPI, ContractRevokeArgsAPI, ContractSetupArgsAPI,
};
use crate::libwallet::mwmixnet::types::{MixnetReqCreationParams, SwapReq};
use crate::libwallet::{
AcctPathMapping, BuiltOutput, Error, InitTxArgs, IssueInvoiceTxArgs, NodeClient,
NodeHeightResult, OutputCommitMapping, PaymentProof, Slate, Slatepack, SlatepackAddress,
@@ -771,78 +766,6 @@ where
owner::issue_invoice_tx(&mut **w, keychain_mask, args, self.doctest_mode)
}
/// TODO
pub fn contract_new(
&self,
keychain_mask: Option<&SecretKey>,
args: &ContractNewArgsAPI,
) -> Result<Slate, Error> {
let mut w_lock = self.wallet_inst.lock();
let w = w_lock.lc_provider()?.wallet_inst()?;
// TODO: self.doctest_mode ?
owner::contract_new(&mut **w, keychain_mask, &args)
}
// /// TODO
// pub fn contract_setup(
// &self,
// keychain_mask: Option<&SecretKey>,
// slate: &Slate,
// args: &ContractSetupArgsAPI,
// ) -> Result<Slate, Error> {
// let mut w_lock = self.wallet_inst.lock();
// let w = w_lock.lc_provider()?.wallet_inst()?;
// // TODO: self.doctest_mode ?
// owner::contract_setup(&mut **w, keychain_mask, &args, &slate)
// }
/// TODO
pub fn contract_sign(
&self,
keychain_mask: Option<&SecretKey>,
slate: &Slate,
args: &ContractSetupArgsAPI,
) -> Result<Slate, Error> {
let mut w_lock = self.wallet_inst.lock();
let w = w_lock.lc_provider()?.wallet_inst()?;
owner::contract_sign(&mut **w, keychain_mask, &args, &slate)
}
/// TODO
pub fn get_slate_index_matching_my_context(
&self,
keychain_mask: Option<&SecretKey>,
slate: &Slate,
) -> Result<usize, Error> {
let mut w_lock = self.wallet_inst.lock();
let w = w_lock.lc_provider()?.wallet_inst()?;
owner::get_slate_index_matching_my_context(&mut **w, keychain_mask, &slate)
}
/// TODO
pub fn contract_revoke(
&self,
keychain_mask: Option<&SecretKey>,
args: &ContractRevokeArgsAPI,
) -> Result<Option<Slate>, Error> {
let mut w_lock = self.wallet_inst.lock();
let w = w_lock.lc_provider()?.wallet_inst()?;
owner::contract_revoke(&mut **w, keychain_mask, &args)
}
/// Create MXMixnet request
pub fn create_mwmixnet_req(
&self,
keychain_mask: Option<&SecretKey>,
params: &MixnetReqCreationParams,
slate: &Slate,
// use_test_rng: bool,
) -> Result<SwapReq, Error> {
let mut w_lock = self.wallet_inst.lock();
let w = w_lock.lc_provider()?.wallet_inst()?;
owner::create_mwmixnet_req(&mut **w, keychain_mask, params, slate)
}
/// Processes an invoice tranaction created by another party, essentially
/// a `request for payment`. The incoming slate should contain a requested
/// amount, an output created by the invoicer convering the amount, and
@@ -2432,32 +2355,6 @@ where
)
}
/// TODO: Temporary, likely should merge with above
pub fn retrieve_payment_proof_invoice(
&self,
keychain_mask: Option<&SecretKey>,
refresh_from_node: bool,
tx_id: Option<u32>,
tx_slate_id: Option<Uuid>,
) -> Result<InvoiceProof, Error> {
let tx = {
let t = self.status_tx.lock();
t.clone()
};
let refresh_from_node = match self.updater_running.load(Ordering::Relaxed) {
true => false,
false => refresh_from_node,
};
owner::retrieve_payment_proof_invoice(
self.wallet_inst.clone(),
keychain_mask,
&tx,
refresh_from_node,
tx_id,
tx_slate_id,
)
}
/// Verifies a [PaymentProof](../grin_wallet_libwallet/api_impl/types/struct.PaymentProof.html)
/// This process entails:
///