提交 a97251d3 编写于 作者: D Daniel Larimer

Many changes:

1. remove ordered_non_unique non-deterministic indices from producer
scheduling
2. added API to return contents of i64 tables
3. updated documentation to reflect deprecation of precondition and
validate
4. remove calls to WASM precondition and validate, but keep them for
native contracts
上级 8fa97e10
......@@ -37,11 +37,11 @@ extern "C" {
storeAccount( N(currency), Account( CurrencyTokens(1000ll*1000ll*1000ll) ) );
}
/// The apply method implements the dispatch of events to this contract
void apply( uint64_t code, uint64_t action ) {
if( code == N(currency) ) {
if( action == N(transfer) )
currency::apply_currency_transfer( currentMessage< TOKEN_NAME::Transfer >() );
}
}
/// The apply method implements the dispatch of events to this contract
void apply( uint64_t code, uint64_t action ) {
if( code == N(currency) ) {
if( action == N(transfer) )
currency::apply_currency_transfer( currentMessage< TOKEN_NAME::Transfer >() );
}
}
}
......@@ -21,31 +21,22 @@
@subsection programentry Entry Points
EOS.IO applications have three potential starting points that behave like `main` in traditional applications:
EOS.IO applications have a `apply` which is like `main` in traditional applications:
```
extern "C" {
void validate( uint64_t code, uint64_t action );
void precondition( uint64_t code, uint64_t action );
void init();
void apply( uint64_t code, uint64_t action );
}
```
Each of these entry points is give the arguments `code` and `action` which uniquely identify every event in
the system. For example, code could be a `currency` contract and action could be `transfer`. This event (code,action)
`main` is give the arguments `code` and `action` which uniquely identify every event in
the system. For example, `code` could be a *currency* contract and `action` could be *transfer*. This event (code,action)
may be passed to several contracts including the `sender` and `receiver`. It is up to your application to figure
out what to do in response to such an event.
Each handler has a different level of access to blockchain state:
- **validate** can only access the data on the message itself
- **precondition** only has read access to the database and message
- **apply** has read/write access to the database
These three different handlers enable EOS.IO to maximize the amount of potential parallelism possible and it may
make sense to move computationaly expensive validations to either precondition or validate. That said, most developers
can postpone learning about `validate` and `precondition` as anything that can be done in those entry points can also
be performed in `apply`.
`init` is another entry point that is called once immediately after loading the code. It is where you should perform
one-time initialization of state.
### Example Apply Entry Handler
......
......@@ -31,6 +31,7 @@
```
{
"head_block_num":449,
"last_irreversible_block_num": 434,
"head_block_id":"000001c1a0f072a5ca76831ac6c6e2988efcf162e953eb40046ec2ceca817a9f",
"head_block_time":"2017-07-18T21:02:24",
"head_block_producer":"initd",
......
......@@ -99,10 +99,10 @@ Macros</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a0c4afa08ec2e44777543fe547d60e9e6"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structeos_1_1token.html">eos::token</a>&lt; <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>, <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">TOKEN_NAME::CurrencyTokens</a></td></tr>
<tr class="separator:a0c4afa08ec2e44777543fe547d60e9e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90f15481940a6f47f7f86fe0ab21bda4"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">TOKEN_NAME::Accounts</a> = <a class="el" href="struct_table.html">Table</a>&lt; <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account), <a class="el" href="struct_account.html">Account</a>, <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> &gt;</td></tr>
<tr class="separator:a90f15481940a6f47f7f86fe0ab21bda4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f84ac76d1761828020f97744b382d3d"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structeos_1_1token.html">eos::token</a>&lt; <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>, <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">TOKEN_NAME::CurrencyTokens</a></td></tr>
<tr class="separator:a1f84ac76d1761828020f97744b382d3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d3c8dd83df1817c27e7a732110b964d"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">TOKEN_NAME::Accounts</a> = <a class="el" href="struct_table.html">Table</a>&lt; <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account), <a class="el" href="struct_account.html">Account</a>, <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> &gt;</td></tr>
<tr class="separator:a7d3c8dd83df1817c27e7a732110b964d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
......
此差异已折叠。
......@@ -73,7 +73,7 @@ Files</h2></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:currency_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="currency_8hpp.html">currency.hpp</a> <a href="currency_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:currency_8wast_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="currency_8wast_8hpp.html">currency.wast.hpp</a> <a href="currency_8wast_8hpp_source.html">[code]</a></td></tr>
<tr class="memitem:currency_2currency_8wast_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="currency_2currency_8wast_8hpp.html">currency.wast.hpp</a> <a href="currency_2currency_8wast_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
......
......@@ -79,6 +79,8 @@ Directories</h2></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:dir_44e8454330c52effb0ef98d8f3108add"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_44e8454330c52effb0ef98d8f3108add.html">social</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:dir_eeb4a3ec8dac95e5edcbc3ddc954d9f0"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_eeb4a3ec8dac95e5edcbc3ddc954d9f0.html">system</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
......
此差异已折叠。
......@@ -68,7 +68,7 @@ $(function() {
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</span><span id="img_0_0_" class="iconfopen" onclick="toggleFolder('0_0_')">&#160;</span><a class="el" href="dir_a9257b511e702fbd3462fee4a063915c.html" target="_self">currency</a></td><td class="desc"></td></tr>
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="currency_8cpp.html" target="_self">currency.cpp</a></td><td class="desc"></td></tr>
<tr id="row_0_0_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a href="currency_8hpp_source.html"><span class="icondoc"></span></a><a class="el" href="currency_8hpp.html" target="_self">currency.hpp</a></td><td class="desc"></td></tr>
<tr id="row_0_0_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a href="currency_8wast_8hpp_source.html"><span class="icondoc"></span></a><a class="el" href="currency_8wast_8hpp.html" target="_self">currency.wast.hpp</a></td><td class="desc"></td></tr>
<tr id="row_0_0_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a href="currency_2currency_8wast_8hpp_source.html"><span class="icondoc"></span></a><a class="el" href="currency_2currency_8wast_8hpp.html" target="_self">currency.wast.hpp</a></td><td class="desc"></td></tr>
<tr id="row_0_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">&#9660;</span><span id="img_0_1_" class="iconfopen" onclick="toggleFolder('0_1_')">&#160;</span><a class="el" href="dir_ef94cdb01f4e9712d25c43b7c1d91b58.html" target="_self">eos</a></td><td class="desc"></td></tr>
<tr id="row_0_1_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="eos_8cpp.html" target="_self">eos.cpp</a></td><td class="desc"></td></tr>
<tr id="row_0_2_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_2_" class="arrow" onclick="toggleFolder('0_2_')">&#9660;</span><span id="img_0_2_" class="iconfopen" onclick="toggleFolder('0_2_')">&#160;</span><a class="el" href="dir_3fea0bf1ce879ce73e6ecec98007efcd.html" target="_self">eoslib</a></td><td class="desc"></td></tr>
......@@ -90,6 +90,10 @@ $(function() {
<tr id="row_0_3_2_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a href="exchange_8wast_8hpp_source.html"><span class="icondoc"></span></a><a class="el" href="exchange_8wast_8hpp.html" target="_self">exchange.wast.hpp</a></td><td class="desc"></td></tr>
<tr id="row_0_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_4_" class="arrow" onclick="toggleFolder('0_4_')">&#9660;</span><span id="img_0_4_" class="iconfopen" onclick="toggleFolder('0_4_')">&#160;</span><a class="el" href="dir_44e8454330c52effb0ef98d8f3108add.html" target="_self">social</a></td><td class="desc"></td></tr>
<tr id="row_0_4_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="social_8cpp.html" target="_self">social.cpp</a></td><td class="desc"></td></tr>
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_5_" class="arrow" onclick="toggleFolder('0_5_')">&#9660;</span><span id="img_0_5_" class="iconfopen" onclick="toggleFolder('0_5_')">&#160;</span><a class="el" href="dir_eeb4a3ec8dac95e5edcbc3ddc954d9f0.html" target="_self">system</a></td><td class="desc"></td></tr>
<tr id="row_0_5_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a href="system_2currency_8wast_8hpp_source.html"><span class="icondoc"></span></a><a class="el" href="system_2currency_8wast_8hpp.html" target="_self">currency.wast.hpp</a></td><td class="desc"></td></tr>
<tr id="row_0_5_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="system_8cpp.html" target="_self">system.cpp</a></td><td class="desc"></td></tr>
<tr id="row_0_5_2_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a href="system_8hpp_source.html"><span class="icondoc"></span></a><a class="el" href="system_8hpp.html" target="_self">system.hpp</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
......
......@@ -89,7 +89,7 @@ $(function() {
: <a class="el" href="structtable__impl_3_01sizeof_07uint128__t_08_00_01sizeof_07uint128__t_08_4.html#a4984b3adead4882fee83286c35f2c323">table_impl&lt; sizeof(uint128_t), sizeof(uint128_t)&gt;</a>
</li>
<li>balance
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ac30ba5f614e7408e3c66804d15aa5db8">TOKEN_NAME::Account</a>
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ab5698707f3194aaafaab1a01aad2faa0">TOKEN_NAME::Account</a>
</li>
<li>base_token_type
: <a class="el" href="structeos_1_1price.html#a05476d75e3da2435489d4360ae0aa9c8">eos::price&lt; BaseToken, QuoteToken &gt;</a>
......@@ -165,7 +165,7 @@ $(function() {
<h3><a id="index_k"></a>- k -</h3><ul>
<li>key
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#af828b3fc2f24217280b1649078f56361">TOKEN_NAME::Account</a>
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a7d8492a8a6c41b19bde5f3cb9b744df1">TOKEN_NAME::Account</a>
</li>
</ul>
......
......@@ -73,7 +73,7 @@ $(function() {
<h3><a id="index_b"></a>- b -</h3><ul>
<li>balance
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ac30ba5f614e7408e3c66804d15aa5db8">TOKEN_NAME::Account</a>
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ab5698707f3194aaafaab1a01aad2faa0">TOKEN_NAME::Account</a>
</li>
</ul>
......@@ -112,7 +112,7 @@ $(function() {
<h3><a id="index_k"></a>- k -</h3><ul>
<li>key
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#af828b3fc2f24217280b1649078f56361">TOKEN_NAME::Account</a>
: <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a7d8492a8a6c41b19bde5f3cb9b744df1">TOKEN_NAME::Account</a>
</li>
</ul>
......
......@@ -66,6 +66,7 @@ $(function() {
</li>
<li>apply()
: <a class="el" href="currency_8cpp.html#a3c01edc4ed313916967237c16feb1446">currency.cpp</a>
, <a class="el" href="system_8cpp.html#a3c01edc4ed313916967237c16feb1446">system.cpp</a>
, <a class="el" href="exchange_8cpp.html#a3c01edc4ed313916967237c16feb1446">exchange.cpp</a>
</li>
<li>apply_social_post()
......@@ -95,7 +96,7 @@ $(function() {
<h3><a id="index_c"></a>- c -</h3><ul>
<li>currency_wast
: <a class="el" href="currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772">currency.wast.hpp</a>
: <a class="el" href="currency_2currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772">currency.wast.hpp</a>
</li>
<li>currentCode()
: <a class="el" href="group__messagecapi.html#ga1f06c06adc584456cf30e8086d6b55b1">message.h</a>
......@@ -134,6 +135,7 @@ $(function() {
<li>init()
: <a class="el" href="currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">currency.cpp</a>
, <a class="el" href="exchange_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">exchange.cpp</a>
, <a class="el" href="system_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">system.cpp</a>
</li>
<li>int128_t
: <a class="el" href="types_8h.html#a811ec3b3c805bfd6b8ec302d59fc5a94">types.h</a>
......@@ -258,6 +260,7 @@ $(function() {
</li>
<li>TOKEN_NAME
: <a class="el" href="currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71">currency.hpp</a>
, <a class="el" href="system_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71">system.hpp</a>
</li>
<li>TokenName
: <a class="el" href="types_8h.html#a619dcf2195dd83ea4fc9aa62c92ec437">types.h</a>
......
......@@ -69,7 +69,8 @@ $(function() {
: <a class="el" href="group__database_cpp.html#ga12e5fe301df20780085295196f30edc1">db.hpp</a>
</li>
<li>TOKEN_NAME
: <a class="el" href="currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71">currency.hpp</a>
: <a class="el" href="system_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71">system.hpp</a>
, <a class="el" href="currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71">currency.hpp</a>
</li>
</ul>
</div><!-- contents -->
......
......@@ -64,6 +64,7 @@ $(function() {
<li>apply()
: <a class="el" href="currency_8cpp.html#a3c01edc4ed313916967237c16feb1446">currency.cpp</a>
, <a class="el" href="exchange_8cpp.html#a3c01edc4ed313916967237c16feb1446">exchange.cpp</a>
, <a class="el" href="system_8cpp.html#a3c01edc4ed313916967237c16feb1446">system.cpp</a>
</li>
<li>apply_social_post()
: <a class="el" href="social_8cpp.html#a2f4b1a700aef8a99b9d4c12d252d231a">social.cpp</a>
......@@ -120,6 +121,7 @@ $(function() {
<h3><a id="index_i"></a>- i -</h3><ul>
<li>init()
: <a class="el" href="currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">currency.cpp</a>
, <a class="el" href="system_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">system.cpp</a>
, <a class="el" href="exchange_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">exchange.cpp</a>
</li>
</ul>
......
......@@ -60,7 +60,7 @@ $(function() {
<div class="contents">
&#160;<ul>
<li>currency_wast
: <a class="el" href="currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772">currency.wast.hpp</a>
: <a class="el" href="currency_2currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772">currency.wast.hpp</a>
</li>
<li>exchange_wast
: <a class="el" href="exchange_8wast_8hpp.html#a94b4779b0cdd17d40fd984c169d37460">exchange.wast.hpp</a>
......
......@@ -99,15 +99,9 @@ Application Structure</h1>
<p>As an application developer you get to decide what actions users can take and which handlers may or must be called in response to those events.</p>
<h2><a class="anchor" id="programentry"></a>
Entry Points</h2>
<p>EOS.IO applications have three potential starting points that behave like <code>main</code> in traditional applications:</p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"> <span class="keywordtype">void</span> validate( <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> action );</div><div class="line"> <span class="keywordtype">void</span> precondition( <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> action );</div><div class="line"> <span class="keywordtype">void</span> <a class="code" href="currency_8cpp.html#a3c01edc4ed313916967237c16feb1446">apply</a>( <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> action );</div><div class="line">}</div></div><!-- fragment --><p>Each of these entry points is give the arguments <code>code</code> and <code>action</code> which uniquely identify every event in the system. For example, code could be a <code>currency</code> contract and action could be <code>transfer</code>. This event (code,action) may be passed to several contracts including the <code>sender</code> and <code>receiver</code>. It is up to your application to figure out what to do in response to such an event.</p>
<p>Each handler has a different level of access to blockchain state:</p>
<ul>
<li><b>validate</b> can only access the data on the message itself</li>
<li><b>precondition</b> only has read access to the database and message</li>
<li><b>apply</b> has read/write access to the database</li>
</ul>
<p>These three different handlers enable EOS.IO to maximize the amount of potential parallelism possible and it may make sense to move computationaly expensive validations to either precondition or validate. That said, most developers can postpone learning about <code>validate</code> and <code>precondition</code> as anything that can be done in those entry points can also be performed in <code>apply</code>.</p>
<p>EOS.IO applications have a <code>apply</code> which is like <code>main</code> in traditional applications:</p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"> <span class="keywordtype">void</span> <a class="code" href="currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947">init</a>();</div><div class="line"> <span class="keywordtype">void</span> <a class="code" href="currency_8cpp.html#a3c01edc4ed313916967237c16feb1446">apply</a>( <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> action );</div><div class="line">}</div></div><!-- fragment --><p><code>main</code> is give the arguments <code>code</code> and <code>action</code> which uniquely identify every event in the system. For example, <code>code</code> could be a <em>currency</em> contract and <code>action</code> could be <em>transfer</em>. This event (code,action) may be passed to several contracts including the <code>sender</code> and <code>receiver</code>. It is up to your application to figure out what to do in response to such an event.</p>
<p><code>init</code> is another entry point that is called once immediately after loading the code. It is where you should perform one-time initialization of state.</p>
<h3>Example Apply Entry Handler</h3>
<p>Generally speaking, you should use your entry handler to dispatch events to functions that implement the majority of your logic and optionally reject events that your contract is unable or unwilling to accept.</p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"> <span class="keywordtype">void</span> <a class="code" href="currency_8cpp.html#a3c01edc4ed313916967237c16feb1446">apply</a>( <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> action ) {</div><div class="line"> <span class="keywordflow">if</span>( code == <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(<a class="code" href="namespacecurrency.html">currency</a>) ) {</div><div class="line"> <span class="keywordflow">if</span>( action == <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(transfer) ) </div><div class="line"> <a class="code" href="namespace_t_o_k_e_n___n_a_m_e.html#ad480ac2ff519e253e8d947fca896a12f">currency::apply_currency_transfer</a>( currentMessage&lt; currency::Transfer &gt;() );</div><div class="line"> } <span class="keywordflow">else</span> {</div><div class="line"> <a class="code" href="group__messagecapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( <span class="keyword">false</span>, <span class="stringliteral">&quot;rejecting unexpected event&quot;</span> );</div><div class="line"> }</div><div class="line"> }</div><div class="line">}</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>When defining your entry points it is required that they are placed in an <code>extern "C"</code> code block so that c++ name mangling does not get applied to the function. </dd></dl>
......
......@@ -73,7 +73,7 @@ Chain API Configuration</h1>
<div class="fragment"><div class="line">http-server-endpoint = 127.0.0.1:8888</div></div><!-- fragment --><h2><a class="anchor" id="v1chaingetinfo"></a>
get_info</h2>
<p>The <code>get_info</code> RPC command can be found at:</p>
<div class="fragment"><div class="line">curl http:<span class="comment">//127.0.0.1:8888/v1/chain/get_info </span></div></div><!-- fragment --><p>And it should return something like: </p><div class="fragment"><div class="line">{ </div><div class="line"> <span class="stringliteral">&quot;head_block_num&quot;</span>:449,</div><div class="line"> <span class="stringliteral">&quot;head_block_id&quot;</span>:<span class="stringliteral">&quot;000001c1a0f072a5ca76831ac6c6e2988efcf162e953eb40046ec2ceca817a9f&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;head_block_time&quot;</span>:<span class="stringliteral">&quot;2017-07-18T21:02:24&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;head_block_producer&quot;</span>:<span class="stringliteral">&quot;initd&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;recent_slots&quot;</span>:<span class="stringliteral">&quot;0000000000000000000000000000000000000000000000000000000000001111&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;participation_rate&quot;</span>:<span class="stringliteral">&quot;0.06250000000000000&quot;</span></div><div class="line">}</div></div><!-- fragment --><h2><a class="anchor" id="v1chaingetblock"></a>
<div class="fragment"><div class="line">curl http:<span class="comment">//127.0.0.1:8888/v1/chain/get_info </span></div></div><!-- fragment --><p>And it should return something like: </p><div class="fragment"><div class="line">{ </div><div class="line"> <span class="stringliteral">&quot;head_block_num&quot;</span>:449,</div><div class="line"> <span class="stringliteral">&quot;last_irreversible_block_num&quot;</span>: 434,</div><div class="line"> <span class="stringliteral">&quot;head_block_id&quot;</span>:<span class="stringliteral">&quot;000001c1a0f072a5ca76831ac6c6e2988efcf162e953eb40046ec2ceca817a9f&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;head_block_time&quot;</span>:<span class="stringliteral">&quot;2017-07-18T21:02:24&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;head_block_producer&quot;</span>:<span class="stringliteral">&quot;initd&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;recent_slots&quot;</span>:<span class="stringliteral">&quot;0000000000000000000000000000000000000000000000000000000000001111&quot;</span>,</div><div class="line"> <span class="stringliteral">&quot;participation_rate&quot;</span>:<span class="stringliteral">&quot;0.06250000000000000&quot;</span></div><div class="line">}</div></div><!-- fragment --><h2><a class="anchor" id="v1chaingetblock"></a>
get_block</h2>
<h3><a class="anchor" id="examplegetlbock"></a>
Example get_block Usage</h3>
......
......@@ -66,12 +66,12 @@ $(function() {
<div class="title">message.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="message_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="message_8h.html">eoslib/message.h</a>&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="print_8hpp.html">eoslib/print.hpp</a>&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="group__messagecppapi.html#ga82362482cd5c990d4b25708a96f72c32"> 22</a></span>&#160; T <a class="code" href="group__messagecppapi.html#ga82362482cd5c990d4b25708a96f72c32">currentMessage</a>() {</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; T value;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <span class="keyword">auto</span> read = <a class="code" href="group__messagecapi.html#ga95a7d555722669cdeb72d6d6d1236893">readMessage</a>( &amp;value, <span class="keyword">sizeof</span>(value) );</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <a class="code" href="group__messagecapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( read &gt;= <span class="keyword">sizeof</span>(value), <span class="stringliteral">&quot;message shorter than expected&quot;</span> );</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="keywordflow">return</span> value;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; }</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <a class="code" href="group__messagecapi.html#gaed0ef9b019ed08c7cc0241c5b4169f13">using ::requireAuth</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <a class="code" href="group__messagecapi.html#ga993633916da61f395c03440e17d720ff">using ::requireNotice</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span>... <a class="code" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">Accounts</a>&gt;</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23"> 42</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">requireNotice</a>( <a class="code" href="types_8h.html#ad67b43dc23285b01176f4c181c59fc23">AccountName</a> name, <a class="code" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">Accounts</a>... accounts ){</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">requireNotice</a>( name );</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <a class="code" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">requireNotice</a>( accounts... );</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; }</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;} <span class="comment">// namespace eos</span></div><div class="ttc" id="print_8hpp_html"><div class="ttname"><a href="print_8hpp.html">print.hpp</a></div></div>
<a href="message_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="message_8h.html">eoslib/message.h</a>&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="print_8hpp.html">eoslib/print.hpp</a>&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="group__messagecppapi.html#ga82362482cd5c990d4b25708a96f72c32"> 22</a></span>&#160; T <a class="code" href="group__messagecppapi.html#ga82362482cd5c990d4b25708a96f72c32">currentMessage</a>() {</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; T value;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <span class="keyword">auto</span> read = <a class="code" href="group__messagecapi.html#ga95a7d555722669cdeb72d6d6d1236893">readMessage</a>( &amp;value, <span class="keyword">sizeof</span>(value) );</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <a class="code" href="group__messagecapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( read &gt;= <span class="keyword">sizeof</span>(value), <span class="stringliteral">&quot;message shorter than expected&quot;</span> );</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="keywordflow">return</span> value;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; }</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <a class="code" href="group__messagecapi.html#gaed0ef9b019ed08c7cc0241c5b4169f13">using ::requireAuth</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <a class="code" href="group__messagecapi.html#ga993633916da61f395c03440e17d720ff">using ::requireNotice</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span>... <a class="code" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">Accounts</a>&gt;</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23"> 42</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">requireNotice</a>( <a class="code" href="types_8h.html#ad67b43dc23285b01176f4c181c59fc23">AccountName</a> name, <a class="code" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">Accounts</a>... accounts ){</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">requireNotice</a>( name );</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <a class="code" href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">requireNotice</a>( accounts... );</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; }</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;} <span class="comment">// namespace eos</span></div><div class="ttc" id="print_8hpp_html"><div class="ttname"><a href="print_8hpp.html">print.hpp</a></div></div>
<div class="ttc" id="types_8h_html_ad67b43dc23285b01176f4c181c59fc23"><div class="ttname"><a href="types_8h.html#ad67b43dc23285b01176f4c181c59fc23">AccountName</a></div><div class="ttdeci">uint64_t AccountName</div><div class="ttdef"><b>Definition:</b> types.h:18</div></div>
<div class="ttc" id="namespace_t_o_k_e_n___n_a_m_e_html_a90f15481940a6f47f7f86fe0ab21bda4"><div class="ttname"><a href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">TOKEN_NAME::Accounts</a></div><div class="ttdeci">Table&lt; N(currency), N(currency), N(account), Account, uint64_t &gt; Accounts</div><div class="ttdef"><b>Definition:</b> currency.hpp:42</div></div>
<div class="ttc" id="group__messagecapi_html_ga993633916da61f395c03440e17d720ff"><div class="ttname"><a href="group__messagecapi.html#ga993633916da61f395c03440e17d720ff">requireNotice</a></div><div class="ttdeci">void requireNotice(AccountName)</div></div>
<div class="ttc" id="message_8h_html"><div class="ttname"><a href="message_8h.html">message.h</a></div></div>
<div class="ttc" id="group__messagecapi_html_ga95a7d555722669cdeb72d6d6d1236893"><div class="ttname"><a href="group__messagecapi.html#ga95a7d555722669cdeb72d6d6d1236893">readMessage</a></div><div class="ttdeci">uint32_t readMessage(void *msg, uint32_t len)</div></div>
<div class="ttc" id="namespace_t_o_k_e_n___n_a_m_e_html_a7d3c8dd83df1817c27e7a732110b964d"><div class="ttname"><a href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">TOKEN_NAME::Accounts</a></div><div class="ttdeci">Table&lt; N(currency), N(currency), N(account), Account, uint64_t &gt; Accounts</div><div class="ttdef"><b>Definition:</b> currency.hpp:42</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdef"><b>Definition:</b> math.hpp:4</div></div>
<div class="ttc" id="group__messagecapi_html_gae2a6ebaf48fe7c69f847ae18f109d09a"><div class="ttname"><a href="group__messagecapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a></div><div class="ttdeci">void assert(uint32_t test, const char *cstr)</div></div>
<div class="ttc" id="group__messagecppapi_html_ga949563fd4a436805bb61fba6d0418e23"><div class="ttname"><a href="group__messagecppapi.html#ga949563fd4a436805bb61fba6d0418e23">eos::requireNotice</a></div><div class="ttdeci">void requireNotice(AccountName name, Accounts... accounts)</div><div class="ttdef"><b>Definition:</b> message.hpp:42</div></div>
......
......@@ -80,10 +80,10 @@ Classes</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a0c4afa08ec2e44777543fe547d60e9e6"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structeos_1_1token.html">eos::token</a>&lt; <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>, <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a></td></tr>
<tr class="separator:a0c4afa08ec2e44777543fe547d60e9e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90f15481940a6f47f7f86fe0ab21bda4"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">Accounts</a> = <a class="el" href="struct_table.html">Table</a>&lt; <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account), <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">Account</a>, <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> &gt;</td></tr>
<tr class="separator:a90f15481940a6f47f7f86fe0ab21bda4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f84ac76d1761828020f97744b382d3d"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structeos_1_1token.html">eos::token</a>&lt; <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>, <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a></td></tr>
<tr class="separator:a1f84ac76d1761828020f97744b382d3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d3c8dd83df1817c27e7a732110b964d"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">Accounts</a> = <a class="el" href="struct_table.html">Table</a>&lt; <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account), <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">Account</a>, <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> &gt;</td></tr>
<tr class="separator:a7d3c8dd83df1817c27e7a732110b964d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
......@@ -96,28 +96,28 @@ Functions</h2></td></tr>
<tr class="separator:a1de45851aa74bc1e9b4793dfe99717db"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a90f15481940a6f47f7f86fe0ab21bda4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90f15481940a6f47f7f86fe0ab21bda4">&#9670;&nbsp;</a></span>Accounts</h2>
<a id="a7d3c8dd83df1817c27e7a732110b964d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d3c8dd83df1817c27e7a732110b964d">&#9670;&nbsp;</a></span>Accounts</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">using <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">TOKEN_NAME::Accounts</a> = typedef <a class="el" href="struct_table.html">Table</a>&lt;<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency),<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency),<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account),<a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">Account</a>,<a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&gt;</td>
<td class="memname">typedef <a class="el" href="struct_table.html">Table</a>&lt; <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account), <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">Account</a>, <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> &gt; <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">TOKEN_NAME::Accounts</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a0c4afa08ec2e44777543fe547d60e9e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c4afa08ec2e44777543fe547d60e9e6">&#9670;&nbsp;</a></span>CurrencyTokens</h2>
<a id="a1f84ac76d1761828020f97744b382d3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f84ac76d1761828020f97744b382d3d">&#9670;&nbsp;</a></span>CurrencyTokens</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="structeos_1_1token.html">eos::token</a>&lt;<a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>,<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency)&gt; <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">TOKEN_NAME::CurrencyTokens</a></td>
<td class="memname">typedef <a class="el" href="structeos_1_1token.html">eos::token</a>&lt; <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>, <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(currency)&gt; <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">TOKEN_NAME::CurrencyTokens</a></td>
</tr>
</table>
</div><div class="memdoc">
......@@ -141,6 +141,10 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>token subtraction has underflow assertion</p>
<p>token addition has overflow assertion</p>
<p>token subtraction has underflow assertion</p>
<p>token addition has overflow assertion</p>
<p>token subtraction has underflow assertion</p>
<p>token addition has overflow assertion </p>
</div>
......@@ -171,6 +175,8 @@ Functions</h2></td></tr>
<p>Accounts information for owner is stored:</p>
<p>owner/TOKEN_NAME/account/account -&gt; <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html" title="row in Account table stored within each scope ">Account</a></p>
<p>This API is made available for 3rd parties wanting read access to the users balance. If the account doesn't exist a default constructed account will be returned. </p>
<p>scope, record</p>
<p>scope, record</p>
<p>scope, record </p>
</div>
......@@ -201,6 +207,10 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>value, scope</p>
<p>value, scope</p>
<p>value, scope</p>
<p>value, scope</p>
<p>value, scope</p>
<p>value, scope </p>
</div>
......
......@@ -63,7 +63,7 @@ $(function() {
<h3><a id="index_a"></a>- a -</h3><ul>
<li>Accounts
: <a class="el" href="namespaceexchange.html#a3e8714151a75109ae4a632aca1f17f4f">exchange</a>
, <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">TOKEN_NAME</a>
, <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">TOKEN_NAME</a>
</li>
<li>apply_currency_transfer()
: <a class="el" href="namespaceexchange.html#a7d1831d86ebf1c90cc808e7dbab7b33d">exchange</a>
......@@ -83,7 +83,7 @@ $(function() {
<h3><a id="index_c"></a>- c -</h3><ul>
<li>CurrencyTokens
: <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">TOKEN_NAME</a>
: <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">TOKEN_NAME</a>
</li>
<li>currentMessage()
: <a class="el" href="group__messagecppapi.html#ga82362482cd5c990d4b25708a96f72c32">eos</a>
......
......@@ -61,10 +61,10 @@ $(function() {
&#160;<ul>
<li>Accounts
: <a class="el" href="namespaceexchange.html#a3e8714151a75109ae4a632aca1f17f4f">exchange</a>
, <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4">TOKEN_NAME</a>
, <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d">TOKEN_NAME</a>
</li>
<li>CurrencyTokens
: <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">TOKEN_NAME</a>
: <a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">TOKEN_NAME</a>
</li>
<li>EosTokens
: <a class="el" href="namespaceexchange.html#a4baba04c15c74c49f57d6499c4332746">exchange</a>
......
var searchData=
[
['account',['Account',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html',1,'TOKEN_NAME::Account'],['../struct_account.html',1,'Account'],['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d',1,'TOKEN_NAME::Account::Account()']]],
['account',['Account',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html',1,'TOKEN_NAME::Account'],['../struct_account.html',1,'Account'],['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d',1,'TOKEN_NAME::Account::Account(CurrencyTokens b=CurrencyTokens())'],['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d',1,'TOKEN_NAME::Account::Account(CurrencyTokens b=CurrencyTokens())']]],
['accountname',['AccountName',['../types_8h.html#ad67b43dc23285b01176f4c181c59fc23',1,'types.h']]],
['accounts',['Accounts',['../namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4',1,'TOKEN_NAME::Accounts()'],['../namespaceexchange.html#a3e8714151a75109ae4a632aca1f17f4f',1,'exchange::Accounts()']]],
['accounts',['Accounts',['../namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d',1,'TOKEN_NAME::Accounts()'],['../namespaceexchange.html#a3e8714151a75109ae4a632aca1f17f4f',1,'exchange::Accounts()']]],
['action_5ftype',['action_type',['../structeos_1_1_transfer.html#aaac21d57f1ccb0f7970bbf01e5b04e56',1,'eos::Transfer']]],
['apply',['apply',['../currency_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;currency.cpp'],['../exchange_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;exchange.cpp']]],
['apply',['apply',['../currency_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;currency.cpp'],['../exchange_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;exchange.cpp'],['../system_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;system.cpp']]],
['apply_5fcurrency_5ftransfer',['apply_currency_transfer',['../namespace_t_o_k_e_n___n_a_m_e.html#ad480ac2ff519e253e8d947fca896a12f',1,'TOKEN_NAME::apply_currency_transfer()'],['../namespaceexchange.html#a7d1831d86ebf1c90cc808e7dbab7b33d',1,'exchange::apply_currency_transfer()']]],
['apply_5feos_5ftransfer',['apply_eos_transfer',['../namespaceexchange.html#a7cd292ab951651316cbdaab066d73f22',1,'exchange']]],
['apply_5fexchange_5fbuy',['apply_exchange_buy',['../namespaceexchange.html#a144bb14807f5677faf9d569813f9294e',1,'exchange']]],
......
......@@ -6,7 +6,7 @@ var searchData=
['back_5fprimary_5fi128i128',['back_primary_i128i128',['../group__dbi128i128.html#gaf0a1acf3fb55de991ed41f5b4b6b33fd',1,'db.h']]],
['back_5fsecondary',['back_secondary',['../structtable__impl_3_01sizeof_07uint128__t_08_00_01sizeof_07uint128__t_08_4.html#a4984b3adead4882fee83286c35f2c323',1,'table_impl&lt; sizeof(uint128_t), sizeof(uint128_t)&gt;']]],
['back_5fsecondary_5fi128i128',['back_secondary_i128i128',['../group__dbi128i128.html#ga3f5654fc7a706aa7f9b042583606b945',1,'db.h']]],
['balance',['balance',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ac30ba5f614e7408e3c66804d15aa5db8',1,'TOKEN_NAME::Account']]],
['balance',['balance',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ab5698707f3194aaafaab1a01aad2faa0',1,'TOKEN_NAME::Account']]],
['base_5ftoken_5ftype',['base_token_type',['../structeos_1_1price.html#a05476d75e3da2435489d4360ae0aa9c8',1,'eos::price']]],
['buyorder',['BuyOrder',['../structexchange_1_1_buy_order.html',1,'exchange']]],
['builtin_20types',['Builtin Types',['../group__types.html',1,'']]]
......
......@@ -14,5 +14,7 @@ var searchData=
['store',['store',['../structtable__impl_3_01sizeof_07uint128__t_08_00_01sizeof_07uint128__t_08_4.html#affeb2eaa164859cc33e2b5e5aa09644a',1,'table_impl&lt; sizeof(uint128_t), sizeof(uint128_t)&gt;::store()'],['../structtable__impl_3_01sizeof_07uint64__t_08_00_010_01_4.html#acc1fda949f49e2b0c611b72701bebb6f',1,'table_impl&lt; sizeof(uint64_t), 0 &gt;::store()'],['../struct_table.html#a980d7e5d3be9cb202740bc2354ed0f03',1,'Table::store()'],['../struct_table_3_01scope_00_01code_00_01table_00_01_record_00_01_primary_type_00_01void_01_4.html#a67227170d497fb1ad7cc300db9b0dc74',1,'Table&lt; scope, code, table, Record, PrimaryType, void &gt;::store()']]],
['store_5fi128i128',['store_i128i128',['../group__dbi128i128.html#gaf4283a9f6e7845e8dd23740855386916',1,'db.h']]],
['store_5fi64',['store_i64',['../group__dbi64.html#gad62abe6567bdf68ebd2464e757fdced8',1,'db.h']]],
['storeaccount',['storeAccount',['../namespace_t_o_k_e_n___n_a_m_e.html#a9e234bedec057f2367390b88c3b73ad8',1,'TOKEN_NAME']]]
['storeaccount',['storeAccount',['../namespace_t_o_k_e_n___n_a_m_e.html#a9e234bedec057f2367390b88c3b73ad8',1,'TOKEN_NAME']]],
['system_2ecpp',['system.cpp',['../system_8cpp.html',1,'']]],
['system_2ehpp',['system.hpp',['../system_8hpp.html',1,'']]]
];
......@@ -14,7 +14,7 @@ var searchData=
['token_2ehpp',['token.hpp',['../token_8hpp.html',1,'']]],
['token_3c_20uint64_5ft_2c_20n_28currency_29_3e',['token&lt; uint64_t, N(currency)&gt;',['../structeos_1_1token.html',1,'eos']]],
['token_3c_20uint64_5ft_2c_20n_28eos_29_3e',['token&lt; uint64_t, N(eos)&gt;',['../structeos_1_1token.html',1,'eos']]],
['token_5fname',['TOKEN_NAME',['../namespace_t_o_k_e_n___n_a_m_e.html',1,'TOKEN_NAME'],['../currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71',1,'TOKEN_NAME():&#160;currency.hpp']]],
['token_5fname',['TOKEN_NAME',['../namespace_t_o_k_e_n___n_a_m_e.html',1,'TOKEN_NAME'],['../currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71',1,'TOKEN_NAME():&#160;currency.hpp'],['../system_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71',1,'TOKEN_NAME():&#160;system.hpp']]],
['tokenname',['TokenName',['../types_8h.html#a619dcf2195dd83ea4fc9aa62c92ec437',1,'types.h']]],
['tokens',['Tokens',['../namespaceeos.html#a100da99668f0d5c65bf15dae78926104',1,'eos::Tokens()'],['../group__tokens.html',1,'(Global Namespace)']]],
['total_5fvotes',['total_votes',['../struct_post_record.html#aca901b24573f6a0bf3e1058b197b6174',1,'PostRecord']]],
......
......@@ -9,10 +9,10 @@ var searchData=
['created',['created',['../struct_post_record.html#a4b0c19a41eb0d64a06d95321027fd792',1,'PostRecord']]],
['currency_2ecpp',['currency.cpp',['../currency_8cpp.html',1,'']]],
['currency_2ehpp',['currency.hpp',['../currency_8hpp.html',1,'']]],
['currency_2ewast_2ehpp',['currency.wast.hpp',['../currency_8wast_8hpp.html',1,'']]],
['currency_2ewast_2ehpp',['currency.wast.hpp',['../currency_2currency_8wast_8hpp.html',1,'(Global Namespace)'],['../system_2currency_8wast_8hpp.html',1,'(Global Namespace)']]],
['currency_5ftype',['currency_type',['../structeos_1_1token.html#a185ffd9fee7a6383ef028c3a4d7c2dee',1,'eos::token']]],
['currency_5fwast',['currency_wast',['../currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772',1,'currency.wast.hpp']]],
['currencytokens',['CurrencyTokens',['../namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6',1,'TOKEN_NAME']]],
['currency_5fwast',['currency_wast',['../currency_2currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772',1,'currency_wast():&#160;currency.wast.hpp'],['../system_2currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772',1,'currency_wast():&#160;currency.wast.hpp']]],
['currencytokens',['CurrencyTokens',['../namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d',1,'TOKEN_NAME']]],
['currentcode',['currentCode',['../group__messagecapi.html#ga1f06c06adc584456cf30e8086d6b55b1',1,'message.h']]],
['currentmessage',['currentMessage',['../group__messagecppapi.html#ga82362482cd5c990d4b25708a96f72c32',1,'eos']]]
];
var searchData=
[
['init',['init',['../currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;currency.cpp'],['../exchange_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;exchange.cpp']]],
['init',['init',['../currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;currency.cpp'],['../exchange_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;exchange.cpp'],['../system_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;system.cpp']]],
['int128_5ft',['int128_t',['../types_8h.html#a811ec3b3c805bfd6b8ec302d59fc5a94',1,'types.h']]],
['int32_5ft',['int32_t',['../types_8h.html#a0d2e949ab6a1bb62f1b295cc79bc1f60',1,'types.h']]],
['int64_5ft',['int64_t',['../types_8h.html#a996e72f71b11a5bb8b3b7b6936b1516d',1,'types.h']]],
['iostream',['iostream',['../classeos_1_1iostream.html',1,'eos']]],
['isempty',['isEmpty',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8',1,'TOKEN_NAME::Account']]]
['isempty',['isEmpty',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8',1,'TOKEN_NAME::Account::isEmpty() const'],['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8',1,'TOKEN_NAME::Account::isEmpty() const']]]
];
var searchData=
[
['key',['key',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#af828b3fc2f24217280b1649078f56361',1,'TOKEN_NAME::Account']]]
['key',['key',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a7d8492a8a6c41b19bde5f3cb9b744df1',1,'TOKEN_NAME::Account']]]
];
var searchData=
[
['token_5fname',['TOKEN_NAME',['../currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71',1,'currency.hpp']]]
['token_5fname',['TOKEN_NAME',['../currency_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71',1,'TOKEN_NAME():&#160;currency.hpp'],['../system_8hpp.html#a2bf6bf152ba93be8cace72c5d55abc71',1,'TOKEN_NAME():&#160;system.hpp']]]
];
......@@ -3,5 +3,5 @@ var searchData=
['contracts_2edox',['contracts.dox',['../contracts_8dox.html',1,'']]],
['currency_2ecpp',['currency.cpp',['../currency_8cpp.html',1,'']]],
['currency_2ehpp',['currency.hpp',['../currency_8hpp.html',1,'']]],
['currency_2ewast_2ehpp',['currency.wast.hpp',['../currency_8wast_8hpp.html',1,'']]]
['currency_2ewast_2ehpp',['currency.wast.hpp',['../currency_2currency_8wast_8hpp.html',1,'(Global Namespace)'],['../system_2currency_8wast_8hpp.html',1,'(Global Namespace)']]]
];
var searchData=
[
['social_2ecpp',['social.cpp',['../social_8cpp.html',1,'']]]
['social_2ecpp',['social.cpp',['../social_8cpp.html',1,'']]],
['system_2ecpp',['system.cpp',['../system_8cpp.html',1,'']]],
['system_2ehpp',['system.hpp',['../system_8hpp.html',1,'']]]
];
var searchData=
[
['account',['Account',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d',1,'TOKEN_NAME::Account']]],
['apply',['apply',['../currency_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;currency.cpp'],['../exchange_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;exchange.cpp']]],
['account',['Account',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d',1,'TOKEN_NAME::Account::Account(CurrencyTokens b=CurrencyTokens())'],['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d',1,'TOKEN_NAME::Account::Account(CurrencyTokens b=CurrencyTokens())']]],
['apply',['apply',['../currency_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;currency.cpp'],['../exchange_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;exchange.cpp'],['../system_8cpp.html#a3c01edc4ed313916967237c16feb1446',1,'apply(uint64_t code, uint64_t action):&#160;system.cpp']]],
['apply_5fcurrency_5ftransfer',['apply_currency_transfer',['../namespace_t_o_k_e_n___n_a_m_e.html#ad480ac2ff519e253e8d947fca896a12f',1,'TOKEN_NAME::apply_currency_transfer()'],['../namespaceexchange.html#a7d1831d86ebf1c90cc808e7dbab7b33d',1,'exchange::apply_currency_transfer()']]],
['apply_5feos_5ftransfer',['apply_eos_transfer',['../namespaceexchange.html#a7cd292ab951651316cbdaab066d73f22',1,'exchange']]],
['apply_5fexchange_5fbuy',['apply_exchange_buy',['../namespaceexchange.html#a144bb14807f5677faf9d569813f9294e',1,'exchange']]],
......
var searchData=
[
['init',['init',['../currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;currency.cpp'],['../exchange_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;exchange.cpp']]],
['isempty',['isEmpty',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8',1,'TOKEN_NAME::Account']]]
['init',['init',['../currency_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;currency.cpp'],['../exchange_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;exchange.cpp'],['../system_8cpp.html#a02fd73d861ef2e4aabb38c0c9ff82947',1,'init():&#160;system.cpp']]],
['isempty',['isEmpty',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8',1,'TOKEN_NAME::Account::isEmpty() const'],['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8',1,'TOKEN_NAME::Account::isEmpty() const']]]
];
var searchData=
[
['accountname',['AccountName',['../types_8h.html#ad67b43dc23285b01176f4c181c59fc23',1,'types.h']]],
['accounts',['Accounts',['../namespace_t_o_k_e_n___n_a_m_e.html#a90f15481940a6f47f7f86fe0ab21bda4',1,'TOKEN_NAME::Accounts()'],['../namespaceexchange.html#a3e8714151a75109ae4a632aca1f17f4f',1,'exchange::Accounts()']]]
['accounts',['Accounts',['../namespace_t_o_k_e_n___n_a_m_e.html#a7d3c8dd83df1817c27e7a732110b964d',1,'TOKEN_NAME::Accounts()'],['../namespaceexchange.html#a3e8714151a75109ae4a632aca1f17f4f',1,'exchange::Accounts()']]]
];
var searchData=
[
['currencytokens',['CurrencyTokens',['../namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6',1,'TOKEN_NAME']]]
['currencytokens',['CurrencyTokens',['../namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d',1,'TOKEN_NAME']]]
];
var searchData=
[
['balance',['balance',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ac30ba5f614e7408e3c66804d15aa5db8',1,'TOKEN_NAME::Account']]]
['balance',['balance',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ab5698707f3194aaafaab1a01aad2faa0',1,'TOKEN_NAME::Account']]]
];
......@@ -3,5 +3,5 @@ var searchData=
['claimed_5fvotes',['claimed_votes',['../struct_post_record.html#a92b0a2e8d938957f6a001cba7b1ec53b',1,'PostRecord']]],
['created',['created',['../struct_post_record.html#a4b0c19a41eb0d64a06d95321027fd792',1,'PostRecord']]],
['currency_5ftype',['currency_type',['../structeos_1_1token.html#a185ffd9fee7a6383ef028c3a4d7c2dee',1,'eos::token']]],
['currency_5fwast',['currency_wast',['../currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772',1,'currency.wast.hpp']]]
['currency_5fwast',['currency_wast',['../currency_2currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772',1,'currency_wast():&#160;currency.wast.hpp'],['../system_2currency_8wast_8hpp.html#af81b0cff9cea75a78074db8df522e772',1,'currency_wast():&#160;currency.wast.hpp']]]
];
var searchData=
[
['key',['key',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#af828b3fc2f24217280b1649078f56361',1,'TOKEN_NAME::Account']]]
['key',['key',['../struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a7d8492a8a6c41b19bde5f3cb9b744df1',1,'TOKEN_NAME::Account']]]
];
......@@ -70,9 +70,11 @@ $(function() {
<p>This is the complete list of members for <a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d">Account</a>(CurrencyTokens b=CurrencyTokens())</td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ac30ba5f614e7408e3c66804d15aa5db8">balance</a></td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d">Account</a>(CurrencyTokens b=CurrencyTokens())</td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ab5698707f3194aaafaab1a01aad2faa0">balance</a></td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8">isEmpty</a>() const</td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8">isEmpty</a>() const</td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#af828b3fc2f24217280b1649078f56361">key</a></td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a7d8492a8a6c41b19bde5f3cb9b744df1">key</a></td><td class="entry"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html">TOKEN_NAME::Account</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
......
......@@ -78,21 +78,51 @@ $(function() {
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:acc96b530db9c63a37c07de6b062c2e9d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d">Account</a> (<a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a> b=<a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a>())</td></tr>
<tr class="memitem:acc96b530db9c63a37c07de6b062c2e9d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d">Account</a> (<a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a> b=<a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>())</td></tr>
<tr class="separator:acc96b530db9c63a37c07de6b062c2e9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9054490f61b926c7392384b48e2b0ca8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8">isEmpty</a> () const</td></tr>
<tr class="separator:a9054490f61b926c7392384b48e2b0ca8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc96b530db9c63a37c07de6b062c2e9d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#acc96b530db9c63a37c07de6b062c2e9d">Account</a> (<a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a> b=<a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>())</td></tr>
<tr class="separator:acc96b530db9c63a37c07de6b062c2e9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9054490f61b926c7392384b48e2b0ca8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a9054490f61b926c7392384b48e2b0ca8">isEmpty</a> () const</td></tr>
<tr class="separator:a9054490f61b926c7392384b48e2b0ca8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:af828b3fc2f24217280b1649078f56361"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#af828b3fc2f24217280b1649078f56361">key</a> = <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account)</td></tr>
<tr class="separator:af828b3fc2f24217280b1649078f56361"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac30ba5f614e7408e3c66804d15aa5db8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ac30ba5f614e7408e3c66804d15aa5db8">balance</a></td></tr>
<tr class="separator:ac30ba5f614e7408e3c66804d15aa5db8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d8492a8a6c41b19bde5f3cb9b744df1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#a7d8492a8a6c41b19bde5f3cb9b744df1">key</a> = <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account)</td></tr>
<tr class="separator:a7d8492a8a6c41b19bde5f3cb9b744df1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5698707f3194aaafaab1a01aad2faa0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_account.html#ab5698707f3194aaafaab1a01aad2faa0">balance</a></td></tr>
<tr class="separator:ab5698707f3194aaafaab1a01aad2faa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="acc96b530db9c63a37c07de6b062c2e9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc96b530db9c63a37c07de6b062c2e9d">&#9670;&nbsp;</a></span>Account()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#acc96b530db9c63a37c07de6b062c2e9d">&#9670;&nbsp;</a></span>Account() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">TOKEN_NAME::Account::Account </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>&#160;</td>
<td class="paramname"><em>b</em> = <code><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>()</code></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="acc96b530db9c63a37c07de6b062c2e9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc96b530db9c63a37c07de6b062c2e9d">&#9670;&nbsp;</a></span>Account() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
......@@ -103,8 +133,8 @@ Public Attributes</h2></td></tr>
<tr>
<td class="memname">TOKEN_NAME::Account::Account </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a>&#160;</td>
<td class="paramname"><em>b</em> = <code><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a>()</code></td><td>)</td>
<td class="paramtype"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>&#160;</td>
<td class="paramname"><em>b</em> = <code><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>()</code></td><td>)</td>
<td></td>
</tr>
</table>
......@@ -119,7 +149,32 @@ Public Attributes</h2></td></tr>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9054490f61b926c7392384b48e2b0ca8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9054490f61b926c7392384b48e2b0ca8">&#9670;&nbsp;</a></span>isEmpty()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#a9054490f61b926c7392384b48e2b0ca8">&#9670;&nbsp;</a></span>isEmpty() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool TOKEN_NAME::Account::isEmpty </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a9054490f61b926c7392384b48e2b0ca8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9054490f61b926c7392384b48e2b0ca8">&#9670;&nbsp;</a></span>isEmpty() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
......@@ -144,28 +199,28 @@ Public Attributes</h2></td></tr>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ac30ba5f614e7408e3c66804d15aa5db8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac30ba5f614e7408e3c66804d15aa5db8">&#9670;&nbsp;</a></span>balance</h2>
<a id="ab5698707f3194aaafaab1a01aad2faa0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5698707f3194aaafaab1a01aad2faa0">&#9670;&nbsp;</a></span>balance</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a> TOKEN_NAME::Account::balance</td>
<td class="memname"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a> Account::balance</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="af828b3fc2f24217280b1649078f56361"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af828b3fc2f24217280b1649078f56361">&#9670;&nbsp;</a></span>key</h2>
<a id="a7d8492a8a6c41b19bde5f3cb9b744df1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d8492a8a6c41b19bde5f3cb9b744df1">&#9670;&nbsp;</a></span>key</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> TOKEN_NAME::Account::key = <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account)</td>
<td class="memname">const <a class="el" href="types_8h.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> Account::key = <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(account)</td>
</tr>
</table>
</div><div class="memdoc">
......@@ -173,8 +228,9 @@ Public Attributes</h2></td></tr>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>contracts/currency/<a class="el" href="currency_8hpp_source.html">currency.hpp</a></li>
<li>contracts/system/<a class="el" href="system_8hpp_source.html">system.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
......
......@@ -78,7 +78,7 @@ Public Attributes</h2></td></tr>
<tr class="separator:a362f583628aa3e17ea756cb060a94779"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75350616e02bd681c0e8b12ca4cf7a38"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#ad67b43dc23285b01176f4c181c59fc23">AccountName</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_transfer.html#a75350616e02bd681c0e8b12ca4cf7a38">to</a></td></tr>
<tr class="separator:a75350616e02bd681c0e8b12ca4cf7a38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2892db9fb7756afd55846ef6979406e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_transfer.html#a2892db9fb7756afd55846ef6979406e4">quantity</a></td></tr>
<tr class="memitem:a2892db9fb7756afd55846ef6979406e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_t_o_k_e_n___n_a_m_e_1_1_transfer.html#a2892db9fb7756afd55846ef6979406e4">quantity</a></td></tr>
<tr class="separator:a2892db9fb7756afd55846ef6979406e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
......@@ -105,7 +105,7 @@ Public Attributes</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a0c4afa08ec2e44777543fe547d60e9e6">CurrencyTokens</a> TOKEN_NAME::Transfer::quantity</td>
<td class="memname"><a class="el" href="namespace_t_o_k_e_n___n_a_m_e.html#a1f84ac76d1761828020f97744b382d3d">CurrencyTokens</a> TOKEN_NAME::Transfer::quantity</td>
</tr>
</table>
</div><div class="memdoc">
......@@ -126,8 +126,9 @@ Public Attributes</h2></td></tr>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>contracts/currency/<a class="el" href="currency_8hpp_source.html">currency.hpp</a></li>
<li>contracts/system/<a class="el" href="system_8hpp_source.html">system.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
......
......@@ -49,10 +49,9 @@ namespace eos { namespace chain {
member<key_value_object, AccountName, &key_value_object::scope>,
member<key_value_object, AccountName, &key_value_object::code>,
member<key_value_object, AccountName, &key_value_object::table>,
member<key_value_object, AccountName, &key_value_object::key>,
member<key_value_object, shared_string, &key_value_object::value>
member<key_value_object, AccountName, &key_value_object::key>
>,
composite_key_compare< std::less<AccountName>,std::less<AccountName>,std::less<AccountName>,std::less<AccountName>,chainbase::strcmp_less >
composite_key_compare< std::less<AccountName>,std::less<AccountName>,std::less<AccountName>,std::less<AccountName> >
>
>
>;
......
......@@ -49,6 +49,7 @@ using producer_multi_index = chainbase::shared_multi_index_container<
indexed_by<
ordered_unique<tag<by_id>, member<producer_object, producer_object::id_type, &producer_object::id>>,
ordered_unique<tag<by_owner>, member<producer_object, AccountName, &producer_object::owner>>,
#warning using ordered_non_unique is not deterministic
ordered_non_unique<tag<by_key>, member<producer_object, public_key_type, &producer_object::signing_key>>
>
>;
......
......@@ -388,9 +388,7 @@ DEFINE_INTRINSIC_FUNCTION1(env,free,free,none,i32,ptr) {
}
} FC_CAPTURE_AND_RETHROW( (name)(current_validate_context->msg.type) ) }
void wasm_interface::vm_precondition() { vm_call("precondition" ); }
void wasm_interface::vm_apply() { vm_call("apply" ); }
void wasm_interface::vm_validate() { vm_call("validate"); }
void wasm_interface::vm_apply() { vm_call("apply" ); }
void wasm_interface::vm_onInit()
{ try {
......@@ -416,22 +414,25 @@ DEFINE_INTRINSIC_FUNCTION1(env,free,free,none,i32,ptr) {
} FC_CAPTURE_AND_RETHROW() }
void wasm_interface::validate( message_validate_context& c ) {
/*
current_validate_context = &c;
current_precondition_context = nullptr;
current_apply_context = nullptr;
load( c.code, c.db );
vm_validate();
*/
}
void wasm_interface::precondition( precondition_validate_context& c ) {
try {
/*
current_validate_context = &c;
current_precondition_context = &c;
load( c.code, c.db );
vm_precondition();
*/
} FC_CAPTURE_AND_RETHROW() }
......
......@@ -46,6 +46,7 @@ class ProducerVotesObject : public chainbase::object<chain::producer_votes_objec
void updateVotes(types::ShareType deltaVotes, types::UInt128 currentRaceTime);
/// @brief Get the number of votes this producer has received
types::ShareType getVotes() const { return race.speed; }
pair<types::ShareType,id_type> getVoteOrder()const { return std::tie( race.speed, id ); }
/**
* These fields are used for the producer scheduling algorithm which uses a virtual race to ensure that runner-up
......@@ -100,6 +101,9 @@ class ProducerVotesObject : public chainbase::object<chain::producer_votes_objec
void startNewRaceLap(types::UInt128 currentRaceTime) { race.update(race.speed, 0, currentRaceTime); }
types::UInt128 projectedRaceFinishTime() const { return race.projectedFinishTime; }
typedef std::pair<types::UInt128,id_type> rft_order_type;
rft_order_type projectedRaceFinishTimeOrder() const { return std::tie(race.projectedFinishTime,id); }
};
/**
......@@ -194,12 +198,22 @@ using ProducerVotesMultiIndex = chainbase::shared_multi_index_container<
member<ProducerVotesObject, types::AccountName, &ProducerVotesObject::ownerName>
>,
ordered_non_unique<tag<byVotes>,
const_mem_fun<ProducerVotesObject, types::ShareType, &ProducerVotesObject::getVotes>,
std::greater<types::ShareType>
>,
ordered_non_unique<tag<byProjectedRaceFinishTime>,
const_mem_fun<ProducerVotesObject, types::UInt128, &ProducerVotesObject::projectedRaceFinishTime>
const_mem_fun<ProducerVotesObject, std::pair<types::ShareType,ProducerVotesObject::id_type>, &ProducerVotesObject::getVoteOrder>,
std::greater< std::pair<types::ShareType, ProducerVotesObject::id_type> >
>,
ordered_unique<tag<byProjectedRaceFinishTime>,
const_mem_fun<ProducerVotesObject, ProducerVotesObject::rft_order_type, &ProducerVotesObject::projectedRaceFinishTimeOrder>
>
/*
For some reason this does not compile, so I simulate it by adding a new method
ordered_unique<tag<byVotes>,
composite_key<
const_mem_fun<ProducerVotesObject, types::ShareType, &ProducerVotesObject::getVotes>,
member<ProducerVotesObject, ProducerVotesObject::id_type, &ProducerVotesObject::id>
>,
composite_key_compare< std::greater<types::ShareType>, std::less<ProducerVotesObject::id_type> >
>*//*,
*/
>
>;
......
......@@ -100,19 +100,19 @@ void apply_staked_setproducer(apply_context& context) {
auto producer = db.find<producer_object, by_owner>(update.name);
if (producer)
db.modify(*producer, [&update](producer_object& p) {
db.modify(*producer, [&](producer_object& p) {
p.signing_key = update.key;
p.configuration = update.configuration;
});
else {
db.create<producer_object>([&update](producer_object& p) {
db.create<producer_object>([&](producer_object& p) {
p.owner = update.name;
p.signing_key = update.key;
p.configuration = update.configuration;
});
auto raceTime = ProducerScheduleObject::get(db).currentRaceTime;
db.create<ProducerVotesObject>([name = update.name, raceTime](ProducerVotesObject& pvo) {
pvo.ownerName = name;
db.create<ProducerVotesObject>([&](ProducerVotesObject& pvo) {
pvo.ownerName = update.name;
pvo.startNewRaceLap(raceTime);
});
}
......
......@@ -79,13 +79,12 @@ void precondition_system_newaccount(precondition_validate_context& context) {
#warning TODO: make sure creation deposit is greater than min account balance
auto validate_authority_preconditions = [&context](const auto& auth) {
/// validate_authority_preconditions
for( const auto& auth : { create.owner, create.active, create.recovery } ){
for(const auto& a : auth.accounts)
context.db.get<account_object,by_name>(a.permission.account);
};
validate_authority_preconditions(create.owner);
validate_authority_preconditions(create.active);
validate_authority_preconditions(create.recovery);
}
}
void apply_system_newaccount(apply_context& context) {
......
......@@ -4,6 +4,15 @@
namespace eos { namespace types {
AbiSerializer::AbiSerializer( const Abi& abi ) {
setAbi(abi);
}
void AbiSerializer::setAbi( const Abi& abi ) {
typedefs.clear();
structs.clear();
actions.clear();
tables.clear();
for( const auto& td : abi.types )
typedefs[td.newTypeName] = td.type;
......@@ -150,5 +159,10 @@ namespace eos { namespace types {
if( itr != actions.end() ) return itr->second;
return TypeName();
}
TypeName AbiSerializer::getTableType( Name action )const {
auto itr = tables.find(action);
if( itr != tables.end() ) return itr->second;
return TypeName();
}
} }
......@@ -11,7 +11,9 @@ using std::string;
* be converted to and from JSON.
*/
struct AbiSerializer {
AbiSerializer(){}
AbiSerializer( const Abi& abi );
void setAbi( const Abi& abi );
map<TypeName, TypeName> typedefs;
map<TypeName, Struct> structs;
......@@ -27,6 +29,7 @@ struct AbiSerializer {
const Struct& getStruct( const TypeName& type )const;
TypeName getActionType( Name action )const;
TypeName getTableType( Name action )const;
fc::variant binaryToVariant(const TypeName& type, const Bytes& binary)const;
Bytes variantToBinary(const TypeName& type, const fc::variant& var)const;
......
......@@ -50,6 +50,7 @@ void chain_api_plugin::plugin_startup() {
app().get_plugin<http_plugin>().add_api({
CHAIN_RO_CALL(get_info),
CHAIN_RO_CALL(get_block),
CHAIN_RO_CALL(get_table_rows_i64),
CHAIN_RW_CALL(push_block),
CHAIN_RW_CALL(push_transaction)
});
......
......@@ -8,6 +8,7 @@
#include <eos/native_contract/native_contract_chain_initializer.hpp>
#include <eos/native_contract/native_contract_chain_administrator.hpp>
#include <eos/native_contract/genesis_state.hpp>
#include <eos/types/AbiSerializer.hpp>
#include <fc/io/json.hpp>
#include <fc/variant.hpp>
......@@ -20,6 +21,11 @@ using chain::block_id_type;
using chain::fork_database;
using chain::block_log;
using chain::chain_id_type;
using chain::account_object;
using chain::key_value_object;
using chain::by_name;
using chain::by_scope_key;
class chain_plugin_impl {
public:
......@@ -188,6 +194,47 @@ read_only::get_info_results read_only::get_info(const read_only::get_info_params
};
}
read_only::get_table_rows_i64_result read_only::get_table_rows_i64( const read_only::get_table_rows_i64_params& p )const {
read_only::get_table_rows_i64_result result;
const auto& d = db.get_database();
const auto& code_account = d.get<account_object,by_name>( p.code );
types::AbiSerializer abis;
if( code_account.abi.size() > 4 ) { /// 4 == packsize of empty Abi
eos::types::Abi abi;
fc::datastream<const char*> ds( code_account.abi.data(), code_account.abi.size() );
fc::raw::unpack( ds, abi );
abis.setAbi( abi );
}
const auto& idx = d.get_index<chain::key_value_index,by_scope_key>();
auto lower = idx.lower_bound( boost::make_tuple( p.scope, p.code, p.table, p.lower_bound ) );
auto upper = idx.upper_bound( boost::make_tuple( p.scope, p.code, p.table, p.upper_bound ) );
vector<char> data;
auto start = fc::time_point::now();
auto end = fc::time_point::now() + fc::microseconds( 1000*10 ); /// 10ms max time
int count = 0;
auto itr = lower;
for( itr = lower; itr != upper; ++itr ) {
data.resize( sizeof(uint64_t) + itr->value.size() );
memcpy( data.data(), &itr->key, sizeof(itr->key) );
memcpy( data.data()+sizeof(uint64_t), itr->value.data(), itr->value.size() );
if( p.json )
result.rows.emplace_back( abis.binaryToVariant( abis.getTableType(p.table), data ) );
else
result.rows.emplace_back( fc::variant(data) );
if( ++count == p.limit || fc::time_point::now() > end )
break;
}
if( itr != upper )
result.more = true;
return result;
}
read_only::get_block_results read_only::get_block(const read_only::get_block_params& params) const {
try {
if (auto block = db.fetch_block_by_id(fc::json::from_string(params.block_num_or_id).as<chain::block_id_type>()))
......
#pragma once
#include <appbase/application.hpp>
#include <eos/chain/chain_controller.hpp>
#include <eos/chain/key_value_object.hpp>
#include <eos/chain/account_object.hpp>
#include <eos/database_plugin/database_plugin.hpp>
......@@ -10,6 +12,7 @@ namespace eos {
using eos::chain::chain_controller;
using std::unique_ptr;
using namespace appbase;
using chain::Name;
namespace chain_apis {
struct empty{};
......@@ -52,6 +55,23 @@ public:
};
get_block_results get_block(const get_block_params& params) const;
struct get_table_rows_i64_params {
bool json = false;
Name scope;
Name code;
Name table;
uint64_t lower_bound = 0;
uint64_t upper_bound = uint64_t(-1);
uint32_t limit = 10;
};
struct get_table_rows_i64_result {
vector<fc::variant> rows; ///< one row per item, either encoded as hex String or JSON object
bool more; ///< true if last element in data is not the end and sizeof data() < limit
};
get_table_rows_i64_result get_table_rows_i64( const get_table_rows_i64_params& params )const;
};
class read_write {
......@@ -113,3 +133,7 @@ FC_REFLECT(eos::chain_apis::read_only::get_block_params, (block_num_or_id))
FC_REFLECT_DERIVED( eos::chain_apis::read_only::get_block_results, (eos::chain::signed_block), (id)(block_num)(refBlockPrefix) );
FC_REFLECT( eos::chain_apis::read_write::push_transaction_results, (transaction_id) )
FC_REFLECT( eos::chain_apis::read_only::get_table_rows_i64_params,
(json)(scope)(code)(table)(lower_bound)(upper_bound)(limit) );
FC_REFLECT( eos::chain_apis::read_only::get_table_rows_i64_result,
(rows)(more) );
......@@ -17,7 +17,7 @@ namespace eos {
block_id_type head_id;
string os;
string agent;
};
};
struct notice_message {
vector<transaction_id_type> known_trx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册