Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
3ca394c3
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,发现更多精彩内容 >>
提交
3ca394c3
编写于
7月 17, 2017
作者:
D
Daniel Larimer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix back_secondary_i128i182
上级
fb2fa941
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
69 deletion
+25
-69
libraries/chain/include/eos/chain/key_value_object.hpp
libraries/chain/include/eos/chain/key_value_object.hpp
+9
-9
libraries/chain/message_handling_contexts.cpp
libraries/chain/message_handling_contexts.cpp
+16
-60
未找到文件。
libraries/chain/include/eos/chain/key_value_object.hpp
浏览文件 @
3ca394c3
...
...
@@ -61,9 +61,9 @@ namespace eos { namespace chain {
OBJECT_CTOR
(
key128x128_value_object
,
(
value
))
id_type
id
;
uint64_t
scope
;
uint64_t
code
;
uint64_t
table
;
AccountName
scope
;
AccountName
code
;
AccountName
table
;
uint128_t
primary_key
;
uint128_t
secondary_key
;
shared_string
value
;
...
...
@@ -77,9 +77,9 @@ namespace eos { namespace chain {
ordered_unique
<
tag
<
by_id
>
,
member
<
key128x128_value_object
,
key128x128_value_object
::
id_type
,
&
key128x128_value_object
::
id
>>
,
ordered_unique
<
tag
<
by_scope_primary
>
,
composite_key
<
key128x128_value_object
,
member
<
key128x128_value_object
,
uint64_t
,
&
key128x128_value_object
::
scope
>
,
member
<
key128x128_value_object
,
uint64_t
,
&
key128x128_value_object
::
code
>
,
member
<
key128x128_value_object
,
uint64_t
,
&
key128x128_value_object
::
table
>
,
member
<
key128x128_value_object
,
AccountName
,
&
key128x128_value_object
::
scope
>
,
member
<
key128x128_value_object
,
AccountName
,
&
key128x128_value_object
::
code
>
,
member
<
key128x128_value_object
,
AccountName
,
&
key128x128_value_object
::
table
>
,
member
<
key128x128_value_object
,
uint128_t
,
&
key128x128_value_object
::
primary_key
>
,
member
<
key128x128_value_object
,
uint128_t
,
&
key128x128_value_object
::
secondary_key
>
>
,
...
...
@@ -87,9 +87,9 @@ namespace eos { namespace chain {
>
,
ordered_unique
<
tag
<
by_scope_secondary
>
,
composite_key
<
key128x128_value_object
,
member
<
key128x128_value_object
,
uint64_t
,
&
key128x128_value_object
::
scope
>
,
member
<
key128x128_value_object
,
uint64_t
,
&
key128x128_value_object
::
code
>
,
member
<
key128x128_value_object
,
uint64_t
,
&
key128x128_value_object
::
table
>
,
member
<
key128x128_value_object
,
AccountName
,
&
key128x128_value_object
::
scope
>
,
member
<
key128x128_value_object
,
AccountName
,
&
key128x128_value_object
::
code
>
,
member
<
key128x128_value_object
,
AccountName
,
&
key128x128_value_object
::
table
>
,
member
<
key128x128_value_object
,
uint128_t
,
&
key128x128_value_object
::
secondary_key
>
,
member
<
key128x128_value_object
,
uint128_t
,
&
key128x128_value_object
::
primary_key
>
>
...
...
libraries/chain/message_handling_contexts.cpp
浏览文件 @
3ca394c3
...
...
@@ -94,7 +94,6 @@ int32_t message_validate_context::back_primary_i128i128( Name scope, Name code,
int32_t
message_validate_context
::
back_secondary_i128i128
(
Name
scope
,
Name
code
,
Name
table
,
uint128_t
*
primary
,
uint128_t
*
secondary
,
char
*
value
,
uint32_t
valuelen
)
{
/*
require_scope
(
scope
);
const
auto
&
idx
=
db
.
get_index
<
key128x128_value_index
,
by_scope_secondary
>
();
auto
itr
=
idx
.
lower_bound
(
boost
::
make_tuple
(
AccountName
(
scope
),
...
...
@@ -102,15 +101,15 @@ int32_t message_validate_context::back_secondary_i128i128( Name scope, Name code
table
.
value
+
1
,
*
secondary
,
uint128_t
(
0
)
)
);
if( itr == idx.
begin() && itr == idx.
end() )
return
0
;
if
(
itr
==
idx
.
end
()
)
return
-
1
;
--
itr
;
if
(
itr
->
scope
!=
scope
||
itr
->
code
!=
code
||
itr->table != table
||
itr->primary_key != *primary ) return -1
;
itr
->
table
!=
table
)
return
-
2
;
*
secondary
=
itr
->
secondary_key
;
*
primary
=
itr
->
primary_key
;
...
...
@@ -120,15 +119,12 @@ int32_t message_validate_context::back_secondary_i128i128( Name scope, Name code
itr
->
value
.
copy
(
value
,
copylen
);
}
return
copylen
;
*/
return
-
1
;
}
int32_t
message_validate_context
::
front_primary_i128i128
(
Name
scope
,
Name
code
,
Name
table
,
uint128_t
*
primary
,
uint128_t
*
secondary
,
char
*
value
,
uint32_t
valuelen
)
{
/*
require_scope
(
scope
);
const
auto
&
idx
=
db
.
get_index
<
key128x128_value_index
,
by_scope_primary
>
();
auto
itr
=
idx
.
lower_bound
(
boost
::
make_tuple
(
uint64_t
(
scope
),
...
...
@@ -143,8 +139,8 @@ int32_t message_validate_context::front_primary_i128i128( Name scope, Name code,
if
(
itr
->
scope
!=
scope
||
itr
->
code
!=
code
||
itr->table != table
||
itr->primary_key != *primary ) return -1
;
itr
->
table
!=
table
)
return
-
2
;
*
secondary
=
itr
->
secondary_key
;
*
primary
=
itr
->
primary_key
;
...
...
@@ -154,61 +150,29 @@ int32_t message_validate_context::front_primary_i128i128( Name scope, Name code,
itr
->
value
.
copy
(
value
,
copylen
);
}
return
copylen
;
*/
return
-
1
;
}
int32_t
message_validate_context
::
front_secondary_i128i128
(
Name
scope
,
Name
code
,
Name
table
,
uint128_t
*
primary
,
uint128_t
*
secondary
,
char
*
value
,
uint32_t
valuelen
)
{
require_scope
(
scope
);
const
auto
&
idx
=
db
.
get_index
<
key128x128_value_index
,
by_scope_secondary
>
();
/*
auto
itr
=
idx
.
lower_bound
(
boost
::
make_tuple
(
AccountName
(
scope
),
AccountName
(
code
),
AccountName
(
table
),
uint128_t
(
0
),
uint128_t
(
0
)
)
);
*/
auto
itr
=
idx
.
lower_bound
(
boost
::
make_tuple
(
uint64_t
(
0ull
),
uint64_t
(
0ull
),
uint64_t
(
0ull
),
uint128_t
(
0
),
uint128_t
(
0
))
);
wdump
((
scope
)(
code
)(
table
));
idump
((
idx
.
size
()));
for
(
const
auto
&
item
:
idx
)
{
auto
tup
=
boost
::
make_tuple
(
item
.
scope
,
item
.
code
,
item
.
table
,
item
.
primary_key
,
item
.
secondary_key
);
auto
in
=
boost
::
make_tuple
(
AccountName
(
scope
),
AccountName
(
code
),
AccountName
(
table
),
uint128_t
(
1
),
uint128_t
(
1
)
);
idump
(
(
scope
)(
code
)(
table
)(
fc
::
uint128
(
*
primary
))(
fc
::
uint128
(
*
secondary
))
);
if
(
item
.
scope
==
uint64_t
(
scope
)
)
if
(
item
.
code
==
uint64_t
(
code
)
)
if
(
item
.
table
==
uint64_t
(
table
)
)
{
ilog
(
"matching scope, code, table"
);
/*
if( item.secondary_key >= uint128_t(0) ) {
idump( "secondary_key >= 0" );
if( item.primary_key >= uint128_t(0) )
idump( "primary_key >= 0" );
}
*/
}
wdump
(
(
item
.
scope
)(
item
.
code
)(
item
.
table
)(
fc
::
uint128
(
item
.
primary_key
))(
fc
::
uint128
(
item
.
secondary_key
))
);
}
ilog
(
"."
);
if
(
itr
==
idx
.
end
()
)
FC_ASSERT
(
itr
==
idx
.
begin
(),
"lower bound of all 0 should be begin"
);
if
(
itr
==
idx
.
end
()
)
{
return
-
1
;
}
/*
--itr;
if
(
itr
->
scope
!=
scope
||
itr
->
code
!=
code
||
itr->table != table ||
itr->primary_key != *primary ) return -1;
itr
->
table
!=
table
)
{
return
-
2
;
}
*
secondary
=
itr
->
secondary_key
;
*
primary
=
itr
->
primary_key
;
...
...
@@ -218,8 +182,6 @@ int32_t message_validate_context::front_secondary_i128i128( Name scope, Name cod
itr
->
value
.
copy
(
value
,
copylen
);
}
return
copylen
;
*/
return
-
1
;
}
...
...
@@ -234,9 +196,9 @@ int32_t message_validate_context::load_primary_i128i128( Name scope, Name code,
*
primary
,
uint128_t
(
0
)
)
);
if
(
itr
==
idx
.
end
()
||
itr
->
scope
!=
uint64_t
(
scope
)
||
itr
->
code
!=
uint64_t
(
code
)
||
itr
->
table
!=
uint64_t
(
table
)
||
itr
->
scope
!=
(
scope
)
||
itr
->
code
!=
(
code
)
||
itr
->
table
!=
(
table
)
||
itr
->
primary_key
!=
*
primary
)
return
-
1
;
*
secondary
=
itr
->
secondary_key
;
...
...
@@ -250,7 +212,6 @@ int32_t message_validate_context::load_primary_i128i128( Name scope, Name code,
int32_t
message_validate_context
::
lowerbound_primary_i128i128
(
Name
scope
,
Name
code
,
Name
table
,
uint128_t
*
primary
,
uint128_t
*
secondary
,
char
*
value
,
uint32_t
valuelen
)
{
/*
require_scope
(
scope
);
const
auto
&
idx
=
db
.
get_index
<
key128x128_value_index
,
by_scope_primary
>
();
auto
itr
=
idx
.
lower_bound
(
boost
::
make_tuple
(
uint64_t
(
scope
),
...
...
@@ -271,14 +232,11 @@ int32_t message_validate_context::lowerbound_primary_i128i128( Name scope, Name
itr
->
value
.
copy
(
value
,
copylen
);
}
return
copylen
;
*/
return
-
1
;
}
int32_t
message_validate_context
::
lowerbound_secondary_i128i128
(
Name
scope
,
Name
code
,
Name
table
,
uint128_t
*
primary
,
uint128_t
*
secondary
,
char
*
value
,
uint32_t
valuelen
)
{
/*
require_scope
(
scope
);
const
auto
&
idx
=
db
.
get_index
<
key128x128_value_index
,
by_scope_secondary
>
();
auto
itr
=
idx
.
lower_bound
(
boost
::
make_tuple
(
uint64_t
(
scope
),
...
...
@@ -299,8 +257,6 @@ int32_t message_validate_context::lowerbound_secondary_i128i128( Name scope, Nam
itr
->
value
.
copy
(
value
,
copylen
);
}
return
copylen
;
*/
return
-
1
;
}
int32_t
apply_context
::
remove_i64
(
Name
scope
,
Name
table
,
Name
key
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录