Scorum
escrow.cpp
Go to the documentation of this file.
3 
5 
6 #include <tuple>
7 
8 using namespace scorum::protocol;
9 
10 namespace scorum {
11 namespace chain {
12 
13 dbs_escrow::dbs_escrow(database& db)
14  : base_service_type(db)
15 {
16 }
17 
18 const escrow_object& dbs_escrow::get(const account_name_type& name, uint32_t escrow_id) const
19 {
20  try
21  {
22  return get_by<by_from_id>(boost::make_tuple(name, escrow_id));
23  }
24  FC_CAPTURE_AND_RETHROW((name)(escrow_id))
25 }
26 
27 const escrow_object& dbs_escrow::create_escrow(uint32_t escrow_id,
28  const account_name_type& from,
29  const account_name_type& to,
30  const account_name_type& agent,
31  const time_point_sec& ratification_deadline,
32  const time_point_sec& escrow_expiration,
33  const asset& scorum_amount,
34  const asset& pending_fee)
35 {
36  return create([&](escrow_object& esc) {
37  esc.escrow_id = escrow_id;
38  esc.from = from;
39  esc.to = to;
40  esc.agent = agent;
41  esc.ratification_deadline = ratification_deadline;
42  esc.escrow_expiration = escrow_expiration;
43  esc.scorum_balance = scorum_amount;
44  esc.pending_fee = pending_fee;
45  });
46 }
47 
48 } // namespace chain
49 } // namespace scorum
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
const escrow_object & create_escrow(uint32_t escrow_id, const account_name_type &from, const account_name_type &to, const account_name_type &agent, const time_point_sec &ratification_deadline, const time_point_sec &escrow_expiration, const asset &scorum_amount, const asset &pending_fee) override
Definition: escrow.cpp:27
virtual const object_type & create(const modifier_type &modifier) override
virtual const object_type & get() const override
time_point_sec ratification_deadline
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
Definition: asset.cpp:15