Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opentxs::OTTransactionType Class Reference

#include <OTTransactionType.hpp>

Inheritance diagram for opentxs::OTTransactionType:
Collaboration diagram for opentxs::OTTransactionType:

Public Member Functions

EXPORT void GetNumList (OTNumList &theOutput)
 
bool Contains (const OTString &strContains)
 
EXPORT bool Contains (const char *szContains)
 
bool IsSameAccount (const OTTransactionType &rhs) const
 
void SetLoadInsecure ()
 
const OTIdentifierGetUserID () const
 
void SetUserID (const OTIdentifier &theID)
 
const OTIdentifierGetRealAccountID () const
 
void SetRealAccountID (const OTIdentifier &theID)
 
const OTIdentifierGetPurportedAccountID () const
 
void SetPurportedAccountID (const OTIdentifier &theID)
 
const OTIdentifierGetRealServerID () const
 
void SetRealServerID (const OTIdentifier &theID)
 
const OTIdentifierGetPurportedServerID () const
 
void SetPurportedServerID (const OTIdentifier &theID)
 
virtual EXPORT bool VerifyContractID () const
 
virtual bool VerifyAccount (const OTPseudonym &theNym)
 
 OTTransactionType (const OTIdentifier &theUserID, const OTIdentifier &theAccountID, const OTIdentifier &theServerID)
 
 OTTransactionType (const OTIdentifier &theUserID, const OTIdentifier &theAccountID, const OTIdentifier &theServerID, int64_t lTransactionNum)
 
void InitTransactionType ()
 
virtual ~OTTransactionType ()
 
virtual void Release ()
 
void Release_TransactionType ()
 
EXPORT int64_t GetTransactionNum () const
 
void SetTransactionNum (int64_t lTransactionNum)
 
virtual EXPORT void CalculateNumberOfOrigin ()
 
virtual EXPORT int64_t GetNumberOfOrigin ()
 
EXPORT int64_t GetRawNumberOfOrigin () const
 
EXPORT void SetNumberOfOrigin (int64_t lTransactionNum)
 
EXPORT void SetNumberOfOrigin (OTTransactionType &setFrom)
 
EXPORT bool VerifyNumberOfOrigin (OTTransactionType &compareTo)
 
EXPORT int64_t GetReferenceToNum () const
 
EXPORT void SetReferenceToNum (int64_t lTransactionNum)
 
EXPORT void GetReferenceString (OTString &theStr) const
 
EXPORT void SetReferenceString (const OTString &theStr)
 
virtual bool SaveContractWallet (std::ofstream &ofs) const
 
- Public Member Functions inherited from opentxs::OTContract
const char * GetHashType () const
 
void SetIdentifier (const OTIdentifier &theID)
 
EXPORT OTContract ()
 
EXPORT OTContract (const OTString &name, const OTString &foldername, const OTString &filename, const OTString &strID)
 
EXPORT OTContract (const OTString &strID)
 
EXPORT OTContract (const OTIdentifier &theID)
 
void Initialize ()
 
virtual EXPORT ~OTContract ()
 
EXPORT void Release_Contract ()
 
EXPORT void ReleaseSignatures ()
 
virtual EXPORT bool CreateContract (const OTString &strContract, const OTPseudonym &theSigner)
 
EXPORT bool InsertNym (const OTString &strKeyName, const OTString &strKeyValue)
 
EXPORT void GetName (OTString &strName) const
 
EXPORT void SetName (const OTString &strName)
 
virtual EXPORT bool VerifyContract ()
 
virtual EXPORT void GetIdentifier (OTIdentifier &theIdentifier) const
 
virtual EXPORT void GetIdentifier (OTString &theIdentifier) const
 
EXPORT void GetFilename (OTString &strFilename) const
 
EXPORT void GetFoldername (OTString &strFoldername) const
 
virtual EXPORT bool LoadContract ()
 
EXPORT bool LoadContract (const char *szFoldername, const char *szFilename)
 
EXPORT bool LoadContractFromString (const OTString &theStr)
 
