plebble
ttx.h
Go to the documentation of this file.
1 /*
2 -------------------------------------------------------------------------------
3  PLEBBLE
4 -------------------------------------------------------------------------------
5  Copyright (C) 2019-2020 KATLAS Technology. (http://katlastechnology.com)
6  Copyright (C) 2017-2020 Marcos Mayorga. (mm@mm-studios.com)
7 
8  This file is part of our Plebble(R) Platform.
9 
10  The code below cannot be copied, used for any purpose other than the one
11  agreed and/or distributed without the express permission of
12  KATLAS Technology.
13 -------------------------------------------------------------------------------
14 
15 
16 */
17 #ifndef USGOV_365d7619d4ab15a0bfeac147c2ca92094ccd01855fee4a1df00931e41f467e89
18 #define USGOV_365d7619d4ab15a0bfeac147c2ca92094ccd01855fee4a1df00931e41f467e89
19 
20 #include <us/gov/auth.h>
21 #include <us/gov/engine.h>
22 
23 #include <vector>
24 #include <thread>
25 #include <unordered_map>
26 #include <unordered_set>
27 #include <us/gov/crypto/crypto.h>
28 #include "protocol.h"
29 #include "app.h"
30 #include <chrono>
31 #include <cassert>
32 #include <memory>
33 #include <map>
34 
35 namespace us { namespace gov {
36 namespace cash {
37  using namespace std;
38  using socket::datagram;
39  using engine::local_deltas;
40  using crypto::ripemd160;
41  using crypto::ec;
42  using engine::peer_t;
43  typedef crypto::ec::keys keys;
44  typedef keys::pub_t pubkey_t;
45 
46  struct ttx final:engine::evidence {
48 
49  static ttx* from_stream(istream&);
50  static ttx* from_b58(const string&);
51  string to_b58() const;
52 
53  ttx();
54  ~ttx() override {}
55  hash_t compute_hash() const override;
56  string name() const override { return "cash::ttx"; };
58  void to_stream(ostream&) const;
60  void write_pretty(ostream& os) const override;
61  datagram* get_datagram(uint16_t seq) const;
62  bool verify(ostream& os) const override;
63 
64 
69  };
70 
71 
72  static ostream& operator << (ostream&os, const cash::ttx& t) {
73 // t.to_stream(os);
74  os << t.to_b58();
75  return os;
76  }
77 
78 
79 }
80 }}
81 
82 #endif
83 
app.h
us::gov::cash::ttx::get_hash
ec::sigmsg_hasher_t::value_type get_hash() const
us::gov::cash::ttx::compute_hash
hash_t compute_hash() const override
us::gov::crypto::ripemd160::finalize
void finalize(unsigned char hash[output_size])
us::gov::crypto::sha256::write
void write(const unsigned char *data, size_t len)
protocol.h
us::gov::crypto::b58::decode_string
std::string decode_string(const std::string &s)
Definition: base58.cpp:44
us::gov::dfs::peer_t
relay::peer_t peer_t
Definition: daemon.h:31
us
Definition: daemon.h:22
us::gov::crypto::ripemd160::value_type
Definition: ripemd160.h:38
unlikely
#define unlikely(x)
Definition: likely.h:30
us::gov::cash::ttx::supply
cash_t supply
Definition: ttx.h:68
us::gov::cash::pubkey_t
keys::pub_t pubkey_t
Definition: app.h:53
us::gov::crypto::sha256::value_type
Definition: sha256.h:38
us::gov::cash
Definition: app.h:43
likely.h
us::gov::cash::ttx::verify
bool verify(ostream &os) const override
us::gov::cash::app
Definition: app.h:65
us::gov::cash::ttx::get_datagram
datagram * get_datagram(uint16_t seq) const
us::gov::cash::ttx::ttx
ttx()
us::gov::cash::ttx
Definition: ttx.h:46
us::gov::cash::ttx::token
hash_t token
Definition: ttx.h:67
us::gov::socket::datagram
Definition: datagram.h:44
us::gov::crypto::sha256
Definition: sha256.h:33
us::gov::cash::cash_t
tx::cash_t cash_t
Definition: app.h:56
us::gov::cash::ttx::to_stream
void to_stream(ostream &) const
us::gov::engine::auth::pub_t
peer::daemon::pub_t pub_t
Definition: auth_app.h:53
ttx.h
us::gov
Definition: daemon.h:22
us::gov::cash::ttx::to_b58
string to_b58() const
us::gov::crypto::ripemd160
Definition: ripemd160.h:34
us::gov::cash::ttx::locking_program_input
string locking_program_input
Definition: ttx.h:66
us::gov::cash::ttx::name
string name() const override
Definition: ttx.h:56
us::gov::cash::ttx::b
engine::evidence b
Definition: ttx.h:47
c
Definition: client.cpp:417
us::gov::cash::ttx::write_sigmsg
void write_sigmsg(ec::sigmsg_hasher_t &) const
us::gov::cash::keys
crypto::ec::keys keys
Definition: app.h:52
peer.h
us::gov::cash::ttx::from_stream
static ttx * from_stream(istream &)
std
Definition: app.h:380
auth.h
us::gov::crypto::b58::encode
std::string encode(const std::string &s)
Definition: base58.cpp:62
us::gov::cash::ttx::from_b58
static ttx * from_b58(const string &)
base58.h
engine.h
us::gov::crypto::ripemd160::write
void write(const vector< unsigned char > &)
us::gov::cash::ttx::write_pretty
void write_pretty(ostream &os) const override
us::gov::relay::evidence
Definition: evidence.h:31
us::gov::cash::ttx::address
hash_t address
Definition: ttx.h:65
crypto.h
gov.h
us::gov::crypto::sha256::finalize
void finalize(unsigned char hash[output_size])
us::gov::cash::ttx::~ttx
~ttx() override
Definition: ttx.h:54
us::gov::cash::operator<<
static ostream & operator<<(ostream &os, const cash::file_tx &t)
Definition: file_tx.h:71
c
us::gov::cash::ttx c
Definition: ttx.cpp:31