Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
2acec365
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,发现更多精彩内容 >>
提交
2acec365
编写于
5月 08, 2018
作者:
D
Daniel Larimer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add get_permission_last_used and get_account_creation_date intrinsic api #2854
上级
56d6cb58
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
15 deletion
+11
-15
libraries/chain/eosio_contract.cpp
libraries/chain/eosio_contract.cpp
+0
-15
libraries/chain/wasm_interface.cpp
libraries/chain/wasm_interface.cpp
+11
-0
未找到文件。
libraries/chain/eosio_contract.cpp
浏览文件 @
2acec365
...
...
@@ -358,21 +358,6 @@ static const abi_serializer& get_abi_serializer() {
}
static
auto
get_account_creation
(
const
apply_context
&
context
,
const
account_name
&
account
)
{
auto
const
&
accnt
=
context
.
db
.
get
<
account_object
,
by_name
>
(
account
);
return
(
time_point
)
accnt
.
creation_date
;
};
static
auto
get_permission_last_used
(
const
apply_context
&
context
,
const
account_name
&
account
,
const
permission_name
&
permission
)
{
auto
const
*
perm
=
context
.
db
.
find
<
permission_usage_object
,
by_account_permission
>
(
boost
::
make_tuple
(
account
,
permission
));
if
(
perm
)
{
return
optional
<
time_point
>
(
perm
->
last_used
);
}
return
optional
<
time_point
>
();
};
void
apply_eosio_canceldelay
(
apply_context
&
context
)
{
auto
cancel
=
context
.
act
.
data_as
<
canceldelay
>
();
context
.
require_authorization
(
cancel
.
canceling_auth
.
actor
);
// only here to mark the single authority on this action as used
...
...
libraries/chain/wasm_interface.cpp
浏览文件 @
2acec365
...
...
@@ -823,6 +823,15 @@ class permission_api : public context_aware_api {
return
-
1
;
}
int64_t
get_permission_last_used
(
account_name
account
,
permission_name
permission
)
{
return
context
.
db
.
get
<
permission_usage_object
,
by_account_permission
>
(
boost
::
make_tuple
(
account
,
permission
)).
last_used
.
time_since_epoch
().
count
();
};
int64_t
get_account_creation_date
(
account_name
account
)
{
return
time_point
(
context
.
db
.
get
<
account_object
,
by_name
>
(
account
).
creation_date
).
time_since_epoch
().
count
();
}
private:
void
unpack_provided_keys
(
flat_set
<
public_key_type
>&
keys
,
const
char
*
pubkeys_data
,
size_t
pubkeys_size
)
{
keys
.
clear
();
...
...
@@ -1684,6 +1693,8 @@ REGISTER_INTRINSICS(crypto_api,
REGISTER_INTRINSICS
(
permission_api
,
(
check_transaction_authorization
,
int64_t
(
int
,
int
,
int
,
int
,
int
,
int
)
)
(
check_permission_authorization
,
int64_t
(
int64_t
,
int64_t
,
int
,
int
,
int
,
int
,
int64_t
)
)
(
get_permission_last_used
,
int64_t
(
int64_t
,
int64_t
)
)
(
get_account_creation_date
,
int64_t
(
int64_t
)
)
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录