bool LoadContractRawFile ()
 
EXPORT bool ParseRawFile ()
 
EXPORT bool SaveToContractFolder ()
 
EXPORT bool SaveContractRaw (OTString &strOutput) const
 
EXPORT bool RewriteContract (OTString &strOutput) const
 
EXPORT bool SaveContract ()
 
EXPORT bool SaveContract (const char *szFoldername, const char *szFilename)
 
virtual EXPORT void UpdateContents ()
 
virtual EXPORT void CreateContents ()
 
EXPORT void CreateInnerContents ()
 
virtual EXPORT bool SaveContents (std::ofstream &ofs) const
 
virtual EXPORT bool SaveContractWallet (OTString &strContents) const
 
virtual EXPORT bool DisplayStatistics (OTString &strContents) const
 
virtual EXPORT bool SaveContents (OTString &strContents) const
 
virtual EXPORT bool SignContract (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContractAuthent (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignWithKey (const OTAsymmetricKey &theKey, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContract (const OTPseudonym &theNym, OTSignature &theSignature, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContractAuthent (const OTPseudonym &theNym, OTSignature &theSignature, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContract (const OTAsymmetricKey &theKey, OTSignature &theSignature, const OTString &strHashType, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContract (const char *szFoldername, const char *szFilename, OTSignature &theSignature, const OTPasswordData *pPWData=nullptr)
 
virtual EXPORT void CalculateContractID (OTIdentifier &newID) const
 
virtual EXPORT bool VerifySignature (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr) const
 
virtual EXPORT bool VerifySigAuthent (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifyWithKey (const OTAsymmetricKey &theKey, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySignature (const OTPseudonym &theNym, const OTSignature &theSignature, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySigAuthent (const OTPseudonym &theNym, const OTSignature &theSignature, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySignature (const OTAsymmetricKey &theKey, const OTSignature &theSignature, const OTString &strHashType, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySignature (const char *szFoldername, const char *szFilename, const OTSignature &theSignature, const OTPasswordData *pPWData=nullptr) const
 
EXPORT const OTAsymmetricKeyGetContractPublicKey () const
 
EXPORT const OTPseudonymGetContractPublicNym () const
 

Static Public Member Functions

static EXPORT OTTransactionTypeTransactionFactory (OTString strInput)
 
- Static Public Member Functions inherited from opentxs::OTContract
static EXPORT bool DearmorAndTrim (const OTString &strInput, OTString &strOutput, OTString &strFirstLine)
 
static bool AddBookendsAroundContent (OTString &strOutput, const OTString &strContents, const OTString &strContractType, const OTString &strHashType, const listOfSignatures &listSignatures)
 
static EXPORT bool LoadEncodedTextField (irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput)
 
static EXPORT bool LoadEncodedTextField (irr::io::IrrXMLReader *&xml, OTString &strOutput)
 
static bool LoadEncodedTextFieldByName (irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput, const char *&szName, OTString::Map *pmapExtraVars=nullptr)
 
static bool LoadEncodedTextFieldByName (irr::io::IrrXMLReader *&xml, OTString &strOutput, const char *&szName, OTString::Map *pmapExtraVars=nullptr)
 
static bool SkipToElement (irr::io::IrrXMLReader *&xml)
 
static bool SkipToTextField (irr::io::IrrXMLReader *&xml)
 
static bool SkipAfterLoadingField (irr::io::IrrXMLReader *&xml)
 
static EXPORT bool SignFlatText (OTString &strFlatText, const OTString &strContractType, const OTPseudonym &theSigner, OTString &strOutput)
 

Protected Member Functions

 OTTransactionType ()
 
- Protected Member Functions inherited from opentxs::OTContract
bool LoadContractXML ()
 
virtual EXPORT int32_t ProcessXMLNode (irr::io::IrrXMLReader *&xml)
 

Protected Attributes

OTIdentifier m_AcctID
 
OTIdentifier m_ServerID
 
OTIdentifier m_AcctServerID
 
OTIdentifier m_AcctUserID
 
int64_t m_lTransactionNum
 
int64_t m_lInReferenceToTransaction
 
int64_t m_lNumberOfOrigin
 
OTASCIIArmor m_ascInReferenceTo
 
bool m_bLoadSecurely
 
OTNumList m_Numlist
 
- Protected Attributes inherited from opentxs::OTContract
OTString m_strName
 
OTString m_strFoldername
 
OTString m_strFilename
 
OTIdentifier m_ID
 
OTStringXML m_xmlUnsigned
 
OTString m_strRawFile
 
OTString m_strSigHashType
 
OTString m_strContractType
 
mapOfNyms m_mapNyms
 
listOfSignatures m_listSignatures
 
OTString m_strVersion
 
OTString m_strEntityShortName
 
OTString m_strEntityLongName
 
OTString m_strEntityEmail
 
OTString::Map m_mapConditions
 

Detailed Description

Definition at line 147 of file OTTransactionType.hpp.

Constructor & Destructor Documentation

opentxs::OTTransactionType::OTTransactionType ( )
protected

Definition at line 254 of file OTTransactionType.cpp.

255  : OTContract()
256  , m_lTransactionNum(0)
258  , m_lNumberOfOrigin(0)
259  , m_bLoadSecurely(true)
260 {
261  // this function is private to prevent people from using it.
262  // Should never actually get called.
263 
264  // InitTransactionType(); // Just in case.
265 }
opentxs::OTTransactionType::OTTransactionType ( const OTIdentifier theUserID,
const OTIdentifier theAccountID,
const OTIdentifier theServerID 
)

Definition at line 267 of file OTTransactionType.cpp.

270  : OTContract(theAccountID)
271  , m_ServerID(theServerID)
272  , m_AcctUserID(theUserID)
273  , m_lTransactionNum(0)
275  , m_lNumberOfOrigin(0)
276  , m_bLoadSecurely(true)
277 {
278  // InitTransactionType();
279 
280  // m_ID = theAccountID -- This happens in OTContract, no need
281  // to do it twice.
282 
283  // do NOT set m_AcctID and m_AcctServerID here. Let the child classes LOAD
284  // them or GENERATE them.
285 }
opentxs::OTTransactionType::OTTransactionType ( const OTIdentifier theUserID,
const OTIdentifier theAccountID,
const OTIdentifier theServerID,
int64_t  lTransactionNum 
)

Definition at line 287 of file OTTransactionType.cpp.

291  : OTContract(theAccountID)
292  , m_ServerID(theServerID)
293  , m_AcctUserID(theUserID)
294  , m_lTransactionNum(lTransactionNum)
296  , m_lNumberOfOrigin(0)
297  , m_bLoadSecurely(true)
298 {
299  // This initializes m_lTransactionNum, so it must come FIRST.
300  // In fact, that's the general rule with this function.
301  // InitTransactionType();
302 
303  // m_ID = theAccountID -- This happens in OTContract, no
304  // need to do it twice.
305 
306  // do NOT set m_AcctID and m_AcctServerID here. Let the child classes LOAD
307  // them or GENERATE them.
308 }
opentxs::OTTransactionType::~OTTransactionType ( )
virtual

Definition at line 318 of file OTTransactionType.cpp.

319 {
321 }

Member Function Documentation

void opentxs::OTTransactionType::CalculateNumberOfOrigin ( )
virtual

Reimplemented in opentxs::OTTransaction, and opentxs::OTItem.

Definition at line 474 of file OTTransactionType.cpp.

bool opentxs::OTTransactionType::Contains ( const OTString strContains)

Definition at line 240 of file OTTransactionType.cpp.

241 {
242  return m_strRawFile.Contains(strContains);
243 }
EXPORT bool Contains(const char *compare) const
Definition: OTString.cpp:1137
bool opentxs::OTTransactionType::Contains ( const char *  szContains)

Definition at line 246 of file OTTransactionType.cpp.

247 {
248  return m_strRawFile.Contains(szContains);
249 }
EXPORT bool Contains(const char *compare) const
Definition: OTString.cpp:1137
int64_t opentxs::OTTransactionType::GetNumberOfOrigin ( )
virtual

Reimplemented in opentxs::OTTransaction, and opentxs::OTItem.

Definition at line 481 of file OTTransactionType.cpp.

482 {
484 
485  return m_lNumberOfOrigin;
486 }
virtual EXPORT void CalculateNumberOfOrigin()
void opentxs::OTTransactionType::GetNumList ( OTNumList theOutput)

Definition at line 233 of file OTTransactionType.cpp.

234 {
235  theOutput.Release();
236  theOutput.Add(m_Numlist);
237 }
const OTIdentifier& opentxs::OTTransactionType::GetPurportedAccountID ( ) const
inline

Definition at line 854 of file OTTransactionType.hpp.

855  {
856  return m_AcctID;
857  }
const OTIdentifier& opentxs::OTTransactionType::GetPurportedServerID ( ) const
inline

Definition at line 874 of file OTTransactionType.hpp.

875  {
876  return m_AcctServerID;
877  }
int64_t opentxs::OTTransactionType::GetRawNumberOfOrigin ( ) const

Definition at line 489 of file OTTransactionType.cpp.

490 {
491  return m_lNumberOfOrigin;
492 }
const OTIdentifier& opentxs::OTTransactionType::GetRealAccountID ( ) const
inline

Definition at line 843 of file OTTransactionType.hpp.

844  {
845  return m_ID;
846  }
OTIdentifier m_ID
Definition: OTContract.hpp:172
const OTIdentifier& opentxs::OTTransactionType::GetRealServerID ( ) const
inline

Definition at line 864 of file OTTransactionType.hpp.

865  {
866  return m_ServerID;
867  }
void opentxs::OTTransactionType::GetReferenceString ( OTString theStr) const

Definition at line 381 of file OTTransactionType.cpp.

382 {
384 }
EXPORT bool GetString(OTString &theData, bool bLineBreaks=true) const
int64_t opentxs::OTTransactionType::GetReferenceToNum ( ) const

Definition at line 529 of file OTTransactionType.cpp.

530 {
532 }
int64_t opentxs::OTTransactionType::GetTransactionNum ( ) const

Definition at line 463 of file OTTransactionType.cpp.

464 {
465  return m_lTransactionNum;
466 }
const OTIdentifier& opentxs::OTTransactionType::GetUserID ( ) const
inline

Definition at line 833 of file OTTransactionType.hpp.

834  {
835  return m_AcctUserID;
836  }
void opentxs::OTTransactionType::InitTransactionType ( )

Definition at line 311 of file OTTransactionType.cpp.

bool opentxs::OTTransactionType::IsSameAccount ( const OTTransactionType rhs) const

Definition at line 372 of file OTTransactionType.cpp.

373 {
374  if ((GetUserID() != rhs.GetUserID()) ||
375  (GetRealAccountID() != rhs.GetRealAccountID()) ||
376  (GetRealServerID() != rhs.GetRealServerID()))
377  return false;
378  return true;
379 }
const OTIdentifier & GetRealAccountID() const
const OTIdentifier & GetUserID() const
const OTIdentifier & GetRealServerID() const
void opentxs::OTTransactionType::Release ( void  )
virtual

Reimplemented from opentxs::OTContract.

Reimplemented in opentxs::OTTransaction, opentxs::OTItem, opentxs::OTLedger, and opentxs::OTAccount.

Definition at line 359 of file OTTransactionType.cpp.

360 {
362 
363  ot_super::Release(); // since I've overridden the base class, I call it
364  // now...
365 }
virtual EXPORT void Release()
Definition: OTContract.cpp:277
void opentxs::OTTransactionType::Release_TransactionType ( )

Definition at line 325 of file OTTransactionType.cpp.

326 {
327  // If there were any dynamically allocated objects, clean them up here.
328 
329  // m_ID.Release();
330  m_AcctID.Release(); // Compare m_AcctID to m_ID after loading it from string
331  // or file. They should match, and signature should
332  // verify.
333 
334  // m_ServerID.Release(); // Server ID as used to instantiate the
335  // transaction, based on expected ServerID.
336  m_AcctServerID.Release(); // Actual ServerID within the signed portion.
337  // (Compare to m_ServerID upon loading.)
338 
339  // m_AcctUserID.Release();
340 
341  m_lTransactionNum = 0;
343  m_lNumberOfOrigin = 0;
344 
345  m_ascInReferenceTo.Release(); // This item may be in reference to a
346  // different item
347 
348  // This was causing OTLedger to fail loading. Can't set this to true until
349  // the END
350  // of loading. Todo: Starting reading the END TAGS during load. For example,
351  // the OTLedger
352  // END TAG could set this back to true...
353  //
354  // m_bLoadSecurely = true; // defaults to true.
355 
356  m_Numlist.Release();
357 }
EXPORT void Release()
Definition: OTNumList.cpp:465
virtual EXPORT void Release()
Definition: OTData.cpp:257
virtual EXPORT void Release()
Definition: OTString.cpp:765
bool opentxs::OTTransactionType::SaveContractWallet ( std::ofstream &  ofs) const
virtual

Implements opentxs::OTContract.

Reimplemented in opentxs::OTTransaction, opentxs::OTItem, opentxs::OTLedger, and opentxs::OTAccount.

Definition at line 391 of file OTTransactionType.cpp.

392 {
393  return true;
394 }
void opentxs::OTTransactionType::SetLoadInsecure ( )
inline

Definition at line 825 of file OTTransactionType.hpp.

826  {
827  m_bLoadSecurely = false;
828  }
void opentxs::OTTransactionType::SetNumberOfOrigin ( int64_t  lTransactionNum)

Definition at line 494 of file OTTransactionType.cpp.

495 {
496  m_lNumberOfOrigin = lTransactionNum;
497 }
void opentxs::OTTransactionType::SetNumberOfOrigin ( OTTransactionType setFrom)

Definition at line 499 of file OTTransactionType.cpp.

500 {
501  m_lNumberOfOrigin = setFrom.GetNumberOfOrigin();
502 }
void opentxs::OTTransactionType::SetPurportedAccountID ( const OTIdentifier theID)
inline

Definition at line 858 of file OTTransactionType.hpp.

859  {
860  m_AcctID = theID;
861  }
void opentxs::OTTransactionType::SetPurportedServerID ( const OTIdentifier theID)
inline

Definition at line 878 of file OTTransactionType.hpp.

879  {
880  m_AcctServerID = theID;
881  }
void opentxs::OTTransactionType::SetRealAccountID ( const OTIdentifier theID)
inline

Definition at line 847 of file OTTransactionType.hpp.

848  {
849  m_ID = theID;
850  }
OTIdentifier m_ID
Definition: OTContract.hpp:172
void opentxs::OTTransactionType::SetRealServerID ( const OTIdentifier theID)
inline

Definition at line 868 of file OTTransactionType.hpp.

869  {
870  m_ServerID = theID;
871  }
void opentxs::OTTransactionType::SetReferenceString ( const OTString theStr)

Definition at line 386 of file OTTransactionType.cpp.

387 {
389 }
EXPORT bool SetString(const OTString &theData, bool bLineBreaks=true)
void opentxs::OTTransactionType::SetReferenceToNum ( int64_t  lTransactionNum)

Definition at line 534 of file OTTransactionType.cpp.

535 {
536  m_lInReferenceToTransaction = lTransactionNum;
537 }
void opentxs::OTTransactionType::SetTransactionNum ( int64_t  lTransactionNum)

Definition at line 468 of file OTTransactionType.cpp.

469 {
470  m_lTransactionNum = lTransactionNum;
471 }
void opentxs::OTTransactionType::SetUserID ( const OTIdentifier theID)
inline

Definition at line 837 of file OTTransactionType.hpp.

838  {
839  m_AcctUserID = theID;
840  }
OTTransactionType * opentxs::OTTransactionType::TransactionFactory ( OTString  strInput)
static

Definition at line 147 of file OTTransactionType.cpp.

148 {
149  OTString strContract, strFirstLine; // output for the below function.
150  const bool bProcessed =
151  OTContract::DearmorAndTrim(strInput, strContract, strFirstLine);
152 
153  if (bProcessed) {
154  OTTransactionType* pContract = nullptr;
155 
156  if (strFirstLine.Contains(
157  "-----BEGIN SIGNED TRANSACTION-----")) // this string is 34
158  // chars long.
159  {
160  pContract = new OTTransaction();
161  OT_ASSERT(nullptr != pContract);
162  }
163  else if (strFirstLine.Contains(
164  "-----BEGIN SIGNED TRANSACTION ITEM-----")) // this
165  // string is
166  // 39 chars
167  // long.
168  {
169  pContract = new OTItem();
170  OT_ASSERT(nullptr != pContract);
171  }
172  else if (strFirstLine.Contains(
173  "-----BEGIN SIGNED LEDGER-----")) // this string is 29
174  // chars long.
175  {
176  pContract = new OTLedger();
177  OT_ASSERT(nullptr != pContract);
178  }
179  else if (strFirstLine.Contains(
180  "-----BEGIN SIGNED ACCOUNT-----")) // this string is 30
181  // chars long.
182  {
183  pContract = new OTAccount();
184  OT_ASSERT(nullptr != pContract);
185  }
186 
187  // The string didn't match any of the options in the factory.
188  //
189 
190  const char* szFunc = "OTTransactionType::TransactionFactory";
191  // The string didn't match any of the options in the factory.
192  if (nullptr == pContract) {
193  otOut << szFunc
194  << ": Object type not yet supported by class factory: "
195  << strFirstLine << "\n";
196  return nullptr;
197  }
198 
199  // This causes pItem to load ASSUMING that the PurportedAcctID and
200  // PurportedServerID are correct.
201  // The object is still expected to be internally consistent with its
202  // sub-items, regarding those IDs,
203  // but the big difference is that it will SET the Real Acct and Real
204  // Server IDs based on the purported
205  // values. This way you can load a transaction without knowing the
206  // account in advance.
207  //
208  pContract->m_bLoadSecurely = false;
209 
210  // Does the contract successfully load from the string passed in?
211  if (pContract->LoadContractFromString(strContract)) {
212  // NOTE: this already happens in OTTransaction::ProcessXMLNode and
213  // OTLedger::ProcessXMLNode.
214  // Specifically, it happens when m_bLoadSecurely is set to false.
215  //
216  // pContract->SetRealServerID(pItem->GetPurportedServerID());
217  // pContract->SetRealAccountID(pItem->GetPurportedAccountID());
218  //
219  return pContract;
220  }
221  else {
222  otOut << szFunc
223  << ": Failed loading contract from string (first line): "
224  << strFirstLine << "\n";
225  delete pContract;
226  pContract = nullptr;
227  }
228  }
229 
230  return nullptr;
231 }
static EXPORT bool DearmorAndTrim(const OTString &strInput, OTString &strOutput, OTString &strFirstLine)
Definition: OTContract.cpp:158
OTLOG_IMPORT OTLogStream otOut
#define OT_ASSERT(x)
Definition: Assert.hpp:150
bool opentxs::OTTransactionType::VerifyAccount ( const OTPseudonym theNym)
virtual

Reimplemented in opentxs::OTTransaction, and opentxs::OTLedger.

Definition at line 402 of file OTTransactionType.cpp.

403 {
404  // Make sure that the supposed AcctID matches the one read from the file.
405  //
406  if (!VerifyContractID()) {
407  otErr << "Error verifying account ID in "
408  "OTTransactionType::VerifyAccount\n";
409  return false;
410  }
411  else if (!VerifySignature(theNym)) {
412  otErr << "Error verifying signature in "
413  "OTTransactionType::VerifyAccount.\n";
414  return false;
415  }
416 
417  otLog4 << "\nWe now know that...\n"
418  "1) The expected Account ID matches the ID that was found on the "
419  "object.\n"
420  "2) The SIGNATURE VERIFIED on the object.\n\n";
421  return true;
422 }
OTLOG_IMPORT OTLogStream otLog4
OTLOG_IMPORT OTLogStream otErr
virtual EXPORT bool VerifySignature(const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr) const
Definition: OTContract.cpp:818
virtual EXPORT bool VerifyContractID() const
bool opentxs::OTTransactionType::VerifyContractID ( ) const
virtual

Reimplemented from opentxs::OTContract.

Definition at line 424 of file OTTransactionType.cpp.

425 {
426  // m_AcctID contains the number we read from the xml file
427  // we can compare it to the existing and actual identifier.
428 
429  // m_AcctID contains the "IDENTIFIER" of the object, according to the xml
430  // file.
431  //
432  // Meanwhile m_ID contains the same identifier, except it was generated.
433  //
434  // Now let's compare the two and make sure they match...
435 
436  // Also, for this class, we compare ServerID as well. They go hand in hand.
437 
438  if ((m_ID != m_AcctID) || (m_ServerID != m_AcctServerID)) {
439  OTString str1(m_ID), str2(m_AcctID), str3(m_ServerID),
440  str4(m_AcctServerID);
441  otErr << "Identifiers do NOT match in "
442  "OTTransactionType::VerifyContractID.\n"
443  "m_ID: " << str1 << "\n m_AcctID: " << str2
444  << "\n m_ServerID: " << str3 << "\n m_AcctServerID: " << str4
445  << "\n";
446 
447  // OT_FAIL; // I was debugging.
448 
449  return false;
450  }
451  else {
452  // OTString str1(m_AcctID), str2(m_AcctServerID);
453  // otErr << "Expected Account ID and Server ID both *SUCCESSFUL*
454  // match to "
455  // "IDs in the xml:\n Account ID:\n%s\n ServerID:\n%s\n"
456  // "-----------------------------------------------------------------------------\n",
457  // str1.Get(), str2.Get());
458  return true;
459  }
460 }
OTIdentifier m_ID
Definition: OTContract.hpp:172
OTLOG_IMPORT OTLogStream otErr
bool opentxs::OTTransactionType::VerifyNumberOfOrigin ( OTTransactionType compareTo)

Definition at line 520 of file OTTransactionType.cpp.

521 {
522  // Have to use the function here, NOT the internal variable.
523  // (Because subclasses may override the function.)
524  //
525  return (GetNumberOfOrigin() == compareTo.GetNumberOfOrigin());
526 }
virtual EXPORT int64_t GetNumberOfOrigin()

Member Data Documentation

OTIdentifier opentxs::OTTransactionType::m_AcctID
protected

Definition at line 726 of file OTTransactionType.hpp.

OTIdentifier opentxs::OTTransactionType::m_AcctServerID
protected

Definition at line 732 of file OTTransactionType.hpp.

OTIdentifier opentxs::OTTransactionType::m_AcctUserID
protected

Definition at line 740 of file OTTransactionType.hpp.

OTASCIIArmor opentxs::OTTransactionType::m_ascInReferenceTo
protected

Definition at line 767 of file OTTransactionType.hpp.

bool opentxs::OTTransactionType::m_bLoadSecurely
protected

Definition at line 769 of file OTTransactionType.hpp.

int64_t opentxs::OTTransactionType::m_lInReferenceToTransaction
protected

Definition at line 747 of file OTTransactionType.hpp.

int64_t opentxs::OTTransactionType::m_lNumberOfOrigin
protected

Definition at line 765 of file OTTransactionType.hpp.

int64_t opentxs::OTTransactionType::m_lTransactionNum
protected

Definition at line 745 of file OTTransactionType.hpp.

OTNumList opentxs::OTTransactionType::m_Numlist
protected

Definition at line 794 of file OTTransactionType.hpp.

OTIdentifier opentxs::OTTransactionType::m_ServerID
protected

Definition at line 730 of file OTTransactionType.hpp.


The documentation for this class was generated from the following files: