mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-11-24 16:13:59 +01:00
Revert "[CONTRACTS] Contracts branch update for 1.80 (#718)"
This reverts commit cdd63fb565.
This commit is contained in:
+2
-49
@@ -16,7 +16,6 @@
|
||||
//! implementation
|
||||
|
||||
use crate::config::{TorConfig, WalletConfig};
|
||||
use crate::contract::types::ContractSetupArgsAPI;
|
||||
use crate::error::Error;
|
||||
use crate::grin_core::core::hash::Hash;
|
||||
use crate::grin_core::core::FeeFields;
|
||||
@@ -26,9 +25,8 @@ use crate::grin_core::{global, ser};
|
||||
use crate::grin_keychain::{Identifier, Keychain};
|
||||
use crate::grin_util::logger::LoggingConfig;
|
||||
use crate::grin_util::secp::key::{PublicKey, SecretKey};
|
||||
use crate::grin_util::secp::{self, pedersen, Secp256k1, Signature};
|
||||
use crate::grin_util::secp::{self, pedersen, Secp256k1};
|
||||
use crate::grin_util::{ToHex, ZeroingString};
|
||||
use crate::slate::PaymentMemo;
|
||||
use crate::slate_versions::ser as dalek_ser;
|
||||
use crate::InitTxArgs;
|
||||
use chrono::prelude::*;
|
||||
@@ -191,15 +189,7 @@ where
|
||||
fn get(&self, id: &Identifier, mmr_index: &Option<u64>) -> Result<OutputData, Error>;
|
||||
|
||||
/// Get an (Optional) tx log entry by uuid
|
||||
// TODO: I think this can be deleted
|
||||
// fn get_tx_log_entry(&self, uuid: &Uuid) -> Result<Option<TxLogEntry>, Error>;
|
||||
|
||||
/// Get an (Optional) tx log entry by uuid
|
||||
fn get_tx_log_entry(
|
||||
&self,
|
||||
parent_id: Identifier,
|
||||
log_id: u32,
|
||||
) -> Result<Option<TxLogEntry>, Error>;
|
||||
fn get_tx_log_entry(&self, uuid: &Uuid) -> Result<Option<TxLogEntry>, Error>;
|
||||
|
||||
/// Retrieves the private context associated with a given slate id
|
||||
fn get_private_context(
|
||||
@@ -573,13 +563,6 @@ pub struct Context {
|
||||
/// for invoice I2 Only, store the tx excess so we can
|
||||
/// remove it from the slate on return
|
||||
pub calculated_excess: Option<pedersen::Commitment>,
|
||||
/// Arguments that define which outputs to pick for a contract
|
||||
pub setup_args: Option<ContractSetupArgsAPI>,
|
||||
/// TxLogEntry id (needed to avoid a linear scan)
|
||||
// Services that keep a long history might need to search
|
||||
// through a list when they need to update a txlogentry.
|
||||
// This is why we keep the id in the context.
|
||||
pub log_id: Option<u32>,
|
||||
}
|
||||
|
||||
impl Context {
|
||||
@@ -629,8 +612,6 @@ impl Context {
|
||||
payment_proof_derivation_index: None,
|
||||
late_lock_args: None,
|
||||
calculated_excess: None,
|
||||
setup_args: None,
|
||||
log_id: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -671,11 +652,6 @@ impl Context {
|
||||
PublicKey::from_secret_key(secp, &self.sec_nonce).unwrap(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns net_change for the contract
|
||||
pub fn get_net_change(&self) -> i64 {
|
||||
self.setup_args.as_ref().unwrap().net_change.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl ser::Writeable for Context {
|
||||
@@ -791,10 +767,6 @@ pub enum TxLogEntryType {
|
||||
TxReceivedCancelled,
|
||||
/// Sent transaction that was rolled back by user
|
||||
TxSentCancelled,
|
||||
/// Self spend, as per contracts and mwmixnet
|
||||
TxSelfSpend,
|
||||
/// Self Spend Cancelled (has to happen before sent to chain, flag rather than delete)
|
||||
TxSelfSpendCancelled,
|
||||
/// Received transaction that was reverted on-chain
|
||||
TxReverted,
|
||||
}
|
||||
@@ -808,8 +780,6 @@ impl fmt::Display for TxLogEntryType {
|
||||
TxLogEntryType::TxReceivedCancelled => write!(f, "Received Tx\n- Cancelled"),
|
||||
TxLogEntryType::TxSentCancelled => write!(f, "Sent Tx\n- Cancelled"),
|
||||
TxLogEntryType::TxReverted => write!(f, "Received Tx\n- Reverted"),
|
||||
TxLogEntryType::TxSelfSpend => write!(f, "Self Spend"),
|
||||
TxLogEntryType::TxSelfSpendCancelled => write!(f, "Self Spend\n- Cancelled"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -941,23 +911,6 @@ pub struct StoredProofInfo {
|
||||
/// sender signature
|
||||
#[serde(with = "dalek_ser::option_dalek_sig_serde")]
|
||||
pub sender_signature: Option<DalekSignature>,
|
||||
// Fields beyond here are specific to early payment proofs,
|
||||
// invoice and sender nonce
|
||||
/// Assumed to be 0x00 (Legacy) if missing
|
||||
pub proof_type: Option<u8>,
|
||||
/// receiver's public nonce from signing
|
||||
pub receiver_public_nonce: Option<PublicKey>,
|
||||
/// receiver's public excess from signing
|
||||
pub receiver_public_excess: Option<PublicKey>,
|
||||
/// Timestamp provided by recipient when signing
|
||||
pub timestamp: Option<DateTime<Utc>>,
|
||||
/// Optional payment memo
|
||||
pub memo: Option<PaymentMemo>,
|
||||
/// recipient promise signature
|
||||
#[serde(with = "dalek_ser::option_dalek_sig_serde")]
|
||||
pub promise_signature: Option<DalekSignature>,
|
||||
/// Original Sender partial key
|
||||
pub sender_part_sig: Option<Signature>,
|
||||
}
|
||||
|
||||
impl ser::Writeable for StoredProofInfo {
|
||||
|
||||
Reference in New Issue
Block a user