plebble
map_tx.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_531c8869f5f09cb15849809a27cf982fe2b86c5d7f4834171c72e9d62006bb4e
18 #define USGOV_531c8869f5f09cb15849809a27cf982fe2b86c5d7f4834171c72e9d62006bb4e
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 map_tx final:engine::evidence {
48 
49  static map_tx* from_stream(istream&);
50  static map_tx* from_b58(const string&);
51  string to_b58() const;
52 
53  map_tx();
54  ~map_tx() override {}
55  hash_t compute_hash() const override;
56  string name() const override { return "cash::map_tx"; };
58  void to_stream(ostream&) const;
60  void write_pretty(ostream& os) const override;
61  datagram* get_datagram(uint16_t seq) const;
62 
65  string key;
66  string value;
67  };
68 
69 
70  static ostream& operator << (ostream&os, const cash::map_tx& t) {
71 // t.to_stream(os);
72  os << t.to_b58();
73  return os;
74  }
75 
76 
77 }
78 }}
79 
80 #endif
81 
us::gov::cash::map_tx::~map_tx
~map_tx() override
Definition: map_tx.h:54
app.h
us::gov::cash::map_tx::from_stream
static map_tx * from_stream(istream &)
us::gov::cash::map_tx::address
hash_t address
Definition: map_tx.h:63
us::gov::cash::hash_t
hasher_t::value_type hash_t
Definition: app.h:55
us::gov::cash::map_tx::key
string key
Definition: map_tx.h:65
us::gov::crypto::ripemd160::finalize
void finalize(unsigned char hash[output_size])
us::gov::cash::map_tx::name
string name() const override
Definition: map_tx.h:56
us::gov::crypto::sha256::write
void write(const unsigned char *data, size_t len)
us::gov::cash::map_tx::b
engine::evidence b
Definition: map_tx.h:47
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
us::gov::cash::pubkey_t
keys::pub_t pubkey_t
Definition: app.h:53
us::gov::cash::map_tx::from_b58
static map_tx * from_b58(const string &)
us::gov::crypto::sha256::value_type
Definition: sha256.h:38
us::gov::cash
Definition: app.h:43
likely.h
map_tx.h
us::gov::cash::app
Definition: app.h:65
us::gov::cash::map_tx::to_stream
void to_stream(ostream &) const
us::gov::cash::map_tx
Definition: map_tx.h:46
us::gov::socket::datagram
Definition: datagram.h:44
us::gov::crypto::sha256
Definition: sha256.h:33
us::gov::cash::map_tx::locking_program_input
string locking_program_input
Definition: map_tx.h:64
us::gov::cash::map_tx::write_sigmsg
void write_sigmsg(ec::sigmsg_hasher_t &) const
us::gov::engine::auth::pub_t
peer::daemon::pub_t pub_t
Definition: auth_app.h:53
us::gov::cash::map_tx::map_tx
map_tx()
us::gov
Definition: daemon.h:22
us::gov::cash::map_tx::get_datagram
datagram * get_datagram(uint16_t seq) const
us::gov::crypto::ripemd160
Definition: ripemd160.h:34
c
Definition: client.cpp:417
us::gov::cash::keys
crypto::ec::keys keys
Definition: app.h:52
peer.h
std
Definition: app.h:380
auth.h
us::gov::crypto::b58::encode
std::string encode(const std::string &s)
Definition: base58.cpp:62
base58.h
us::gov::cash::map_tx::get_hash
ec::sigmsg_hasher_t::value_type get_hash() const
engine.h
us::gov::crypto::ripemd160::write
void write(const vector< unsigned char > &)
us::gov::cash::map_tx::write_pretty
void write_pretty(ostream &os) const override
us::gov::cash::map_tx::compute_hash
hash_t compute_hash() const override
us::gov::relay::evidence
Definition: evidence.h:31
crypto.h
gov.h
us::gov::crypto::sha256::finalize
void finalize(unsigned char hash[output_size])
c
us::gov::cash::map_tx c
Definition: map_tx.cpp:31
us::gov::cash::map_tx::to_b58
string to_b58() const
us::gov::cash::map_tx::value
string value
Definition: map_tx.h:66
us::gov::cash::operator<<
static ostream & operator<<(ostream &os, const cash::file_tx &t)
Definition: file_tx.h:71