Test
This commit is contained in:
@@ -4862,11 +4862,12 @@ UniValue tokentransfer(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
UniValue tokenbid(const UniValue& params, bool fHelp)
|
UniValue tokenbid(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
uint64_t bidamount; double price; uint256 tokenid;
|
uint64_t bidamount,numtokens; std::string hex; double price; uint256 tokenid;
|
||||||
if ( fHelp || params.size() != 3 )
|
if ( fHelp || params.size() != 3 )
|
||||||
throw runtime_error("tokenbid numtokens tokenid price\n");
|
throw runtime_error("tokenbid numtokens tokenid price\n");
|
||||||
numtokens = atoi(params[0].get_str().c_str());
|
numtokens = atoi(params[0].get_str().c_str());
|
||||||
tokenid = ParseHex(params[1].get_str());
|
std::vector<unsigned char> tokid(ParseHex(params[1].get_str()));
|
||||||
|
memcpy(&tokenid,tokid.data(),sizeof(tokenid));
|
||||||
price = atof(params[2].get_str().c_str());
|
price = atof(params[2].get_str().c_str());
|
||||||
bidamount = (price * numtokens) * COIN;
|
bidamount = (price * numtokens) * COIN;
|
||||||
hex = CreateBuyOffer(0,bidamount,tokenid,numtokens);
|
hex = CreateBuyOffer(0,bidamount,tokenid,numtokens);
|
||||||
|
|||||||
Reference in New Issue
Block a user