Skip to content

Instantly share code, notes, and snippets.

@jin10086
Created November 12, 2019 13:27
Show Gist options
  • Save jin10086/16e6f16b9149488eeae6123c03926b86 to your computer and use it in GitHub Desktop.
Save jin10086/16e6f16b9149488eeae6123c03926b86 to your computer and use it in GitHub Desktop.
测试 触发延时操作
#include <eosio/eosio.hpp>
#include <eosio/asset.hpp>
#include <eosio/singleton.hpp>
#include <eosio/transaction.hpp>
using namespace std;
using namespace eosio;
CONTRACT testonerror : public contract
{
public:
using contract::contract;
ACTION b()
{
check(false,"h");
}
ACTION a()
{
transaction out;
out.actions.emplace_back( permission_level{ _self, "active"_n }, _self, "b"_n
, std::make_tuple() );
out.delay_sec = 2;
out.send(11, _self, true);
}
[[eosio::on_notify("*::onerror")]]
void onerror(ignore<uint128_t>, ignore<std::vector<char>> )
{
}
private:
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment