Oraclessubscribe with float
This commit is contained in:
@@ -310,7 +310,8 @@ uint64_t get_btcusd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// oraclescreate "BTCUSD" "coindeskpricedata" "L" -> 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3
|
// oraclescreate "BTCUSD" "coindeskpricedata" "L" -> 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3
|
||||||
// oraclesregister 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3 1000000
|
// oraclesregister 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3 1000000 -> 11c54d4ab17293217276396e27d86f714576ff55a3300dac34417047825edf93
|
||||||
|
// oraclessubscribe 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3 11c54d4ab17293217276396e27d86f714576ff55a3300dac34417047825edf93 1
|
||||||
|
|
||||||
int32_t main(int32_t argc,char **argv)
|
int32_t main(int32_t argc,char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5408,12 +5408,12 @@ UniValue oraclessubscribe(const UniValue& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
UniValue result(UniValue::VOBJ); uint256 txid; int64_t amount; std::string hex; std::vector<unsigned char> pubkey;
|
UniValue result(UniValue::VOBJ); uint256 txid; int64_t amount; std::string hex; std::vector<unsigned char> pubkey;
|
||||||
if ( fHelp || params.size() != 3 )
|
if ( fHelp || params.size() != 3 )
|
||||||
throw runtime_error("oraclessubscribe oracletxid publisher datafee\n");
|
throw runtime_error("oraclessubscribe oracletxid publisher amount\n");
|
||||||
if ( ensure_CCrequirements() < 0 )
|
if ( ensure_CCrequirements() < 0 )
|
||||||
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
||||||
txid = Parseuint256((char *)params[0].get_str().c_str());
|
txid = Parseuint256((char *)params[0].get_str().c_str());
|
||||||
pubkey = ParseHex(params[1].get_str().c_str());
|
pubkey = ParseHex(params[1].get_str().c_str());
|
||||||
amount = atol((char *)params[2].get_str().c_str());
|
amount = atof((char *)params[2].get_str().c_str()) * COIN;
|
||||||
hex = OracleSubscribe(0,txid,pubkey2pk(pubkey),amount);
|
hex = OracleSubscribe(0,txid,pubkey2pk(pubkey),amount);
|
||||||
if ( hex.size() > 0 )
|
if ( hex.size() > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user