Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
895aac08
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
895aac08
编写于
1月 31, 2018
作者:
K
Khaled Al-Hassanieh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added bill-to-account
上级
84553e02
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
65 addition
and
63 deletion
+65
-63
contracts/eosiolib/db.h
contracts/eosiolib/db.h
+12
-12
contracts/eosiolib/db.hpp
contracts/eosiolib/db.hpp
+37
-37
contracts/eosiolib/generic_currency.hpp
contracts/eosiolib/generic_currency.hpp
+2
-2
contracts/eosiolib/table.hpp
contracts/eosiolib/table.hpp
+3
-3
contracts/proxy/proxy.hpp
contracts/proxy/proxy.hpp
+1
-1
libraries/chain/include/eosio/chain/contracts/contract_table_objects.hpp
.../include/eosio/chain/contracts/contract_table_objects.hpp
+4
-2
libraries/chain/wasm_interface.cpp
libraries/chain/wasm_interface.cpp
+6
-6
未找到文件。
contracts/eosiolib/db.h
浏览文件 @
895aac08
...
...
@@ -124,7 +124,7 @@ extern "C" {
* @throw if called with an invalid precondition execution will be aborted
*
*/
int32_t
store_i64
(
account_name
scope
,
table_name
table
,
const
void
*
data
,
uint32_t
datalen
);
int32_t
store_i64
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
,
uint32_t
datalen
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
...
...
@@ -143,7 +143,7 @@ int32_t store_i64( account_name scope, table_name table, const void* data, uint3
* @throw if called with an invalid precondition execution will be aborted
*
*/
int32_t
update_i64
(
account_name
scope
,
table_name
table
,
const
void
*
data
,
uint32_t
datalen
);
int32_t
update_i64
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
,
uint32_t
datalen
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
...
...
@@ -229,7 +229,7 @@ int32_t upper_bound_i64( account_name scope, account_name code, table_name table
*
* @return 1 if a record was removed, and 0 if no record with key was found
*/
int32_t
remove_i64
(
account_name
scope
,
table_name
table
,
void
*
data
);
int32_t
remove_i64
(
account_name
scope
,
table_name
table
,
account_name
bta
,
void
*
data
);
///@} db_i64
...
...
@@ -263,7 +263,7 @@ int32_t remove_i64( account_name scope, table_name table, void* data );
* @throw if called with an invalid precondition execution will be aborted
*
*/
int32_t
store_str
(
account_name
scope
,
table_name
table
,
char
*
key
,
uint32_t
keylen
,
char
*
value
,
uint32_t
valuelen
);
int32_t
store_str
(
account_name
scope
,
table_name
table
,
account_name
bta
,
char
*
key
,
uint32_t
keylen
,
char
*
value
,
uint32_t
valuelen
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
...
...
@@ -285,7 +285,7 @@ int32_t remove_i64( account_name scope, table_name table, void* data );
* @throw if called with an invalid precondition execution will be aborted
*
*/
int32_t
update_str
(
account_name
scope
,
table_name
table
,
char
*
key
,
uint32_t
keylen
,
char
*
value
,
uint32_t
valuelen
);
int32_t
update_str
(
account_name
scope
,
table_name
table
,
account_name
bta
,
char
*
key
,
uint32_t
keylen
,
char
*
value
,
uint32_t
valuelen
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
...
...
@@ -378,7 +378,7 @@ int32_t remove_i64( account_name scope, table_name table, void* data );
*
* @return 1 if a record was removed, and 0 if no record with key was found
*/
int32_t
remove_str
(
account_name
scope
,
table_name
table
,
char
*
key
,
uint32_t
keylen
);
int32_t
remove_str
(
account_name
scope
,
table_name
table
,
account_name
bta
,
char
*
key
,
uint32_t
keylen
);
///@} dbstr
...
...
@@ -651,7 +651,7 @@ int32_t lower_bound_secondary_i128i128( account_name scope, account_name code, t
*
* @return 1 if a record was removed, and 0 if no record with key was found
*/
int32_t
remove_i128i128
(
account_name
scope
,
table_name
table
,
const
void
*
data
);
int32_t
remove_i128i128
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
* @param table - the ID/name of the table within the scope/code context to query
...
...
@@ -659,7 +659,7 @@ int32_t remove_i128i128( account_name scope, table_name table, const void* data
* @param len - the length of the data
* @return 1 if a new record was created, 0 if an existing record was updated
*/
int32_t
store_i128i128
(
account_name
scope
,
table_name
table
,
const
void
*
data
,
uint32_t
len
);
int32_t
store_i128i128
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
...
...
@@ -668,7 +668,7 @@ int32_t store_i128i128( account_name scope, table_name table, const void* data,
* @param len - the length of the data
* @return 1 if the record was updated, 0 if no record with key was found
*/
int32_t
update_i128i128
(
account_name
scope
,
table_name
table
,
const
void
*
data
,
uint32_t
len
);
int32_t
update_i128i128
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
);
///@} dbi128i128
...
...
@@ -1009,7 +1009,7 @@ int32_t lower_bound_tertiary_i64i64i64( account_name scope, account_name code, t
*
* @return 1 if a record was removed, and 0 if no record with key was found
*/
int32_t
remove_i64i64i64
(
account_name
scope
,
table_name
table
,
const
void
*
data
);
int32_t
remove_i64i64i64
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
* @param table - the name of table where record is stored
...
...
@@ -1017,7 +1017,7 @@ int32_t remove_i64i64i64( account_name scope, table_name table, const void* data
* @param len - length of the data
* @return 1 if a new record was created, 0 if an existing record was updated
*/
int32_t
store_i64i64i64
(
account_name
scope
,
table_name
table
,
const
void
*
data
,
uint32_t
len
);
int32_t
store_i64i64i64
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
);
/**
* @param scope - the account scope that will be read, must exist in the transaction scopes list
...
...
@@ -1026,7 +1026,7 @@ int32_t store_i64i64i64( account_name scope, table_name table, const void* data,
* @param len - length of the data
* @return 1 if the record was updated, 0 if no record with key was found
*/
int32_t
update_i64i64i64
(
account_name
scope
,
table_name
table
,
const
void
*
data
,
uint32_t
len
);
int32_t
update_i64i64i64
(
account_name
scope
,
table_name
table
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
);
///@} dbi64i64i64
}
contracts/eosiolib/db.hpp
浏览文件 @
895aac08
...
...
@@ -83,16 +83,16 @@ struct table_impl<sizeof(uint128_t),sizeof(uint128_t)> {
return
lower_bound_secondary_i128i128
(
scope
,
code
,
table_n
,
data
,
len
);
}
static
int32_t
remove
(
uint64_t
scope
,
uint64_t
table_n
,
const
void
*
data
)
{
return
remove_i128i128
(
scope
,
table_n
,
data
);
static
int32_t
remove
(
uint64_t
scope
,
uint64_t
table_n
,
account_name
bta
,
const
void
*
data
)
{
return
remove_i128i128
(
scope
,
table_n
,
bta
,
data
);
}
static
int32_t
store
(
account_name
scope
,
table_name
table_n
,
const
void
*
data
,
uint32_t
len
)
{
return
store_i128i128
(
scope
,
table_n
,
data
,
len
);
static
int32_t
store
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
)
{
return
store_i128i128
(
scope
,
table_n
,
bta
,
data
,
len
);
}
static
int32_t
update
(
account_name
scope
,
table_name
table_n
,
const
void
*
data
,
uint32_t
len
)
{
return
update_i128i128
(
scope
,
table_n
,
data
,
len
);
static
int32_t
update
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
)
{
return
update_i128i128
(
scope
,
table_n
,
bta
,
data
,
len
);
}
};
...
...
@@ -175,7 +175,7 @@ struct table_impl<sizeof(uint128_t),sizeof(uint128_t)> {
* @ingroup databaseCpp
* @{
*/
template
<
uint64_t
scope
,
uint64_t
code
,
uint64_t
table_n
,
typename
Record
,
typename
PrimaryType
,
typename
SecondaryType
=
void
>
template
<
uint64_t
scope
,
uint64_t
code
,
uint64_t
table_n
,
uint64_t
bta
,
typename
Record
,
typename
PrimaryType
,
typename
SecondaryType
=
void
>
struct
table
{
private:
typedef
table_impl
<
sizeof
(
PrimaryType
),
sizeof
(
SecondaryType
)
>
impl
;
...
...
@@ -387,8 +387,8 @@ struct table {
*
* @return true if successful store.
*/
static
bool
store
(
const
Record
&
r
,
uint64_t
s
=
scope
)
{
assert
(
impl
::
store
(
s
,
table_n
,
&
r
,
sizeof
(
r
)
),
"error storing record"
);
static
bool
store
(
const
Record
&
r
,
uint64_t
s
=
scope
,
uint64_t
b
=
bta
)
{
assert
(
impl
::
store
(
s
,
table_n
,
b
,
&
r
,
sizeof
(
r
)
),
"error storing record"
);
return
true
;
}
...
...
@@ -400,8 +400,8 @@ struct table {
*
* @return true if successful update.
*/
static
bool
update
(
const
Record
&
r
,
uint64_t
s
=
scope
)
{
assert
(
impl
::
update
(
s
,
table_n
,
&
r
,
sizeof
(
r
)
),
"error updating record"
);
static
bool
update
(
const
Record
&
r
,
uint64_t
s
=
scope
,
uint64_t
b
=
bta
)
{
assert
(
impl
::
update
(
s
,
table_n
,
b
,
&
r
,
sizeof
(
r
)
),
"error updating record"
);
return
true
;
}
...
...
@@ -413,8 +413,8 @@ struct table {
*
* @return true if successful remove.
*/
static
bool
remove
(
const
Record
&
r
,
uint64_t
s
=
scope
)
{
return
impl
::
remove
(
s
,
table_n
,
&
r
)
!=
0
;
static
bool
remove
(
const
Record
&
r
,
uint64_t
s
=
scope
,
uint64_t
b
=
bta
)
{
return
impl
::
remove
(
s
,
table_n
,
b
,
&
r
)
!=
0
;
}
};
/// @}
...
...
@@ -450,16 +450,16 @@ struct table_impl<sizeof(uint64_t),0> {
return
upper_bound_i64
(
scope
,
code
,
table_n
,
data
,
len
);
}
static
int32_t
remove
(
uint64_t
scope
,
uint64_t
table_n
,
const
void
*
data
)
{
return
remove_i64
(
scope
,
table_n
,
(
uint64_t
*
)
data
);
static
int32_t
remove
(
uint64_t
scope
,
uint64_t
table_n
,
account_name
bta
,
const
void
*
data
)
{
return
remove_i64
(
scope
,
table_n
,
bta
,
(
uint64_t
*
)
data
);
}
static
int32_t
store
(
account_name
scope
,
table_name
table_n
,
const
void
*
data
,
uint32_t
len
)
{
return
store_i64
(
scope
,
table_n
,
data
,
len
);
static
int32_t
store
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
)
{
return
store_i64
(
scope
,
table_n
,
bta
,
data
,
len
);
}
static
int32_t
update
(
account_name
scope
,
table_name
table_n
,
const
void
*
data
,
uint32_t
len
)
{
return
update_i64
(
scope
,
table_n
,
data
,
len
);
static
int32_t
update
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
)
{
return
update_i64
(
scope
,
table_n
,
bta
,
data
,
len
);
}
};
...
...
@@ -531,8 +531,8 @@ struct table_impl<sizeof(uint64_t),0> {
* @ingroup databaseCpp
* @{
*/
template
<
uint64_t
scope
,
uint64_t
code
,
uint64_t
table_n
,
typename
Record
,
typename
PrimaryType
>
struct
table
<
scope
,
code
,
table_n
,
Record
,
PrimaryType
,
void
>
{
template
<
uint64_t
scope
,
uint64_t
code
,
uint64_t
table_n
,
uint64_t
bta
,
typename
Record
,
typename
PrimaryType
>
struct
table
<
scope
,
code
,
table_n
,
bta
,
Record
,
PrimaryType
,
void
>
{
private:
typedef
table_impl
<
sizeof
(
PrimaryType
),
0
>
impl
;
static_assert
(
sizeof
(
PrimaryType
)
<=
sizeof
(
Record
),
"invalid template parameters"
);
...
...
@@ -667,8 +667,8 @@ struct table<scope,code,table_n,Record,PrimaryType,void> {
* @param s - scope; defaults to scope of the class.
* @return true if store succeeds.
*/
static
bool
store
(
const
Record
&
r
,
uint64_t
s
=
scope
)
{
return
impl
::
store
(
s
,
table_n
,
&
r
,
sizeof
(
r
)
)
!=
0
;
static
bool
store
(
const
Record
&
r
,
uint64_t
s
=
scope
,
uint64_t
b
=
bta
)
{
return
impl
::
store
(
s
,
table_n
,
b
,
&
r
,
sizeof
(
r
)
)
!=
0
;
}
/**
...
...
@@ -678,8 +678,8 @@ struct table<scope,code,table_n,Record,PrimaryType,void> {
* @param s - scope; defaults to scope of the class.
* @return true if update succeeds.
*/
static
bool
update
(
const
Record
&
r
,
uint64_t
s
=
scope
)
{
return
impl
::
update
(
s
,
table_n
,
&
r
,
sizeof
(
r
)
)
!=
0
;
static
bool
update
(
const
Record
&
r
,
uint64_t
s
=
scope
,
uint64_t
b
=
bta
)
{
return
impl
::
update
(
s
,
table_n
,
b
,
&
r
,
sizeof
(
r
)
)
!=
0
;
}
/**
...
...
@@ -689,20 +689,20 @@ struct table<scope,code,table_n,Record,PrimaryType,void> {
* @param s - scope; defaults to scope of the class.
* @return true if remove succeeds.
*/
static
bool
remove
(
const
Record
&
r
,
uint64_t
s
=
scope
)
{
return
impl
::
remove
(
s
,
table_n
,
&
r
)
!=
0
;
static
bool
remove
(
const
Record
&
r
,
uint64_t
s
=
scope
,
uint64_t
b
=
bta
)
{
return
impl
::
remove
(
s
,
table_n
,
b
,
&
r
)
!=
0
;
}
};
/// @} singleindextable
template
<
>
struct
table_impl_obj
<
char
*>
{
static
int32_t
store
(
account_name
scope
,
table_name
table_n
,
char
*
key
,
uint32_t
keylen
,
char
*
data
,
uint32_t
datalen
)
{
return
store_str
(
scope
,
table_n
,
key
,
keylen
,
data
,
datalen
);
static
int32_t
store
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
char
*
key
,
uint32_t
keylen
,
char
*
data
,
uint32_t
datalen
)
{
return
store_str
(
scope
,
table_n
,
bta
,
key
,
keylen
,
data
,
datalen
);
}
static
int32_t
update
(
account_name
scope
,
table_name
table_n
,
char
*
key
,
uint32_t
keylen
,
char
*
data
,
uint32_t
datalen
)
{
return
update_str
(
scope
,
table_n
,
key
,
keylen
,
data
,
datalen
);
static
int32_t
update
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
char
*
key
,
uint32_t
keylen
,
char
*
data
,
uint32_t
datalen
)
{
return
update_str
(
scope
,
table_n
,
bta
,
key
,
keylen
,
data
,
datalen
);
}
static
int32_t
front
(
account_name
scope
,
account_name
code
,
table_name
table_n
,
char
*
data
,
uint32_t
len
)
{
...
...
@@ -733,8 +733,8 @@ struct table_impl_obj<char*> {
return
upper_bound_str
(
scope
,
code
,
table_n
,
key
,
keylen
,
data
,
datalen
);
}
static
int32_t
remove
(
account_name
scope
,
table_name
table_n
,
char
*
key
,
uint32_t
keylen
)
{
return
remove_str
(
scope
,
table_n
,
key
,
keylen
);
static
int32_t
remove
(
account_name
scope
,
table_name
table_n
,
account_name
bta
,
char
*
key
,
uint32_t
keylen
)
{
return
remove_str
(
scope
,
table_n
,
bta
,
key
,
keylen
);
}
};
...
...
@@ -751,7 +751,7 @@ struct table_impl_obj<char*> {
* @{
*/
template
<
account_name
scope
,
account_name
code
,
table_name
table_n
,
typename
PrimaryType
>
template
<
account_name
scope
,
account_name
code
,
table_name
table_n
,
account_name
bta
,
typename
PrimaryType
>
struct
var_table
{
private:
typedef
table_impl_obj
<
PrimaryType
>
impl
;
...
...
@@ -769,7 +769,7 @@ struct var_table {
* @return 1 if a new record was created, 0 if an existing record was updated
*/
int32_t
store
(
primary
key
,
uint32_t
keylen
,
char
*
record
,
uint32_t
len
)
{
return
impl
::
store
(
scope
,
table_n
,
key
,
keylen
,
record
,
len
);
return
impl
::
store
(
scope
,
table_n
,
bta
,
key
,
keylen
,
record
,
len
);
}
/**
...
...
@@ -782,7 +782,7 @@ struct var_table {
* @return 1 if the record was updated, 0 if no record with key was found
*/
int32_t
update
(
primary
key
,
uint32_t
keylen
,
char
*
record
,
uint32_t
len
)
{
return
impl
::
update
(
scope
,
table_n
,
key
,
keylen
,
record
,
len
);
return
impl
::
update
(
scope
,
table_n
,
bta
,
key
,
keylen
,
record
,
len
);
}
/**
...
...
@@ -886,7 +886,7 @@ struct var_table {
* @return 1 if a record was removed, and 0 if no record with key was found
*/
int32_t
remove
(
primary
key
,
uint32_t
keylen
)
{
return
impl
::
remove
(
scope
,
table_n
,
key
,
keylen
);
return
impl
::
remove
(
scope
,
table_n
,
bta
,
key
,
keylen
);
}
};
...
...
contracts/eosiolib/generic_currency.hpp
浏览文件 @
895aac08
...
...
@@ -74,8 +74,8 @@ namespace eosio {
* Each user stores their balance in the singleton table under the
* scope of their account name.
*/
typedef
table64
<
code
,
accounts_table_name
,
account
>
accounts
;
typedef
table64
<
code
,
stats_table_name
,
currency_stats
>
stats
;
typedef
table64
<
code
,
accounts_table_name
,
code
,
account
>
accounts
;
typedef
table64
<
code
,
stats_table_name
,
c
ode
,
c
urrency_stats
>
stats
;
static
token_type
get_balance
(
account_name
owner
)
{
return
accounts
::
get_or_create
(
token_type
::
symbol
,
owner
).
balance
;
...
...
contracts/eosiolib/table.hpp
浏览文件 @
895aac08
...
...
@@ -7,7 +7,7 @@ namespace eosio {
* @tparam TableName - the name of the table with rows of type T
* @tparam T - a struct where the first 8 bytes are used as primary/unique key
*/
template
<
uint64_t
DefaultScope
,
uint64_t
TableName
,
typename
T
>
template
<
uint64_t
DefaultScope
,
uint64_t
TableName
,
uint64_t
BillToAccount
,
typename
T
>
class
table64
{
public:
...
...
@@ -44,7 +44,7 @@ namespace eosio {
return
result
;
}
static
void
set
(
const
T
&
value
=
T
(),
scope_name
scope
=
DefaultScope
)
{
static
void
set
(
const
T
&
value
=
T
(),
scope_name
scope
=
DefaultScope
,
uint64_t
bta
=
BillToAccount
)
{
auto
size
=
pack_size
(
value
);
char
buf
[
size
];
assert
(
size
<=
1024
,
"singleton too big to store"
);
...
...
@@ -52,7 +52,7 @@ namespace eosio {
datastream
<
char
*>
ds
(
buf
,
size
);
ds
<<
value
;
store_i64
(
scope
,
TableName
,
buf
,
sizeof
(
buf
)
);
store_i64
(
scope
,
TableName
,
b
ta
,
b
uf
,
sizeof
(
buf
)
);
}
};
...
...
contracts/proxy/proxy.hpp
浏览文件 @
895aac08
...
...
@@ -22,6 +22,6 @@ namespace proxy {
uint32_t
next_id
=
0
;
};
using
configs
=
eosio
::
table
<
N
(
proxy
),
N
(
proxy
),
N
(
configs
),
config
,
uint64_t
>
;
using
configs
=
eosio
::
table
<
N
(
proxy
),
N
(
proxy
),
N
(
configs
),
N
(
proxy
),
config
,
uint64_t
>
;
}
/// namespace proxy
libraries/chain/include/eosio/chain/contracts/contract_table_objects.hpp
浏览文件 @
895aac08
...
...
@@ -21,6 +21,7 @@ namespace eosio { namespace chain { namespace contracts {
scope_name
scope
;
account_name
code
;
table_name
table
;
account_name
bta
;
};
struct
by_scope_code_table
;
...
...
@@ -35,7 +36,8 @@ namespace eosio { namespace chain { namespace contracts {
composite_key
<
table_id_object
,
member
<
table_id_object
,
scope_name
,
&
table_id_object
::
scope
>
,
member
<
table_id_object
,
account_name
,
&
table_id_object
::
code
>
,
member
<
table_id_object
,
table_name
,
&
table_id_object
::
table
>
member
<
table_id_object
,
table_name
,
&
table_id_object
::
table
>
,
member
<
table_id_object
,
account_name
,
&
table_id_object
::
bta
>
>
>
>
...
...
libraries/chain/wasm_interface.cpp
浏览文件 @
895aac08
...
...
@@ -559,18 +559,18 @@ class db_api : public context_aware_api {
public:
using
context_aware_api
::
context_aware_api
;
int
store
(
const
scope_name
&
scope
,
const
name
&
table
,
array_ptr
<
const
char
>
data
,
size_t
data_len
)
{
int
store
(
const
scope_name
&
scope
,
const
name
&
table
,
const
scope_name
&
bta
,
array_ptr
<
const
char
>
data
,
size_t
data_len
)
{
auto
res
=
call
(
&
apply_context
::
store_record
<
ObjectType
>
,
scope
,
table
,
data
,
data_len
);
//ilog("STORE [${scope},${code},${table}] => ${res} :: ${HEX}", ("scope",scope)("code",context.receiver)("table",table)("res",res)("HEX", fc::to_hex(data, data_len)));
return
res
;
}
int
update
(
const
scope_name
&
scope
,
const
name
&
table
,
array_ptr
<
const
char
>
data
,
size_t
data_len
)
{
int
update
(
const
scope_name
&
scope
,
const
name
&
table
,
const
scope_name
&
bta
,
array_ptr
<
const
char
>
data
,
size_t
data_len
)
{
return
call
(
&
apply_context
::
update_record
<
ObjectType
>
,
scope
,
table
,
data
,
data_len
);
}
int
remove
(
const
scope_name
&
scope
,
const
name
&
table
,
const
KeyArrayType
&
keys
)
{
int
remove
(
const
scope_name
&
scope
,
const
name
&
table
,
const
scope_name
&
bta
,
const
KeyArrayType
&
keys
)
{
const
auto
&
t_id
=
context
.
find_or_create_table
(
scope
,
context
.
receiver
,
table
);
return
context
.
remove_record
<
ObjectType
>
(
t_id
,
keys
);
}
...
...
@@ -777,9 +777,9 @@ REGISTER_INTRINSICS(memory_api,
#define DB_METHOD_SEQ(SUFFIX) \
(store, int32_t(int64_t, int64_t, int
, int), "store_"#SUFFIX )
\
(update, int32_t(int64_t, int64_t, int
, int), "update_"#SUFFIX )
\
(remove, int32_t(int64_t, int64_t, int
),
"remove_"#SUFFIX )
(store, int32_t(int64_t, int64_t, int
64_t, int, int), "store_"#SUFFIX )
\
(update, int32_t(int64_t, int64_t, int
64_t, int, int), "update_"#SUFFIX )
\
(remove, int32_t(int64_t, int64_t, int
64_t, int),
"remove_"#SUFFIX )
#define DB_INDEX_METHOD_SEQ(SUFFIX)\
(load, int32_t(int64_t, int64_t, int64_t, int, int), "load_"#SUFFIX )\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录