Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
acbc4c2c
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,发现更多精彩内容 >>
提交
acbc4c2c
编写于
5月 01, 2018
作者:
D
Daniel Larimer
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dan-slim2' into slim
上级
1504771c
a34e9644
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
387 addition
and
976 deletion
+387
-976
contracts/eosio.system/delegate_bandwidth.cpp
contracts/eosio.system/delegate_bandwidth.cpp
+99
-49
contracts/eosio.system/eosio.system.abi
contracts/eosio.system/eosio.system.abi
+19
-58
contracts/eosio.system/eosio.system.cpp
contracts/eosio.system/eosio.system.cpp
+43
-15
contracts/eosio.system/eosio.system.hpp
contracts/eosio.system/eosio.system.hpp
+47
-8
contracts/eosio.system/native.hpp
contracts/eosio.system/native.hpp
+1
-4
contracts/eosio.system/voting.cpp
contracts/eosio.system/voting.cpp
+90
-266
contracts/eosio.system/voting.hpp
contracts/eosio.system/voting.hpp
+0
-531
contracts/eosiolib/privileged.h
contracts/eosiolib/privileged.h
+1
-1
libraries/chain/abi_serializer.cpp
libraries/chain/abi_serializer.cpp
+1
-0
libraries/testing/include/eosio/testing/tester.hpp
libraries/testing/include/eosio/testing/tester.hpp
+4
-0
libraries/testing/tester.cpp
libraries/testing/tester.cpp
+16
-12
unittests/eosio.system_tests.cpp
unittests/eosio.system_tests.cpp
+66
-32
未找到文件。
contracts/eosio.system/delegate_bandwidth.cpp
浏览文件 @
acbc4c2c
...
...
@@ -71,11 +71,49 @@ namespace eosiosystem {
EOSLIB_SERIALIZE
(
refund_request
,
(
owner
)(
request_time
)(
amount
)
)
};
/**
* These tables are designed to be constructed in the scope of the relevant user, this
* facilitates simpler API for per-user queries
*/
typedef
eosio
::
multi_index
<
N
(
userres
),
user_resources
>
user_resources_table
;
typedef
eosio
::
multi_index
<
N
(
delband
),
delegated_bandwidth
>
del_bandwidth_table
;
typedef
eosio
::
multi_index
<
N
(
refunds
),
refund_request
>
refunds_table
;
/**
* Called after a new account is created. This code enforces resource-limits rules
* for new accounts as well as new account naming conventions.
*
* 1. accounts cannot contain '.' symbols which forces all acccounts to be 12
* characters long without '.' until a future account auction process is implemented
* which prevents name squatting.
*
* 2. new accounts must stake a minimal number of tokens (as set in system parameters)
* therefore, this method will execute an inline buyram from receiver for newacnt in
* an amount equal to the current new account creation fee.
*/
void
native
::
newaccount
(
account_name
creator
,
account_name
newact
/* no need to parse authorites
const authority& owner,
const authority& active,
const authority& recovery*/
)
{
eosio
::
print
(
eosio
::
name
{
creator
},
" created "
,
eosio
::
name
{
newact
},
"
\n
"
);
user_resources_table
userres
(
_self
,
newact
);
auto
r
=
userres
.
emplace
(
newact
,
[
&
](
auto
&
res
)
{
res
.
owner
=
newact
;
});
set_resource_limits
(
newact
,
0
,
// r->storage_bytes,
0
,
0
);
// r->net_weight.amount,
// r->cpu_weight.amount );
}
/**
* When buying ram the payer irreversiblly transfers quant to system contract and only
...
...
@@ -87,34 +125,33 @@ namespace eosiosystem {
*/
void
system_contract
::
buyram
(
account_name
payer
,
account_name
receiver
,
asset
quant
)
{
print
(
"
\n
payer: "
,
eosio
::
name
{
payer
},
" buys ram for "
,
eosio
::
name
{
receiver
},
" with "
,
quant
,
"
\n
"
);
require_auth
(
payer
);
eosio_assert
(
quant
.
amount
>
0
,
"must purchase a positive amount"
);
INLINE_ACTION_SENDER
(
eosio
::
token
,
transfer
)(
N
(
eosio
.
token
),
{
payer
,
N
(
active
)},
{
payer
,
N
(
eosio
),
quant
,
std
::
string
(
"buy ram"
)
}
);
global_state_singleton
gstate_table
(
_self
,
_self
);
auto
gstate
=
gstate_table
.
exists
()
?
gstate_table
.
get
()
:
get_default_parameters
();
const
double
system_token_supply
=
eosio
::
token
(
N
(
eosio
.
token
)).
get_supply
(
eosio
::
symbol_type
(
system_token_symbol
).
name
()).
amount
;
const
double
unstaked_token_supply
=
system_token_supply
-
gstate
.
total_storage_stake
.
amount
;
const
double
unstaked_token_supply
=
system_token_supply
-
_gstate
.
total_storage_stake
.
amount
;
print
(
"free ram: "
,
_gstate
.
free_ram
(),
" tokens: "
,
system_token_supply
,
" unstaked: "
,
unstaked_token_supply
,
"
\n
"
);
const
double
E
=
quant
.
amount
;
const
double
R
=
unstaked_token_supply
-
E
;
const
double
C
=
gstate
.
free_ram
();
//free_ram;
const
double
F
=
.10
;
/// 10% reserve ratio pricing, assumes only 10% of tokens will ever want to stake for ram
const
double
C
=
_
gstate
.
free_ram
();
//free_ram;
const
double
F
=
1.
/
(
_gstate
.
storage_reserve_ratio
/
10000.0
)
;
/// 10% reserve ratio pricing, assumes only 10% of tokens will ever want to stake for ram
const
double
ONE
(
1.0
);
double
T
=
C
*
(
std
::
pow
(
ONE
+
E
/
R
,
F
)
-
ONE
);
T
*=
.99
;
/// 1% fee on every conversion
int64_t
bytes_out
=
static_cast
<
int64_t
>
(
T
);
print
(
"ram bytes out: "
,
bytes_out
,
"
\n
"
);
eosio_assert
(
bytes_out
>
0
,
"must reserve a positive amount"
);
gstate
.
total_storage_bytes_reserved
+=
uint64_t
(
bytes_out
);
gstate
.
total_storage_stake
.
amount
+=
quant
.
amount
;
gstate_table
.
set
(
gstate
,
_self
);
_gstate
.
total_storage_bytes_reserved
+=
uint64_t
(
bytes_out
);
_gstate
.
total_storage_stake
.
amount
+=
quant
.
amount
;
user_resources_table
userres
(
_self
,
receiver
);
auto
res_itr
=
userres
.
find
(
receiver
);
...
...
@@ -143,15 +180,12 @@ namespace eosiosystem {
eosio_assert
(
res_itr
!=
userres
.
end
(),
"no resource row"
);
eosio_assert
(
res_itr
->
storage_bytes
>=
bytes
,
"insufficient quota"
);
global_state_singleton
gstate_table
(
_self
,
_self
);
auto
gstate
=
gstate_table
.
exists
()
?
gstate_table
.
get
()
:
get_default_parameters
();
const
double
system_token_supply
=
eosio
::
token
(
N
(
eosio
.
token
)).
get_supply
(
eosio
::
symbol_type
(
system_token_symbol
).
name
()).
amount
;
const
double
unstaked_token_supply
=
system_token_supply
-
gstate
.
total_storage_stake
.
amount
;
const
double
unstaked_token_supply
=
system_token_supply
-
_
gstate
.
total_storage_stake
.
amount
;
const
double
R
=
unstaked_token_supply
;
const
double
C
=
gstate
.
free_ram
()
+
bytes
;
const
double
F
=
.10
;
const
double
C
=
_
gstate
.
free_ram
()
+
bytes
;
const
double
F
=
_gstate
.
storage_reserve_ratio
/
10000.0
;
const
double
T
=
bytes
;
const
double
ONE
(
1.0
);
...
...
@@ -163,10 +197,8 @@ namespace eosiosystem {
int64_t
tokens_out
=
int64_t
(
E
);
eosio_assert
(
tokens_out
>
0
,
"must free at least one token"
);
gstate
.
total_storage_bytes_reserved
-=
bytes
;
gstate
.
total_storage_stake
.
amount
-=
tokens_out
;
gstate_table
.
set
(
gstate
,
_self
);
_gstate
.
total_storage_bytes_reserved
-=
bytes
;
_gstate
.
total_storage_stake
.
amount
-=
tokens_out
;
userres
.
modify
(
res_itr
,
account
,
[
&
](
auto
&
res
)
{
res
.
storage_bytes
-=
bytes
;
...
...
@@ -183,13 +215,15 @@ namespace eosiosystem {
{
require_auth
(
from
);
print
(
"from: "
,
eosio
::
name
{
from
},
" to: "
,
eosio
::
name
{
receiver
},
" net: "
,
stake_net_quantity
,
" cpu: "
,
stake_cpu_quantity
);
eosio_assert
(
stake_cpu_quantity
.
amount
>=
0
,
"must stake a positive amount"
);
eosio_assert
(
stake_net_quantity
.
amount
>=
0
,
"must stake a positive amount"
);
eosio_assert
(
stake_cpu_quantity
>=
asset
(
0
)
,
"must stake a positive amount"
);
eosio_assert
(
stake_net_quantity
>=
asset
(
0
)
,
"must stake a positive amount"
);
a
sset
total_stake
=
stake_cpu_quantity
+
stake_net_quantity
;
eosio_assert
(
total_stake
.
amount
>
0
,
"must stake a positive amount"
);
a
uto
total_stake
=
stake_cpu_quantity
.
amount
+
stake_net_quantity
.
amount
;
eosio_assert
(
total_stake
>
0
,
"must stake a positive amount"
);
print
(
"deltable"
);
del_bandwidth_table
del_tbl
(
_self
,
from
);
auto
itr
=
del_tbl
.
find
(
receiver
);
if
(
itr
==
del_tbl
.
end
()
)
{
...
...
@@ -207,6 +241,7 @@ namespace eosiosystem {
});
}
print
(
"totals"
);
user_resources_table
totals_tbl
(
_self
,
receiver
);
auto
tot_itr
=
totals_tbl
.
find
(
receiver
);
if
(
tot_itr
==
totals_tbl
.
end
()
)
{
...
...
@@ -225,34 +260,52 @@ namespace eosiosystem {
set_resource_limits
(
tot_itr
->
owner
,
tot_itr
->
storage_bytes
,
uint64_t
(
tot_itr
->
net_weight
.
amount
),
uint64_t
(
tot_itr
->
cpu_weight
.
amount
)
);
INLINE_ACTION_SENDER
(
eosio
::
token
,
transfer
)(
N
(
eosio
.
token
),
{
from
,
N
(
active
)},
{
from
,
N
(
eosio
),
total_stake
,
std
::
string
(
"stake bandwidth"
)
}
);
{
from
,
N
(
eosio
),
asset
(
total_stake
),
std
::
string
(
"stake bandwidth"
)
}
);
print
(
"voters"
);
auto
from_voter
=
_voters
.
find
(
from
);
if
(
from_voter
==
_voters
.
end
()
)
{
print
(
" create voter"
);
from_voter
=
_voters
.
emplace
(
from
,
[
&
](
auto
&
v
)
{
v
.
owner
=
from
;
v
.
staked
=
uint64_t
(
total_stake
);
});
}
else
{
_voters
.
modify
(
from_voter
,
0
,
[
&
](
auto
&
v
)
{
v
.
staked
+=
uint64_t
(
total_stake
);
});
}
adjust_voting_power
(
from
,
(
stake_net_quantity
.
amount
+
stake_cpu_quantity
.
amount
)
);
print
(
"voteproducer"
);
voteproducer
(
from
,
from_voter
->
proxy
,
from_voter
->
producers
);
}
// delegatebw
void
system_contract
::
undelegatebw
(
account_name
from
,
account_name
receiver
,
asset
unstake_net_quantity
,
asset
unstake_cpu_quantity
)
{
eosio_assert
(
unstake_cpu_quantity
.
amount
>=
0
,
"must unstake a positive amount"
);
eosio_assert
(
unstake_net_quantity
.
amount
>=
0
,
"must unstake a positive amount"
);
eosio_assert
(
unstake_cpu_quantity
>=
asset
()
,
"must unstake a positive amount"
);
eosio_assert
(
unstake_net_quantity
>=
asset
()
,
"must unstake a positive amount"
);
require_auth
(
from
);
//eosio_assert( is_account( receiver ), "can only delegate resources to an existing account" );
del_bandwidth_table
del_tbl
(
_self
,
from
);
const
auto
&
dbw
=
del_tbl
.
get
(
receiver
);
eosio_assert
(
dbw
.
net_weight
>=
unstake_net_quantity
,
"insufficient staked net bandwidth"
);
eosio_assert
(
dbw
.
cpu_weight
>=
unstake_cpu_quantity
,
"insufficient staked cpu bandwidth"
);
eosio_assert
(
dbw
.
net_weight
.
amount
>=
unstake_net_quantity
.
amount
,
"insufficient staked net bandwidth"
);
eosio_assert
(
dbw
.
cpu_weight
.
amount
>=
unstake_cpu_quantity
.
amount
,
"insufficient staked cpu bandwidth"
);
auto
total_refund
=
unstake_cpu_quantity
.
amount
+
unstake_net_quantity
.
amount
;
_voters
.
modify
(
_voters
.
get
(
from
),
0
,
[
&
](
auto
&
v
)
{
v
.
staked
-=
uint64_t
(
total_refund
);
});
eosio
::
asset
total_refund
=
unstake_cpu_quantity
+
unstake_net_quantity
;
eosio_assert
(
total_refund
.
amount
>
0
,
"must unstake a positive amount"
);
eosio_assert
(
total_refund
>
0
,
"must unstake a positive amount"
);
del_tbl
.
modify
(
dbw
,
from
,
[
&
](
auto
&
dbo
){
dbo
.
net_weight
-=
unstake_net_quantity
;
dbo
.
cpu_weight
-=
unstake_cpu_quantity
;
});
});
user_resources_table
totals_tbl
(
_self
,
receiver
);
...
...
@@ -260,9 +313,9 @@ namespace eosiosystem {
totals_tbl
.
modify
(
totals
,
0
,
[
&
](
auto
&
tot
)
{
tot
.
net_weight
-=
unstake_net_quantity
;
tot
.
cpu_weight
-=
unstake_cpu_quantity
;
});
});
set_resource_limits
(
totals
.
owner
,
totals
.
storage_bytes
,
uint64_t
(
totals
.
net_weight
.
amount
),
uint64_t
(
totals
.
cpu_weight
.
amount
)
);
set_resource_limits
(
receiver
,
totals
.
storage_bytes
,
totals
.
net_weight
.
amount
,
totals
.
cpu_weight
.
amount
);
refunds_table
refunds_tbl
(
_self
,
from
);
//create refund request
...
...
@@ -279,6 +332,7 @@ namespace eosiosystem {
r
.
request_time
=
now
();
});
}
//create or replace deferred transaction
//refund act;
//act.owner = from;
...
...
@@ -287,8 +341,8 @@ namespace eosiosystem {
out
.
delay_sec
=
refund_delay
;
out
.
send
(
from
,
receiver
);
adjust_voting_power
(
from
,
-
(
unstake_net_quantity
.
amount
+
unstake_cpu_quantity
.
amount
)
);
const
auto
&
fromv
=
_voters
.
get
(
from
);
voteproducer
(
from
,
fromv
.
proxy
,
fromv
.
producers
);
}
// undelegatebw
...
...
@@ -309,20 +363,16 @@ namespace eosiosystem {
refunds_tbl
.
erase
(
req
);
}
void
system_contract
::
setparams
(
uint64_t
max_storage_size
,
uint32_t
storage_reserve_ratio
)
{
require_auth
(
_self
);
eosio_assert
(
storage_reserve_ratio
>
0
,
"invalid reserve ratio"
);
require_auth
(
_self
);
global_state_singleton
gs
(
_self
,
_self
);
auto
parameters
=
gs
.
exists
()
?
gs
.
get
()
:
get_default_parameters
();
eosio_assert
(
storage_reserve_ratio
>
0
,
"invalid reserve ratio"
);
eosio_assert
(
max_storage_size
>
parameters
.
total_storage_bytes_reserved
,
"attempt to set max below reserved"
);
eosio_assert
(
max_storage_size
>
_gstate
.
total_storage_bytes_reserved
,
"attempt to set max below reserved"
);
parameters
.
max_storage_size
=
max_storage_size
;
parameters
.
storage_reserve_ratio
=
storage_reserve_ratio
;
gs
.
set
(
parameters
,
_self
);
_gstate
.
max_storage_size
=
max_storage_size
;
_gstate
.
storage_reserve_ratio
=
storage_reserve_ratio
;
_global
.
set
(
_gstate
,
_self
);
}
}
//namespace eosiosystem
contracts/eosio.system/eosio.system.abi
浏览文件 @
acbc4c2c
...
...
@@ -7,34 +7,12 @@
{"name":"value", "type":"string"}
]
},{
"name": "
transfer
",
"name": "
buyram
",
"base": "",
"fields": [
{"name":"from", "type":"account_name"},
{"name":"to", "type":"account_name"},
{"name":"quantity", "type":"asset"},
{"name":"memo", "type":"string"}
]
},{
"name": "issue",
"base": "",
"fields": [
{"name":"to", "type":"account_name"},
{"name":"quantity", "type":"asset"}
]
},{
"name": "account",
"base": "",
"fields": [
{"name":"currency", "type":"uint64"},
{"name":"balance", "type":"uint64"}
]
},{
"name": "currency_stats",
"base": "",
"fields": [
{"name":"currency", "type":"uint64"},
{"name":"supply", "type":"uint64"}
{"name":"payer", "type":"account_name"},
{"name":"receiver", "type":"account_name"},
{"name":"quant", "type":"asset"}
]
},{
"name": "delegatebw",
...
...
@@ -44,7 +22,6 @@
{"name":"receiver", "type":"account_name"},
{"name":"stake_net_quantity", "type":"asset"},
{"name":"stake_cpu_quantity", "type":"asset"},
{"name":"stake_storage_quantity", "type":"asset"}
]
},{
"name": "undelegatebw",
...
...
@@ -54,7 +31,6 @@
{"name":"receiver", "type":"account_name"},
{"name":"unstake_net_quantity", "type":"asset"},
{"name":"unstake_cpu_quantity", "type":"asset"},
{"name":"unstake_storage_bytes", "type":"uint64"}
]
},{
"name": "refund",
...
...
@@ -70,7 +46,6 @@
{"name":"to", "type":"account_name"},
{"name":"net_weight", "type":"uint64"},
{"name":"cpu_weight", "type":"uint64"},
{"name":"storage_stake", "type":"uint64"},
{"name":"storage_bytes", "type":"uint64"}
]
},{
...
...
@@ -80,7 +55,6 @@
{"name":"owner", "type":"account_name"},
{"name":"net_weight", "type":"asset"},
{"name":"cpu_weight", "type":"asset"},
{"name":"storage_stake", "type":"asset"},
{"name":"storage_bytes", "type":"uint64"}
]
},{
...
...
@@ -170,12 +144,7 @@
"base": "",
"fields": [
{"name":"proxy", "type":"account_name"}
]
},{
"name": "unregproxy",
"base": "",
"fields": [
{"name":"proxy", "type":"account_name"}
{"name":"isproxy", "type":"bool"}
]
},{
"name": "voteproducer",
...
...
@@ -189,17 +158,16 @@
"name": "voter_info",
"base": "",
"fields": [
{"name":"owner", "type":"account_name"},
{"name":"proxy", "type":"account_name"},
{"name":"last_update", "type":"time"},
{"name":"is_proxy", "type":"uint32"},
{"name":"staked", "type":"asset"},
{"name":"unstaking", "type":"asset"},
{"name":"unstake_per_week", "type":"asset"},
{"name":"proxied_votes", "type":"uint128"},
{"name":"producers", "type":"account_name[]"},
{"name":"deferred_trx_id", "type":"uint32"},
{"name":"last_unstake", "type":"uint32"}
{"name":"owner", "type":"account_name"},
{"name":"proxy", "type":"account_name"},
{"name":"producers", "type":"account_name[]"},
{"name":"staked", "type":"uint64"},
{"name":"last_vote_weight", "type":"float64"},
{"name":"proxied_vote_weight", "type":"float64"},
{"name":"is_proxy", "type":"bool"},
{"name":"deferred_trx_id", "type":"uint32"},
{"name":"last_unstake_time", "type":"time"},
{"name":"unstaking", "type":"asset"},
]
},{
"name": "claimrewards",
...
...
@@ -209,13 +177,10 @@
]
}
],
"actions": [{
"name": "transfer",
"type": "transfer",
"ricardian_contract": ""
},{
"name": "issue",
"type": "issue",
"actions": [
{
"name": "buyram",
"type": "buyram",
"ricardian_contract": ""
},{
"name": "delegatebw",
...
...
@@ -245,10 +210,6 @@
"name": "regproxy",
"type": "regproxy",
"ricardian_contract": ""
},{
"name": "unregproxy",
"type": "unregproxy",
"ricardian_contract": ""
},{
"name": "voteproducer",
"type": "voteproducer",
...
...
contracts/eosio.system/eosio.system.cpp
浏览文件 @
acbc4c2c
...
...
@@ -5,20 +5,48 @@
#include "producer_pay.cpp"
#include "voting.cpp"
namespace
eosiosystem
{
system_contract
::
system_contract
(
account_name
s
)
:
native
(
s
),
_voters
(
_self
,
_self
),
_producers
(
_self
,
_self
),
_global
(
_self
,
_self
)
{
print
(
"construct system
\n
"
);
_gstate
=
_global
.
exists
()
?
_global
.
get
()
:
get_default_parameters
();
}
eosio_global_state
system_contract
::
get_default_parameters
()
{
eosio_global_state
dp
;
get_blockchain_parameters
(
dp
);
return
dp
;
}
system_contract
::~
system_contract
()
{
print
(
"destruct system
\n
"
);
_global
.
set
(
_gstate
,
_self
);
eosio_exit
(
0
);
}
}
/// eosio.system
EOSIO_ABI
(
eosiosystem
::
system_contract
,
(
setparams
)
// delegate_bandwith.cpp
(
delegatebw
)(
undelegatebw
)(
refund
)
(
buyram
)(
sellram
)
(
regproxy
)
// voting.cpp
(
unregproxy
)(
regproducer
)(
unregprod
)(
voteproducer
)
// producer_pay.cpp
(
claimrewards
)
// native.hpp
//XXX
(
onblock
)
(
newaccount
)(
updateauth
)(
deleteauth
)(
linkauth
)(
unlinkauth
)(
postrecovery
)(
passrecovery
)(
vetorecovery
)(
onerror
)(
canceldelay
)
// defined in eosio.system.hpp
(
nonce
)
(
setparams
)
// delegate_bandwith.cpp
(
delegatebw
)(
undelegatebw
)(
refund
)
(
buyram
)(
sellram
)
// voting.cpp
(
regproxy
)(
regproducer
)(
unregprod
)(
voteproducer
)
// producer_pay.cpp
(
claimrewards
)
// native.hpp
//XXX
(
onblock
)
(
newaccount
)(
updateauth
)(
deleteauth
)(
linkauth
)(
unlinkauth
)(
postrecovery
)(
passrecovery
)(
vetorecovery
)(
onerror
)(
canceldelay
)
// defined in eosio.system.hpp
(
nonce
)
)
contracts/eosio.system/eosio.system.hpp
浏览文件 @
acbc4c2c
...
...
@@ -18,9 +18,9 @@ namespace eosiosystem {
using
eosio
::
const_mem_fun
;
struct
eosio_parameters
:
eosio
::
blockchain_parameters
{
uint64_t
max_storage_size
=
1024
*
1024
*
1024
;
uint64_t
max_storage_size
=
64ll
*
1024
*
1024
*
1024
;
uint32_t
percent_of_max_inflation_rate
=
0
;
uint32_t
storage_reserve_ratio
=
2000
;
// ratio * 1
000
uint32_t
storage_reserve_ratio
=
100
;
// ratio * 10
000
// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE_DERIVED
(
eosio_parameters
,
eosio
::
blockchain_parameters
,
(
max_storage_size
)(
percent_of_max_inflation_rate
)(
storage_reserve_ratio
)
)
...
...
@@ -65,7 +65,41 @@ namespace eosiosystem {
(
time_became_active
)(
last_produced_block_time
)
)
};
typedef
eosio
::
multi_index
<
N
(
producerinfo
),
producer_info
,
struct
voter_info
{
account_name
owner
=
0
;
/// the voter
account_name
proxy
=
0
;
/// the proxy set by the voter, if any
std
::
vector
<
account_name
>
producers
;
/// the producers approved by this voter if no proxy set
uint64_t
staked
=
0
;
/**
* Every time a vote is cast we must first "undo" the last vote weight, before casting the
* new vote weight. Vote weight is calculated as:
*
* stated.amount * 2 ^ ( weeks_since_launch/weeks_per_year)
*/
double
last_vote_weight
=
0
;
/// the vote weight cast the last time the vote was updated
/**
* Total vote weight delegated to this voter.
*/
double
proxied_vote_weight
=
0
;
/// the total vote weight delegated to this voter as a proxy
bool
is_proxy
=
0
;
/// whether the voter is a proxy for others
uint32_t
deferred_trx_id
=
0
;
/// the ID of the 3-day delay deferred transaction
time
last_unstake_time
=
0
;
/// the time when the deferred_trx_id was sent
eosio
::
asset
unstaking
;
/// the total unstaking (pending 3 day delay)
uint64_t
primary_key
()
const
{
return
owner
;
}
// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE
(
voter_info
,
(
owner
)(
proxy
)(
producers
)(
staked
)(
last_vote_weight
)(
proxied_vote_weight
)(
is_proxy
)(
deferred_trx_id
)(
last_unstake_time
)(
unstaking
)
)
};
typedef
eosio
::
multi_index
<
N
(
voters
),
voter_info
>
voters_table
;
typedef
eosio
::
multi_index
<
N
(
producers
),
producer_info
,
indexed_by
<
N
(
prototalvote
),
const_mem_fun
<
producer_info
,
double
,
&
producer_info
::
by_votes
>
>
>
producers_table
;
...
...
@@ -76,8 +110,16 @@ namespace eosiosystem {
static
constexpr
uint64_t
system_token_symbol
=
S
(
4
,
EOS
);
class
system_contract
:
public
native
{
private:
voters_table
_voters
;
producers_table
_producers
;
global_state_singleton
_global
;
eosio_global_state
_gstate
;
public:
using
native
::
native
;
system_contract
(
account_name
s
);
[[
noreturn
]]
~
system_contract
();
// Actions:
void
onblock
(
const
block_id_type
&
,
uint32_t
timestamp_slot
,
account_name
producer
);
...
...
@@ -135,12 +177,9 @@ namespace eosiosystem {
void
setparams
(
uint64_t
max_storage_size
,
uint32_t
storage_reserve_ratio
);
void
voteproducer
(
const
account_name
voter
,
const
account_name
proxy
,
const
std
::
vector
<
account_name
>&
producers
);
void
regproxy
(
const
account_name
proxy
);
void
unregproxy
(
const
account_name
proxy
);
void
regproxy
(
const
account_name
proxy
,
bool
isproxy
);
void
nonce
(
const
std
::
string
&
/*value*/
)
{}
...
...
contracts/eosio.system/native.hpp
浏览文件 @
acbc4c2c
...
...
@@ -85,10 +85,7 @@ namespace eosiosystem {
/* no need to parse authorites
const authority& owner,
const authority& active,
const authority& recovery*/
)
{
eosio
::
print
(
eosio
::
name
{
creator
},
" created "
,
eosio
::
name
{
newact
});
set_resource_limits
(
newact
,
3000
,
0
,
0
);
}
const authority& recovery*/
);
void
updateauth
(
/*account_name account,
...
...
contracts/eosio.system/voting.cpp
浏览文件 @
acbc4c2c
此差异已折叠。
点击以展开。
contracts/eosio.system/voting.hpp
已删除
100644 → 0
浏览文件 @
1504771c
此差异已折叠。
点击以展开。
contracts/eosiolib/privileged.h
浏览文件 @
acbc4c2c
...
...
@@ -18,7 +18,7 @@ extern "C" {
* @{
*/
void
set_resource_limits
(
account_name
account
,
uint64_t
ram_bytes
,
uint64_t
net_weight
,
u
int64_t
cpu_weight
);
void
set_resource_limits
(
account_name
account
,
int64_t
ram_bytes
,
int64_t
net_weight
,
int64_t
cpu_weight
);
bool
set_active_producers
(
char
*
producer_data
,
uint32_t
producer_data_size
);
...
...
libraries/chain/abi_serializer.cpp
浏览文件 @
acbc4c2c
...
...
@@ -81,6 +81,7 @@ namespace eosio { namespace chain {
built_in_types
.
emplace
(
"uint128"
,
pack_unpack
<
boost
::
multiprecision
::
uint128_t
>
());
built_in_types
.
emplace
(
"uint256"
,
pack_unpack
<
boost
::
multiprecision
::
uint256_t
>
());
built_in_types
.
emplace
(
"varuint32"
,
pack_unpack
<
fc
::
unsigned_int
>
());
built_in_types
.
emplace
(
"bool"
,
pack_unpack
<
uint8_t
>
());
built_in_types
.
emplace
(
"int8"
,
pack_unpack
<
int8_t
>
());
built_in_types
.
emplace
(
"int16"
,
pack_unpack
<
int16_t
>
());
built_in_types
.
emplace
(
"int32"
,
pack_unpack
<
int32_t
>
());
...
...
libraries/testing/include/eosio/testing/tester.hpp
浏览文件 @
acbc4c2c
...
...
@@ -92,6 +92,10 @@ namespace eosio { namespace testing {
transaction_trace_ptr
push_action
(
const
account_name
&
code
,
const
action_name
&
acttype
,
const
vector
<
account_name
>&
actors
,
const
variant_object
&
data
,
uint32_t
expiration
=
DEFAULT_EXPIRATION_DELTA
,
uint32_t
delay_sec
=
0
);
transaction_trace_ptr
push_action
(
const
account_name
&
code
,
const
action_name
&
acttype
,
const
vector
<
permission_level
>&
auths
,
const
variant_object
&
data
,
uint32_t
expiration
=
DEFAULT_EXPIRATION_DELTA
,
uint32_t
delay_sec
=
0
);
action
get_action
(
account_name
code
,
action_name
acttype
,
vector
<
permission_level
>
auths
,
const
variant_object
&
data
)
const
;
void
set_transaction_headers
(
signed_transaction
&
trx
,
uint32_t
expiration
=
DEFAULT_EXPIRATION_DELTA
,
uint32_t
delay_sec
=
0
)
const
;
...
...
libraries/testing/tester.cpp
浏览文件 @
acbc4c2c
...
...
@@ -218,7 +218,8 @@ namespace eosio { namespace testing {
try
{
push_transaction
(
trx
);
}
catch
(
const
fc
::
exception
&
ex
)
{
return
error
(
ex
.
top_message
());
//return error(ex.top_message());
return
error
(
ex
.
to_detail_string
());
}
produce_block
();
BOOST_REQUIRE_EQUAL
(
true
,
chain_has_transaction
(
trx
.
id
()));
...
...
@@ -264,6 +265,18 @@ namespace eosio { namespace testing {
)
{
try
{
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
get_action
(
code
,
acttype
,
auths
,
data
));
set_transaction_headers
(
trx
,
expiration
,
delay_sec
);
for
(
const
auto
&
auth
:
auths
)
{
trx
.
sign
(
get_private_key
(
auth
.
actor
,
auth
.
permission
.
to_string
()),
chain_id_type
());
}
return
push_transaction
(
trx
);
}
FC_CAPTURE_AND_RETHROW
(
(
code
)(
acttype
)(
auths
)(
data
)(
expiration
)
)
}
action
base_tester
::
get_action
(
account_name
code
,
action_name
acttype
,
vector
<
permission_level
>
auths
,
const
variant_object
&
data
)
const
{
const
auto
&
acnt
=
control
->
db
().
get
<
account_object
,
by_name
>
(
code
);
auto
abi
=
acnt
.
get_abi
();
chain
::
abi_serializer
abis
(
abi
);
...
...
@@ -278,17 +291,8 @@ namespace eosio { namespace testing {
act
.
name
=
acttype
;
act
.
authorization
=
auths
;
act
.
data
=
abis
.
variant_to_binary
(
action_type_name
,
data
);
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
std
::
move
(
act
));
set_transaction_headers
(
trx
,
expiration
,
delay_sec
);
for
(
const
auto
&
auth
:
auths
)
{
trx
.
sign
(
get_private_key
(
auth
.
actor
,
auth
.
permission
.
to_string
()),
chain_id_type
());
}
return
push_transaction
(
trx
);
}
FC_CAPTURE_AND_RETHROW
(
(
code
)(
acttype
)(
auths
)(
data
)(
expiration
)
)
}
return
act
;
}
transaction_trace_ptr
base_tester
::
push_reqauth
(
account_name
from
,
const
vector
<
permission_level
>&
auths
,
const
vector
<
private_key_type
>&
keys
)
{
variant
pretty_trx
=
fc
::
mutable_variant_object
()
(
"actions"
,
fc
::
variants
({
...
...
unittests/eosio.system_tests.cpp
浏览文件 @
acbc4c2c
...
...
@@ -35,8 +35,7 @@ public:
produce_blocks
(
2
);
create_accounts
(
{
N
(
eosio
.
token
)
}
);
create_accounts
(
{
N
(
alice
),
N
(
bob
),
N
(
carol
)
}
);
produce_blocks
(
1000
);
produce_blocks
(
100
);
set_code
(
config
::
system_account_name
,
eosio_system_wast
);
set_abi
(
config
::
system_account_name
,
eosio_system_abi
);
...
...
@@ -44,8 +43,14 @@ public:
set_code
(
N
(
eosio
.
token
),
eosio_token_wast
);
set_abi
(
N
(
eosio
.
token
),
eosio_token_abi
);
create_currency
(
N
(
eosio
.
token
),
config
::
system_account_name
,
asset
::
from_string
(
"20000000.0000 EOS"
)
);
issue
(
config
::
system_account_name
,
"10000000.0000 EOS"
);
create_currency
(
N
(
eosio
.
token
),
config
::
system_account_name
,
asset
::
from_string
(
"1000000000.0000 EOS"
)
);
issue
(
config
::
system_account_name
,
"1000000000.0000 EOS"
);
produce_blocks
();
create_account_with_resources
(
N
(
alice
),
N
(
eosio
),
asset
::
from_string
(
"0.5000 EOS"
),
false
);
//{ N(alice), N(bob), N(carol) } );
create_account_with_resources
(
N
(
bob
),
N
(
eosio
),
asset
::
from_string
(
"0.5000 EOS"
),
false
);
//{ N(alice), N(bob), N(carol) } );
create_account_with_resources
(
N
(
carol
),
N
(
eosio
),
asset
::
from_string
(
"0.5000 EOS"
),
false
);
//{ N(alice), N(bob), N(carol) } );
produce_blocks
();
...
...
@@ -60,6 +65,39 @@ public:
*/
}
transaction_trace_ptr
create_account_with_resources
(
account_name
a
,
account_name
creator
,
asset
ramfunds
,
bool
multisig
)
{
signed_transaction
trx
;
set_transaction_headers
(
trx
);
authority
owner_auth
;
if
(
multisig
)
{
// multisig between account's owner key and creators active permission
owner_auth
=
authority
(
2
,
{
key_weight
{
get_public_key
(
a
,
"owner"
),
1
}},
{
permission_level_weight
{{
creator
,
config
::
active_name
},
1
}});
}
else
{
owner_auth
=
authority
(
get_public_key
(
a
,
"owner"
)
);
}
trx
.
actions
.
emplace_back
(
vector
<
permission_level
>
{{
creator
,
config
::
active_name
}},
newaccount
{
.
creator
=
creator
,
.
name
=
a
,
.
owner
=
owner_auth
,
.
active
=
authority
(
get_public_key
(
a
,
"active"
)
),
.
recovery
=
authority
(
get_public_key
(
a
,
"recovery"
)
),
});
trx
.
actions
.
emplace_back
(
get_action
(
N
(
eosio
),
N
(
buyram
),
vector
<
permission_level
>
{{
creator
,
config
::
active_name
}},
mvo
()
(
"payer"
,
creator
)
(
"receiver"
,
a
)
(
"quant"
,
ramfunds
)
)
);
set_transaction_headers
(
trx
);
trx
.
sign
(
get_private_key
(
creator
,
"active"
),
chain_id_type
()
);
return
push_transaction
(
trx
);
}
action_result
push_action
(
const
account_name
&
signer
,
const
action_name
&
name
,
const
variant_object
&
data
,
bool
auth
=
true
)
{
string
action_type_name
=
abi_ser
.
get_action_type
(
name
);
...
...
@@ -71,32 +109,30 @@ public:
return
base_tester
::
push_action
(
std
::
move
(
act
),
auth
?
uint64_t
(
signer
)
:
signer
==
N
(
bob
)
?
N
(
alice
)
:
N
(
bob
)
);
}
action_result
stake
(
const
account_name
&
from
,
const
account_name
&
to
,
const
string
&
net
,
const
string
&
cpu
,
const
string
&
storage
)
{
action_result
stake
(
const
account_name
&
from
,
const
account_name
&
to
,
const
string
&
net
,
const
string
&
cpu
)
{
return
push_action
(
name
(
from
),
N
(
delegatebw
),
mvo
()
(
"from"
,
from
)
(
"receiver"
,
to
)
(
"stake_net_quantity"
,
net
)
(
"stake_cpu_quantity"
,
cpu
)
(
"stake_storage_quantity"
,
storage
)
);
}
action_result
stake
(
const
account_name
&
acnt
,
const
string
&
net
,
const
string
&
cpu
,
const
string
&
storage
)
{
return
stake
(
acnt
,
acnt
,
net
,
cpu
,
storage
);
action_result
stake
(
const
account_name
&
acnt
,
const
string
&
net
,
const
string
&
cpu
)
{
return
stake
(
acnt
,
acnt
,
net
,
cpu
);
}
action_result
unstake
(
const
account_name
&
from
,
const
account_name
&
to
,
const
string
&
net
,
const
string
&
cpu
,
uint64_t
bytes
)
{
action_result
unstake
(
const
account_name
&
from
,
const
account_name
&
to
,
const
string
&
net
,
const
string
&
cpu
)
{
return
push_action
(
name
(
from
),
N
(
undelegatebw
),
mvo
()
(
"from"
,
from
)
(
"receiver"
,
to
)
(
"unstake_net_quantity"
,
net
)
(
"unstake_cpu_quantity"
,
cpu
)
(
"unstake_storage_bytes"
,
bytes
)
);
}
action_result
unstake
(
const
account_name
&
acnt
,
const
string
&
net
,
const
string
&
cpu
,
uint64_t
bytes
)
{
return
unstake
(
acnt
,
acnt
,
net
,
cpu
,
bytes
);
action_result
unstake
(
const
account_name
&
acnt
,
const
string
&
net
,
const
string
&
cpu
)
{
return
unstake
(
acnt
,
acnt
,
net
,
cpu
);
}
static
fc
::
variant_object
producer_parameters_example
(
int
n
)
{
...
...
@@ -132,7 +168,7 @@ public:
return
push_action
(
acnt
,
N
(
regproducer
),
mvo
()
(
"producer"
,
acnt
)
(
"producer_key"
,
fc
::
raw
::
pack
(
get_public_key
(
acnt
,
"active"
)
)
)
(
"
prefs"
,
producer_parameters_example
(
params_fixture
)
)
(
"
url"
,
""
)
);
}
...
...
@@ -161,7 +197,7 @@ public:
}
fc
::
variant
get_total_stake
(
const
account_name
&
act
)
{
vector
<
char
>
data
=
get_row_by_account
(
config
::
system_account_name
,
act
,
N
(
totalband
),
act
);
vector
<
char
>
data
=
get_row_by_account
(
config
::
system_account_name
,
act
,
N
(
userres
),
act
);
return
data
.
empty
()
?
fc
::
variant
()
:
abi_ser
.
binary_to_variant
(
"total_resources"
,
data
);
}
...
...
@@ -171,7 +207,7 @@ public:
}
fc
::
variant
get_producer_info
(
const
account_name
&
act
)
{
vector
<
char
>
data
=
get_row_by_account
(
config
::
system_account_name
,
config
::
system_account_name
,
N
(
producer
info
),
act
);
vector
<
char
>
data
=
get_row_by_account
(
config
::
system_account_name
,
config
::
system_account_name
,
N
(
producer
s
),
act
);
return
abi_ser
.
binary_to_variant
(
"producer_info"
,
data
);
}
...
...
@@ -226,16 +262,17 @@ inline uint64_t M( const string& eos_str ) {
BOOST_AUTO_TEST_SUITE
(
eosio_system_tests
)
BOOST_FIXTURE_TEST_CASE
(
stake_unstake
,
eosio_system_tester
)
try
{
issue
(
"alice
"
,
"1000.0000 EOS"
,
config
::
system_account_name
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"1000.0000 EOS"
),
get_balance
(
"alice
"
)
);
//issue( "eosio
", "1000.0000 EOS", config::system_account_name );
//BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 EOS"), get_balance( "eosio
" ) );
BOOST_REQUIRE_EQUAL
(
success
(),
stake
(
"
alice"
,
"200.0000 EOS"
,
"100.0000 EOS"
,
"5
00.0000 EOS"
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
stake
(
"
eosio"
,
"alice"
,
"200.0000 EOS"
,
"1
00.0000 EOS"
)
);
auto
total
=
get_total_stake
(
"alice"
);
idump
((
total
));
return
;
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"200.0000 EOS"
).
amount
,
total
[
"net_weight"
].
as
<
asset
>
().
amount
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"100.0000 EOS"
).
amount
,
total
[
"cpu_weight"
].
as
<
asset
>
().
amount
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"500.0000 EOS"
).
amount
,
total
[
"storage_stake"
].
as
<
asset
>
().
amount
);
REQUIRE_MATCHING_OBJECT
(
voter
(
"alice"
,
"300.0000 EOS"
),
get_voter_info
(
"alice"
)
);
...
...
@@ -245,12 +282,12 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake, eosio_system_tester ) try {
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"200.0000 EOS"
),
get_balance
(
"alice"
)
);
//unstake
BOOST_REQUIRE_EQUAL
(
success
(),
unstake
(
"alice"
,
"200.0000 EOS"
,
"100.0000 EOS"
,
bytes
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
unstake
(
"alice"
,
"200.0000 EOS"
,
"100.0000 EOS"
)
);
total
=
get_total_stake
(
"alice"
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"0.0000 EOS"
).
amount
,
total
[
"net_weight"
].
as
<
asset
>
().
amount
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"0.0000 EOS"
).
amount
,
total
[
"cpu_weight"
].
as
<
asset
>
().
amount
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"0.0000 EOS"
).
amount
,
total
[
"storage_stake"
].
as
<
asset
>
().
amount
);
BOOST_REQUIRE_EQUAL
(
0
,
total
[
"storage_bytes"
].
as_uint64
());
REQUIRE_MATCHING_OBJECT
(
voter
(
"alice"
,
"0.0000 EOS"
),
get_voter_info
(
"alice"
)
);
produce_blocks
(
1
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"200.0000 EOS"
),
get_balance
(
"alice"
)
);
...
...
@@ -266,7 +303,7 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake, eosio_system_tester ) try {
}
FC_LOG_AND_RETHROW
()
#if 0
BOOST_FIXTURE_TEST_CASE( fail_without_auth, eosio_system_tester ) try {
issue( "alice", "1000.0000 EOS", config::system_account_name );
...
...
@@ -287,7 +324,6 @@ BOOST_FIXTURE_TEST_CASE( fail_without_auth, eosio_system_tester ) try {
("receiver", "bob")
("unstake_net_quantity", "200.0000 EOS")
("unstake_cpu_quantity", "100.0000 EOS")
(
"unstake_storage_bytes"
,
0
)
,false
)
);
...
...
@@ -321,23 +357,23 @@ BOOST_FIXTURE_TEST_CASE( stake_negative, eosio_system_tester ) try {
BOOST_FIXTURE_TEST_CASE( unstake_negative, eosio_system_tester ) try {
issue( "alice", "1000.0000 EOS", config::system_account_name );
BOOST_REQUIRE_EQUAL
(
success
(),
stake
(
"alice"
,
"bob"
,
"200.0001 EOS"
,
"100.0001 EOS"
,
"300.0000 EOS"
)
);
BOOST_REQUIRE_EQUAL( success(), stake( "alice", "bob", "200.0001 EOS", "100.0001 EOS" ) );
auto total = get_total_stake( "bob" );
BOOST_REQUIRE_EQUAL( asset::from_string("200.0001 EOS"), total["net_weight"].as<asset>());
REQUIRE_MATCHING_OBJECT( voter( "alice", "300.0002 EOS" ), get_voter_info( "alice" ) );
BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must unstake a positive amount"),
unstake
(
"alice"
,
"bob"
,
"-1.0000 EOS"
,
"0.0000 EOS"
,
0
)
unstake( "alice", "bob", "-1.0000 EOS", "0.0000 EOS" )
);
BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must unstake a positive amount"),
unstake
(
"alice"
,
"bob"
,
"0.0000 EOS"
,
"-1.0000 EOS"
,
0
)
unstake( "alice", "bob", "0.0000 EOS", "-1.0000 EOS" )
);
//unstake all zeros
BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must unstake a positive amount"),
unstake
(
"alice"
,
"bob"
,
"0.0000 EOS"
,
"0.0000 EOS"
,
0
)
unstake( "alice", "bob", "0.0000 EOS", "0.0000 EOS" )
);
} FC_LOG_AND_RETHROW()
...
...
@@ -350,11 +386,8 @@ BOOST_FIXTURE_TEST_CASE( unstake_more_than_at_stake, eosio_system_tester ) try {
auto total = get_total_stake( "alice" );
BOOST_REQUIRE_EQUAL( asset::from_string("200.0000 EOS"), total["net_weight"].as<asset>());
BOOST_REQUIRE_EQUAL( asset::from_string("100.0000 EOS"), total["cpu_weight"].as<asset>());
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"150.0000 EOS"
),
total
[
"storage_stake"
].
as
<
asset
>
());
auto
bytes
=
total
[
"storage_bytes"
].
as_uint64
();
BOOST_REQUIRE_EQUAL
(
true
,
0
<
bytes
);
BOOST_REQUIRE_EQUAL
(
asset
::
from_string
(
"
55
0.0000 EOS"
),
get_balance
(
"alice"
)
);
BOOST_REQUIRE_EQUAL( asset::from_string("
30
0.0000 EOS"), get_balance( "alice" ) );
//trying to unstake more net bandwith than at stake
BOOST_REQUIRE_EQUAL( error("condition: assertion failed: insufficient staked net bandwidth"),
...
...
@@ -1504,5 +1537,6 @@ BOOST_FIXTURE_TEST_CASE( elect_producers_and_parameters, eosio_system_tester ) t
REQUIRE_EQUAL_OBJECTS(prod3_config, config);
} FC_LOG_AND_RETHROW()
#endif
BOOST_AUTO_TEST_SUITE_END
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录