Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
7c406b5d
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,发现更多精彩内容 >>
提交
7c406b5d
编写于
2月 15, 2018
作者:
B
Bill Hamilton
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into eosio_build_amzn
Merging master branch to update build files from PR #1394
上级
96c50d2d
38abb5e9
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
752 addition
and
247 deletion
+752
-247
CMakeLists.txt
CMakeLists.txt
+1
-1
Jenkinsfile
Jenkinsfile
+38
-0
contracts/eosiolib/db.h
contracts/eosiolib/db.h
+31
-1
contracts/eosiolib/multi_index.hpp
contracts/eosiolib/multi_index.hpp
+3
-30
contracts/test_api/test_api.cpp
contracts/test_api/test_api.cpp
+9
-1
contracts/test_api/test_api.hpp
contracts/test_api/test_api.hpp
+7
-0
contracts/test_api/test_db.cpp
contracts/test_api/test_db.cpp
+545
-167
libraries/appbase
libraries/appbase
+1
-1
libraries/chain/apply_context.cpp
libraries/chain/apply_context.cpp
+1
-2
libraries/chain/include/eosio/chain/apply_context.hpp
libraries/chain/include/eosio/chain/apply_context.hpp
+1
-3
libraries/chain/wasm_interface.cpp
libraries/chain/wasm_interface.cpp
+4
-21
libraries/chainbase
libraries/chainbase
+1
-1
programs/eosioc/main.cpp
programs/eosioc/main.cpp
+4
-4
scripts/eosio_build_darwin.sh
scripts/eosio_build_darwin.sh
+4
-4
scripts/eosio_build_fedora.sh
scripts/eosio_build_fedora.sh
+6
-6
scripts/eosio_build_ubuntu.sh
scripts/eosio_build_ubuntu.sh
+5
-5
tests/wasm_tests/wasm_tests.cpp
tests/wasm_tests/wasm_tests.cpp
+91
-0
未找到文件。
CMakeLists.txt
浏览文件 @
7c406b5d
...
...
@@ -69,8 +69,8 @@ ENDIF(WIN32)
FIND_PACKAGE
(
Boost 1.64 REQUIRED COMPONENTS
thread
date_time
system
filesystem
system
program_options
signals
serialization
...
...
Jenkinsfile
0 → 100644
浏览文件 @
7c406b5d
pipeline
{
agent
any
stages
{
stage
(
'Build'
)
{
parallel
{
stage
(
'Ubuntu'
)
{
steps
{
sh
'''
. $HOME/.bash_profile
./eosio_build.sh
'''
}
}
stage
(
'MacOS'
)
{
steps
{
sh
'''
. $HOME/.bash_profile
echo "Darwin build coming soon..."
'''
}
}
stage
(
'Fedora'
)
{
steps
{
sh
'''
. $HOME/.bash_profile
echo "Fedora build coming soon..."
'''
}
}
}
}
}
post
{
always
{
cleanWs
()
}
}
}
\ No newline at end of file
contracts/eosiolib/db.h
浏览文件 @
7c406b5d
...
...
@@ -1027,6 +1027,36 @@ int32_t store_i64i64i64( account_name scope, table_name table, account_name bta,
* @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
,
account_name
bta
,
const
void
*
data
,
uint32_t
len
);
///@} dbi64i64i64
int32_t
db_store_i64
(
account_name
scope
,
table_name
table
,
account_name
payer
,
uint64_t
id
,
const
void
*
data
,
uint32_t
len
);
void
db_update_i64
(
int32_t
iterator
,
account_name
payer
,
const
void
*
data
,
uint32_t
len
);
void
db_remove_i64
(
int32_t
iterator
);
int32_t
db_get_i64
(
int32_t
iterator
,
const
void
*
data
,
uint32_t
len
);
int32_t
db_next_i64
(
int32_t
iterator
,
uint64_t
*
primary
);
int32_t
db_previous_i64
(
int32_t
iterator
,
uint64_t
*
primary
);
int32_t
db_find_i64
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint64_t
id
);
int32_t
db_lowerbound_i64
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint64_t
id
);
int32_t
db_upperbound_i64
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint64_t
id
);
int32_t
db_idx64_store
(
account_name
scope
,
table_name
table
,
account_name
payer
,
uint64_t
id
,
const
uint64_t
*
secondary
);
void
db_idx64_update
(
int32_t
iterator
,
account_name
payer
,
const
uint64_t
*
secondary
);
void
db_idx64_remove
(
int32_t
iterator
);
int32_t
db_idx64_next
(
int32_t
iterator
,
uint64_t
*
primary
);
int32_t
db_idx64_previous
(
int32_t
iterator
,
uint64_t
*
primary
);
int32_t
db_idx64_find_primary
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint64_t
*
secondary
,
uint64_t
primary
);
int32_t
db_idx64_find_secondary
(
account_name
code
,
account_name
scope
,
table_name
table
,
const
uint64_t
*
secondary
,
uint64_t
*
primary
);
int32_t
db_idx64_lowerbound
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint64_t
*
secondary
,
uint64_t
*
primary
);
int32_t
db_idx64_upperbound
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint64_t
*
secondary
,
uint64_t
*
primary
);
int32_t
db_idx128_store
(
account_name
scope
,
table_name
table
,
account_name
payer
,
uint64_t
id
,
const
uint128_t
*
secondary
);
void
db_idx128_update
(
int32_t
iterator
,
account_name
payer
,
const
uint128_t
*
secondary
);
void
db_idx128_remove
(
int32_t
iterator
);
int32_t
db_idx128_next
(
int32_t
iterator
,
uint64_t
*
primary
);
int32_t
db_idx128_previous
(
int32_t
iterator
,
uint64_t
*
primary
);
int32_t
db_idx128_find_primary
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint128_t
*
secondary
,
uint64_t
primary
);
int32_t
db_idx128_find_secondary
(
account_name
code
,
account_name
scope
,
table_name
table
,
const
uint128_t
*
secondary
,
uint64_t
*
primary
);
int32_t
db_idx128_lowerbound
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint128_t
*
secondary
,
uint64_t
*
primary
);
int32_t
db_idx128_upperbound
(
account_name
code
,
account_name
scope
,
table_name
table
,
uint128_t
*
secondary
,
uint64_t
*
primary
);
///@} dbi64i64i64
}
contracts/eosiolib/multi_index.hpp
浏览文件 @
7c406b5d
...
...
@@ -11,36 +11,9 @@
#include <eosiolib/types.hpp>
#include <eosiolib/serialize.hpp>
#include <eosiolib/datastream.hpp>
#include <eosiolib/db.h>
extern
"C"
{
int
db_store_i64
(
uint64_t
scope
,
uint64_t
table
,
uint64_t
payer
,
uint64_t
id
,
char
*
buffer
,
size_t
buffer_size
);
void
db_update_i64
(
int
iterator
,
uint64_t
payer
,
char
*
buffer
,
size_t
buffer_size
);
int
db_find_i64
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
id
);
int
db_lowerbound_i64
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
id
);
int
db_get_i64
(
int
iterator
,
char
*
buffer
,
size_t
buffer_size
);
void
db_remove_i64
(
int
iterator
);
int
db_next_i64
(
int
iterator
,
uint64_t
*
pk
);
int
db_previous_i64
(
int
iterator
,
uint64_t
*
pk
);
int
db_idx64_next
(
int
iterator
,
uint64_t
*
primary
);
int
db_idx64_prev
(
int
iterator
,
uint64_t
*
primary
);
int
db_idx64_find_primary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
*
secondary
,
uint64_t
primary
);
int
db_idx64_find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
*
secondary
,
uint64_t
*
primary
);
int
db_idx64_lowerbound
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
*
secondary
,
uint64_t
*
primary
);
int
db_idx64_upperbound
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
*
secondary
,
uint64_t
*
primary
);
void
db_idx64_remove
(
int
iterator
);
void
db_idx64_update
(
int
iterator
,
uint64_t
payer
,
const
uint64_t
*
secondary
);
int
db_idx128_next
(
int
iterator
,
uint64_t
*
primary
);
int
db_idx128_prev
(
int
iterator
,
uint64_t
*
primary
);
int
db_idx128_find_primary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
*
secondary
,
uint64_t
primary
);
int
db_idx128_find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
*
secondary
,
uint64_t
*
primary
);
int
db_idx128_lowerbound
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
*
secondary
,
uint64_t
*
primary
);
int
db_idx128_upperbound
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
*
secondary
,
uint64_t
*
primary
);
void
db_idx128_remove
(
int
iterator
);
void
db_idx128_update
(
int
iterator
,
uint64_t
payer
,
const
uint128_t
*
secondary
);
}
namespace
eosio
{
...
...
@@ -54,14 +27,14 @@ struct secondary_iterator;
template
<
>
struct
secondary_iterator
<
uint64_t
>
{
static
int
db_idx_next
(
int
iterator
,
uint64_t
*
primary
)
{
return
db_idx64_next
(
iterator
,
primary
);
}
static
int
db_idx_prev
(
int
iterator
,
uint64_t
*
primary
)
{
return
db_idx64_prev
(
iterator
,
primary
);
}
static
int
db_idx_prev
(
int
iterator
,
uint64_t
*
primary
)
{
return
db_idx64_prev
ious
(
iterator
,
primary
);
}
static
void
db_idx_remove
(
int
iterator
)
{
db_idx64_remove
(
iterator
);
}
};
template
<
>
struct
secondary_iterator
<
uint128_t
>
{
static
int
db_idx_next
(
int
iterator
,
uint64_t
*
primary
)
{
return
db_idx128_next
(
iterator
,
primary
);
}
static
int
db_idx_prev
(
int
iterator
,
uint64_t
*
primary
)
{
return
db_idx128_prev
(
iterator
,
primary
);
}
static
int
db_idx_prev
(
int
iterator
,
uint64_t
*
primary
)
{
return
db_idx128_prev
ious
(
iterator
,
primary
);
}
static
void
db_idx_remove
(
int
iterator
)
{
db_idx128_remove
(
iterator
);
}
};
...
...
contracts/test_api/test_api.cpp
浏览文件 @
7c406b5d
...
...
@@ -17,6 +17,7 @@
//#include "test_real.cpp"
//#include "test_transaction.cpp"
//#include "test_types.cpp"
#include "test_db.cpp"
extern
"C"
{
...
...
@@ -91,7 +92,14 @@ extern "C" {
// WASM_TEST_HANDLER(test_db, key_i64i64i64_under_limit);
// WASM_TEST_HANDLER(test_db, key_i64i64i64_available_space_exceed_limit);
// WASM_TEST_HANDLER(test_db, key_i64i64i64_another_under_limit);
//
WASM_TEST_HANDLER
(
test_db
,
primary_i64_general
);
WASM_TEST_HANDLER
(
test_db
,
primary_i64_lowerbound
);
WASM_TEST_HANDLER
(
test_db
,
primary_i64_upperbound
);
WASM_TEST_HANDLER
(
test_db
,
idx64_general
);
WASM_TEST_HANDLER
(
test_db
,
idx64_lowerbound
);
WASM_TEST_HANDLER
(
test_db
,
idx64_upperbound
);
// //test crypto
// WASM_TEST_HANDLER(test_crypto, test_sha256);
// WASM_TEST_HANDLER(test_crypto, sha256_no_data);
...
...
contracts/test_api/test_api.hpp
浏览文件 @
7c406b5d
...
...
@@ -117,6 +117,13 @@ struct test_db {
static
unsigned
int
key_i64i64i64_under_limit
();
static
unsigned
int
key_i64i64i64_available_space_exceed_limit
();
static
unsigned
int
key_i64i64i64_another_under_limit
();
static
void
primary_i64_general
();
static
void
primary_i64_lowerbound
();
static
void
primary_i64_upperbound
();
static
void
idx64_general
();
static
void
idx64_lowerbound
();
static
void
idx64_upperbound
();
};
struct
test_crypto
{
...
...
contracts/test_api/test_db.cpp
浏览文件 @
7c406b5d
此差异已折叠。
点击以展开。
appbase
@
ef2b0c8d
比较
a0cf75ad
...
ef2b0c8d
Subproject commit
a0cf75ad7c39137ebf03b0f3b0b4e5b7f731296b
Subproject commit
ef2b0c8d64f770d80ce537ec04d0de4bdc4d3585
libraries/chain/apply_context.cpp
浏览文件 @
7c406b5d
...
...
@@ -370,8 +370,7 @@ void apply_context::db_remove_i64( int iterator ) {
int
apply_context
::
db_get_i64
(
int
iterator
,
char
*
buffer
,
size_t
buffer_size
)
{
const
key_value_object
&
obj
=
keyval_cache
.
get
(
iterator
);
if
(
buffer_size
>=
obj
.
value
.
size
()
)
memcpy
(
buffer
,
obj
.
value
.
data
(),
obj
.
value
.
size
()
);
memcpy
(
buffer
,
obj
.
value
.
data
(),
std
::
min
(
obj
.
value
.
size
(),
buffer_size
)
);
return
obj
.
value
.
size
();
}
...
...
libraries/chain/include/eosio/chain/apply_context.hpp
浏览文件 @
7c406b5d
...
...
@@ -134,7 +134,7 @@ class apply_context {
});
}
int
find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
secondary_key_type
&
secondary
,
uint64_t
&
primary
)
{
int
find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
const
secondary_key_type
&
secondary
,
uint64_t
&
primary
)
{
auto
tab
=
context
.
find_table
(
context
.
receiver
,
scope
,
table
);
if
(
!
tab
)
return
-
1
;
...
...
@@ -142,7 +142,6 @@ class apply_context {
if
(
!
obj
)
return
-
1
;
primary
=
obj
->
primary_key
;
secondary
=
obj
->
secondary_key
;
itr_cache
.
cache_table
(
*
tab
);
return
itr_cache
.
add
(
*
obj
);
...
...
@@ -209,7 +208,6 @@ class apply_context {
primary
=
itr
->
primary_key
;
return
itr_cache
.
add
(
*
itr
);
}
int
find_primary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
secondary_key_type
&
secondary
,
uint64_t
primary
)
{
...
...
libraries/chain/wasm_interface.cpp
浏览文件 @
7c406b5d
...
...
@@ -715,7 +715,7 @@ class database_api : public context_aware_api {
return
context
.
db_lowerbound_i64
(
code
,
scope
,
table
,
id
);
}
int
db_upperbound_i64
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
id
)
{
return
context
.
db_
low
erbound_i64
(
code
,
scope
,
table
,
id
);
return
context
.
db_
upp
erbound_i64
(
code
,
scope
,
table
,
id
);
}
int
db_idx64_store
(
uint64_t
scope
,
uint64_t
table
,
uint64_t
payer
,
uint64_t
id
,
const
uint64_t
&
secondary
)
{
...
...
@@ -727,13 +727,12 @@ class database_api : public context_aware_api {
void
db_idx64_remove
(
int
iterator
)
{
return
context
.
idx64
.
remove
(
iterator
);
}
int
db_idx64_find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
&
secondary
,
uint64_t
&
primary
)
{
int
db_idx64_find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
const
uint64_t
&
secondary
,
uint64_t
&
primary
)
{
return
context
.
idx64
.
find_secondary
(
code
,
scope
,
table
,
secondary
,
primary
);
}
int
db_idx64_find_primary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
&
secondary
,
uint64_t
primary
)
{
return
context
.
idx64
.
find_
second
ary
(
code
,
scope
,
table
,
secondary
,
primary
);
return
context
.
idx64
.
find_
prim
ary
(
code
,
scope
,
table
,
secondary
,
primary
);
}
int
db_idx64_lowerbound
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint64_t
&
secondary
,
uint64_t
&
primary
)
{
return
context
.
idx64
.
lowerbound_secondary
(
code
,
scope
,
table
,
secondary
,
primary
);
}
...
...
@@ -747,22 +746,6 @@ class database_api : public context_aware_api {
return
context
.
idx64
.
previous_secondary
(
iterator
,
primary
);
}
/*
int db_idx64_next( int iterator, uint64_t& primary ) {
}
int db_idx64_prev( int iterator, uint64_t& primary ) {
}
int db_idx64_find_primary( uint64_t code, uint64_t scope, uint64_t table, uint64_t& secondary, uint64_t primary ) {
}
int db_idx64_find_secondary( uint64_t code, uint64_t scope, uint64_t table, uint64_t& secondary, uint64_t& primary ) {
}
int db_idx64_lowerbound( uint64_t code, uint64_t scope, uint64_t table, uint64_t& secondary, uint64_t& primary ) {
}
int db_idx64_upperbound( uint64_t code, uint64_t scope, uint64_t table, uint64_t& secondary, uint64_t& primary ) {
}
*/
int
db_idx128_store
(
uint64_t
scope
,
uint64_t
table
,
uint64_t
payer
,
uint64_t
id
,
const
uint128_t
&
secondary
)
{
return
context
.
idx128
.
store
(
scope
,
table
,
payer
,
id
,
secondary
);
}
...
...
@@ -775,7 +758,7 @@ class database_api : public context_aware_api {
int
db_idx128_find_primary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
&
secondary
,
uint64_t
primary
)
{
return
context
.
idx128
.
find_primary
(
code
,
scope
,
table
,
secondary
,
primary
);
}
int
db_idx128_find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
&
secondary
,
uint64_t
&
primary
)
{
int
db_idx128_find_secondary
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
const
uint128_t
&
secondary
,
uint64_t
&
primary
)
{
return
context
.
idx128
.
find_secondary
(
code
,
scope
,
table
,
secondary
,
primary
);
}
int
db_idx128_lowerbound
(
uint64_t
code
,
uint64_t
scope
,
uint64_t
table
,
uint128_t
&
secondary
,
uint64_t
&
primary
)
{
...
...
chainbase
@
664fdd9e
比较
d48ebabf
...
664fdd9e
Subproject commit
d48ebabf56b4115753fcabb7648a0ffcf3b0f5e9
Subproject commit
664fdd9e79263a894794f96959612ec2d1d013d0
programs/eosioc/main.cpp
浏览文件 @
7c406b5d
...
...
@@ -54,8 +54,8 @@ Usage: ./eosc create account [OPTIONS] creator name OwnerKey ActiveKey
Positionals:
creator TEXT The name of the account creating the new account
name TEXT The name of the new account
OwnerKey TEXT The owner public key for the account
ActiveKey TEXT The active public key for the account
OwnerKey TEXT The owner public key for the
new
account
ActiveKey TEXT The active public key for the
new
account
Options:
-s,--skip-signature Specify that unlocked wallet keys should not be used to sign transaction
...
...
@@ -489,8 +489,8 @@ int main( int argc, char** argv ) {
auto
createAccount
=
create
->
add_subcommand
(
"account"
,
localized
(
"Create a new account on the blockchain"
),
false
);
createAccount
->
add_option
(
"creator"
,
creator
,
localized
(
"The name of the account creating the new account"
))
->
required
();
createAccount
->
add_option
(
"name"
,
account_name
,
localized
(
"The name of the new account"
))
->
required
();
createAccount
->
add_option
(
"OwnerKey"
,
owner_key_str
,
localized
(
"The owner public key for the account"
))
->
required
();
createAccount
->
add_option
(
"ActiveKey"
,
active_key_str
,
localized
(
"The active public key for the account"
))
->
required
();
createAccount
->
add_option
(
"OwnerKey"
,
owner_key_str
,
localized
(
"The owner public key for the
new
account"
))
->
required
();
createAccount
->
add_option
(
"ActiveKey"
,
active_key_str
,
localized
(
"The active public key for the
new
account"
))
->
required
();
createAccount
->
add_flag
(
"-s,--skip-signature"
,
skip_sign
,
localized
(
"Specify that unlocked wallet keys should not be used to sign transaction"
));
add_standard_transaction_options
(
createAccount
);
createAccount
->
set_callback
([
&
]
{
...
...
scripts/eosio_build_darwin.sh
浏览文件 @
7c406b5d
...
...
@@ -165,13 +165,13 @@
exit
;
fi
./configure
make
make
-j
${
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling secp256k1-zkp.
\n
"
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
sudo
make
install
sudo
make
-j
${
CPU_CORE
}
install
sudo rm
-rf
${
TEMP_DIR
}
/secp256k1-zkp
else
printf
"
\t
secp256k1 found at /usr/local/lib/
\n
"
...
...
@@ -183,7 +183,7 @@
git clone https://github.com/WebAssembly/binaryen
cd
binaryen
git checkout tags/1.37.14
cmake
.
&&
make
cmake
.
&&
make
-j
${
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling binaryen.
\n
"
printf
"
\t
Exiting now.
\n\n
"
...
...
@@ -217,7 +217,7 @@
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
sudo
make
-j
4
install
sudo
make
-j
${
CPU_CORE
}
install
sudo rm
-rf
${
TEMP_DIR
}
/wasm-compiler
else
printf
"
\t
WASM found at /usr/local/wasm/bin/
\n
"
...
...
scripts/eosio_build_fedora.sh
浏览文件 @
7c406b5d
...
...
@@ -112,7 +112,7 @@
tar
xf boost_1.66.0.tar.bz2
cd
boost_1_66_0/
./bootstrap.sh
"--prefix=
$BOOST_ROOT
"
./b2
install
./b2
-j
${
CPU_CORE
}
install
rm
-rf
${
TEMP_DIR
}
/boost_1_66_0/
rm
-f
${
TEMP_DIR
}
/boost_1.66.0.tar.bz2
else
...
...
@@ -133,13 +133,13 @@
exit
;
fi
./configure
make
make
-j
${
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling secp256k1-zkp.
\n
"
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
sudo
make
install
sudo
make
-j
${
CPU_CORE
}
install
rm
-rf
cd
${
TEMP_DIR
}
/secp256k1-zkp
else
printf
"
\t
secp256k1 found
\n
"
...
...
@@ -153,7 +153,7 @@
git clone https://github.com/WebAssembly/binaryen
cd
binaryen
git checkout tags/1.37.14
cmake
.
&&
make
cmake
.
&&
make
-j
${
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling binaryen.
\n
"
printf
"
\t
Exiting now.
\n\n
"
...
...
@@ -185,13 +185,13 @@
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
make
-j
$
(
nproc
)
make
-j
$
{
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling LLVM and clang with EXPERIMENTAL WASM support.
\n
"
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
make
install
make
-j
${
CPU_CORE
}
install
rm
-rf
${
TEMP_DIR
}
/llvm-compiler 2>/dev/null
else
printf
"
\t
WASM found at
${
HOME
}
/opt/wasm
\n
"
...
...
scripts/eosio_build_ubuntu.sh
浏览文件 @
7c406b5d
...
...
@@ -94,7 +94,7 @@
tar
xf boost_1.66.0.tar.bz2
cd
boost_1_66_0/
./bootstrap.sh
"--prefix=
$BOOST_ROOT
"
./b2
install
./b2
-j
${
CPU_CORE
}
install
rm
-rf
${
TEMP_DIR
}
/boost_1_66_0/
rm
-f
${
TEMP_DIR
}
/boost_1.66.0.tar.bz2
else
...
...
@@ -115,13 +115,13 @@
exit
;
fi
./configure
make
make
-j
${
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling secp256k1-zkp.
\n
"
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
sudo
make
install
sudo
make
-j
${
CPU_CORE
}
install
rm
-rf
cd
${
TEMP_DIR
}
/secp256k1-zkp
else
printf
"
\t
secp256k1 found
\n
"
...
...
@@ -135,7 +135,7 @@
git clone https://github.com/WebAssembly/binaryen
cd
binaryen
git checkout tags/1.37.14
cmake
.
&&
make
cmake
.
&&
make
-j
${
CPU_CORE
}
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling binaryen.
\n
"
printf
"
\t
Exiting now.
\n\n
"
...
...
@@ -167,7 +167,7 @@
printf
"
\t
Exiting now.
\n\n
"
exit
;
fi
make
-j
$
(
nproc
)
make
-j
$
{
CPU_CORE
}
install
if
[
$?
-ne
0
]
;
then
printf
"
\t
Error compiling LLVM and clang with EXPERIMENTAL WASM support.
\n
"
printf
"
\t
Exiting now.
\n\n
"
...
...
tests/wasm_tests/wasm_tests.cpp
浏览文件 @
7c406b5d
...
...
@@ -830,5 +830,96 @@ BOOST_FIXTURE_TEST_CASE( check_table_maximum, tester ) try {
} FC_LOG_AND_RETHROW()
#endif
BOOST_FIXTURE_TEST_CASE
(
test_db
,
tester
)
try
{
produce_blocks
(
2
);
create_accounts
(
{
N
(
tester
)}
);
produce_block
();
set_code
(
N
(
tester
),
test_api_wast
);
// set_code(N(tester), test_api_abi);
produce_blocks
(
1
);
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
N
(
tester
),
config
::
active_name
}},
test_api_action
<
TEST_METHOD
(
"test_db"
,
"primary_i64_general"
)
>
{});
set_tapos
(
trx
);
trx
.
sign
(
get_private_key
(
N
(
tester
),
"active"
),
chain_id_type
());
push_transaction
(
trx
);
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
}
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
N
(
tester
),
config
::
active_name
}},
test_api_action
<
TEST_METHOD
(
"test_db"
,
"primary_i64_lowerbound"
)
>
{});
set_tapos
(
trx
);
trx
.
sign
(
get_private_key
(
N
(
tester
),
"active"
),
chain_id_type
());
push_transaction
(
trx
);
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
}
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
N
(
tester
),
config
::
active_name
}},
test_api_action
<
TEST_METHOD
(
"test_db"
,
"primary_i64_upperbound"
)
>
{});
set_tapos
(
trx
);
trx
.
sign
(
get_private_key
(
N
(
tester
),
"active"
),
chain_id_type
());
push_transaction
(
trx
);
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
}
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
N
(
tester
),
config
::
active_name
}},
test_api_action
<
TEST_METHOD
(
"test_db"
,
"idx64_general"
)
>
{});
set_tapos
(
trx
);
trx
.
sign
(
get_private_key
(
N
(
tester
),
"active"
),
chain_id_type
());
push_transaction
(
trx
);
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
}
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
N
(
tester
),
config
::
active_name
}},
test_api_action
<
TEST_METHOD
(
"test_db"
,
"idx64_lowerbound"
)
>
{});
set_tapos
(
trx
);
trx
.
sign
(
get_private_key
(
N
(
tester
),
"active"
),
chain_id_type
());
push_transaction
(
trx
);
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
}
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
N
(
tester
),
config
::
active_name
}},
test_api_action
<
TEST_METHOD
(
"test_db"
,
"idx64_upperbound"
)
>
{});
set_tapos
(
trx
);
trx
.
sign
(
get_private_key
(
N
(
tester
),
"active"
),
chain_id_type
());
push_transaction
(
trx
);
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
}
}
FC_LOG_AND_RETHROW
()
/// test_db
BOOST_AUTO_TEST_SUITE_END
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录