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