Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
0bd7020f
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,发现更多精彩内容 >>
提交
0bd7020f
编写于
5月 23, 2018
作者:
D
Daniel Larimer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #3315 - unable to create 12 char names (by non-eosio accounts)
- added print(char) API - added unit test to validate create 12
上级
5c3c9fd9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
49 deletion
+12
-49
contracts/eosio.system/eosio.system.cpp
contracts/eosio.system/eosio.system.cpp
+5
-4
contracts/eosiolib/print.hpp
contracts/eosiolib/print.hpp
+4
-0
unittests/eosio.system_tests.cpp
unittests/eosio.system_tests.cpp
+3
-0
unittests/misc_tests.cpp
unittests/misc_tests.cpp
+0
-45
未找到文件。
contracts/eosio.system/eosio.system.cpp
浏览文件 @
0bd7020f
...
...
@@ -134,11 +134,12 @@ namespace eosiosystem {
const authority& active*/
)
{
if
(
creator
!=
_self
)
{
auto
tmp
=
newact
;
auto
tmp
=
newact
>>
4
;
bool
has_dot
=
false
;
for
(
uint32_t
i
=
0
;
i
<
13
;
++
i
)
{
has_dot
|=
(
tmp
>>
59
);
tmp
<<=
5
;
for
(
uint32_t
i
=
0
;
i
<
12
;
++
i
)
{
has_dot
|=
!
(
tmp
&
0x1f
);
tmp
>>=
5
;
}
auto
suffix
=
eosio
::
name_suffix
(
newact
);
if
(
has_dot
)
{
...
...
contracts/eosiolib/print.hpp
浏览文件 @
0bd7020f
...
...
@@ -26,6 +26,10 @@ namespace eosio {
prints_l
(
s
.
c_str
(),
s
.
size
()
);
}
inline
void
print
(
const
char
c
)
{
prints_l
(
&
c
,
1
);
}
/**
* Prints signed integer
* @brief Prints signed integer as a 64 bit signed integer
...
...
unittests/eosio.system_tests.cpp
浏览文件 @
0bd7020f
...
...
@@ -1763,6 +1763,8 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, eosio_system_tester) try {
create_account_with_resources
(
N
(
producvoterb
),
config
::
system_account_name
,
core_from_string
(
"1.0000"
),
false
,
large_asset
,
large_asset
);
create_account_with_resources
(
N
(
producvoterc
),
config
::
system_account_name
,
core_from_string
(
"1.0000"
),
false
,
large_asset
,
large_asset
);
// create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers
std
::
vector
<
account_name
>
producer_names
;
producer_names
.
reserve
(
'z'
-
'a'
+
1
);
...
...
@@ -2262,6 +2264,7 @@ BOOST_FIXTURE_TEST_CASE( buyname, eosio_system_tester ) try {
//wlog( "verify dan cannot create test.fail" );
BOOST_REQUIRE_THROW
(
create_accounts_with_resources
(
{
N
(
test
.
fail
)
},
N
(
dan
)
),
fc
::
exception
);
// dan shouldn't be able to do this
create_accounts_with_resources
(
{
N
(
goodgoodgood
)
},
N
(
dan
)
);
/// 12 char names should succeed
}
FC_LOG_AND_RETHROW
()
BOOST_FIXTURE_TEST_CASE
(
multiple_namebids
,
eosio_system_tester
)
try
{
...
...
unittests/misc_tests.cpp
浏览文件 @
0bd7020f
...
...
@@ -532,51 +532,6 @@ BOOST_AUTO_TEST_CASE(alphabetic_sort)
}
FC_LOG_AND_RETHROW
()
}
BOOST_AUTO_TEST_CASE
(
suffix_test
)
try
{
uint64_t
com
=
name
(
"com"
);
uint64_t
order
=
com
;
uint64_t
name_com
=
name
(
"name.com"
);
uint64_t
name_com_au
=
name
(
"name.com.au"
);
//std::string str(13,'.');
uint64_t
tmp
=
com
;
auto
print
=
[](
uint64_t
tmp
)
{
static
const
char
*
charmap
=
".12345abcdefghijklmnopqrstuvwxyz"
;
uint64_t
suffix
=
0
;
bool
endsuffix
=
false
;
uint32_t
offset
=
0
;
for
(
uint32_t
i
=
0
;
i
<=
12
;
++
i
,
++
offset
)
{
auto
p
=
tmp
>>
59
;
char
c
=
charmap
[
p
];
if
(
!
p
)
{
endsuffix
=
true
;
}
else
{
if
(
!
endsuffix
)
{
suffix
|=
uint64_t
(
p
)
<<
(
59
-
(
5
*
offset
));
}
}
if
(
endsuffix
&&
p
)
{
endsuffix
=
false
;
offset
=
0
;
suffix
=
uint64_t
(
p
)
<<
(
59
-
(
5
*
offset
));
}
std
::
cerr
<<
c
;
// str[12-i] = c;
tmp
<<=
5
;
}
// std::cerr << " suffix: " << name(suffix) <<"\n";
};
print
(
com
);
//std::cerr <<"\n";
print
(
name_com
);
print
(
name_com_au
);
}
FC_LOG_AND_RETHROW
()
BOOST_AUTO_TEST_CASE
(
transaction_test
)
{
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录