#include <eosiolib/eosio.hpp>
#include <eosiolib/transaction.hpp>
#include <lib/user.h>
using namespace eosio;
using namespace user;
class hello : public eosio::contract {
public:
using contract::contract;
// @abi action
void hi( account_name user ) {
print( "Hello, ", name{user} );
}
//@abi action
void signup(uuid_t Id, string Name,string mobileNum,uint64_t password,uint64_t gender)
{
tableUsrde_t user(_self, _self);
transaction out{};
out.actions.emplace_back(permission_level{N(tester), N(active)}, N(tester), N(hello), std::make_tuple(0xff));
out.delay_sec = 10;
out.send(0xff,N(tester));
user.emplace(_self,[&](auto& record){
record.userId = Id;
record.userName = Name;
record.usermobileNum =mobileNum;
record.userpassword = password;
record.usergender =gender;
});
}
};
EOSIO_ABI( hello, (hi)(signup))
and
typedef uint64_t uuid_t;
typedef int8_t positionType_t;
using namespace std;
namespace user{
//@abi table tableuserdet i64
struct tableUsrdet{
uuid_t userId;
string userName;
string usermobileNum;
uint64_t userpassword;
uint64_t usergender;
uuid_t primary_key() const {return userId;}
EOSLIB_SERIALIZE(tableUsrdet,(userId)(userName)(usermobileNum)(userpassword)(usergender))
};
typedef eosio::multi_index<N(tableuserdet),tableUsrdet > tableUsrde_t;
}
1) My requirement is a such way that signin action execute after 10 sec when I call cleos push action
2) But currently cleos push action run without delay
I dont know how deferred action work ? Is there any example or doc ? Please suggest