js Date 传参给合约 eosio::time_point
合约
void xxx_contract::updatetime(eosio::time_point timestamp){
require_auth( _self.value );
system_tables system_table(_self, _self.value);
auto itr = system_table.begin();
if(itr == system_table.end()){
system_table.emplace( _self, [&]( auto& s ) {
s.id = system_table.available_primary_key();
s.zero_time = timestamp;
});
}else{
system_table.modify( itr, _self, [&]( auto& s ) {
s.zero_time = timestamp;
});
}
}
Js
push action 参数为 new Date().getTime() * 1000
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »