mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove transaction transit_set.
This commit is contained in:
@@ -1294,77 +1294,6 @@ Json::Value RPCServer::doServerInfo(const Json::Value& params)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// transit_set <seed> <paying_account> <transit_rate> <starts> <expires>
|
|
||||||
Json::Value RPCServer::doTransitSet(const Json::Value& params)
|
|
||||||
{
|
|
||||||
NewcoinAddress naSeed;
|
|
||||||
NewcoinAddress naSrcAccountID;
|
|
||||||
std::string sTransitRate;
|
|
||||||
std::string sTransitStart;
|
|
||||||
std::string sTransitExpire;
|
|
||||||
uint32 uTransitRate;
|
|
||||||
uint32 uTransitStart;
|
|
||||||
uint32 uTransitExpire;
|
|
||||||
uint256 uLedger = mNetOps->getCurrentLedger();
|
|
||||||
|
|
||||||
if (params.size() >= 6)
|
|
||||||
sTransitRate = params[6u].asString();
|
|
||||||
|
|
||||||
if (params.size() >= 7)
|
|
||||||
sTransitStart = params[7u].asString();
|
|
||||||
|
|
||||||
if (params.size() >= 8)
|
|
||||||
sTransitExpire = params[8u].asString();
|
|
||||||
|
|
||||||
if (!naSeed.setSeedGeneric(params[0u].asString()))
|
|
||||||
{
|
|
||||||
return RPCError(rpcBAD_SEED);
|
|
||||||
}
|
|
||||||
else if (!naSrcAccountID.setAccountID(params[1u].asString()))
|
|
||||||
{
|
|
||||||
return RPCError(rpcSRC_ACT_MALFORMED);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NewcoinAddress naMasterGenerator;
|
|
||||||
NewcoinAddress naAccountPublic;
|
|
||||||
NewcoinAddress naAccountPrivate;
|
|
||||||
AccountState::pointer asSrc;
|
|
||||||
STAmount saSrcBalance;
|
|
||||||
Json::Value obj = authorize(uLedger, naSeed, naSrcAccountID, naAccountPublic, naAccountPrivate,
|
|
||||||
saSrcBalance, theConfig.FEE_DEFAULT, asSrc, naMasterGenerator);
|
|
||||||
|
|
||||||
if (!obj.empty())
|
|
||||||
return obj;
|
|
||||||
|
|
||||||
uTransitRate = 0;
|
|
||||||
uTransitStart = 0;
|
|
||||||
uTransitExpire = 0;
|
|
||||||
|
|
||||||
Transaction::pointer trans = Transaction::sharedTransitSet(
|
|
||||||
naAccountPublic, naAccountPrivate,
|
|
||||||
naSrcAccountID,
|
|
||||||
asSrc->getSeq(),
|
|
||||||
theConfig.FEE_DEFAULT,
|
|
||||||
0, // YYY No source tag
|
|
||||||
uTransitRate,
|
|
||||||
uTransitStart,
|
|
||||||
uTransitExpire);
|
|
||||||
|
|
||||||
(void) mNetOps->processTransaction(trans);
|
|
||||||
|
|
||||||
obj["transaction"] = trans->getSTransaction()->getJson(0);
|
|
||||||
obj["status"] = trans->getStatus();
|
|
||||||
obj["seed"] = naSeed.humanSeed();
|
|
||||||
obj["srcAccountID"] = naSrcAccountID.humanAccountID();
|
|
||||||
obj["transitRate"] = uTransitRate;
|
|
||||||
obj["transitStart"] = uTransitStart;
|
|
||||||
obj["transitExpire"] = uTransitExpire;
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Json::Value RPCServer::doTx(const Json::Value& params)
|
Json::Value RPCServer::doTx(const Json::Value& params)
|
||||||
{
|
{
|
||||||
// tx <txID>
|
// tx <txID>
|
||||||
@@ -2061,7 +1990,6 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params
|
|||||||
{ "send", &RPCServer::doSend, 3, 7, false, optCurrent },
|
{ "send", &RPCServer::doSend, 3, 7, false, optCurrent },
|
||||||
{ "server_info", &RPCServer::doServerInfo, 0, 0, true },
|
{ "server_info", &RPCServer::doServerInfo, 0, 0, true },
|
||||||
{ "stop", &RPCServer::doStop, 0, 0, true },
|
{ "stop", &RPCServer::doStop, 0, 0, true },
|
||||||
{ "transit_set", &RPCServer::doTransitSet, 5, 5, true, optCurrent },
|
|
||||||
{ "tx", &RPCServer::doTx, 1, 1, true },
|
{ "tx", &RPCServer::doTx, 1, 1, true },
|
||||||
|
|
||||||
{ "unl_add", &RPCServer::doUnlAdd, 1, 2, true },
|
{ "unl_add", &RPCServer::doUnlAdd, 1, 2, true },
|
||||||
|
|||||||
@@ -413,43 +413,6 @@ Transaction::pointer Transaction::sharedPayment(
|
|||||||
return tResult->setPayment(naPrivateKey, naDstAccountID, saAmount, saSendMax, saPaths);
|
return tResult->setPayment(naPrivateKey, naDstAccountID, saAmount, saSendMax, saPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// TransitSet
|
|
||||||
//
|
|
||||||
|
|
||||||
Transaction::pointer Transaction::setTransitSet(
|
|
||||||
const NewcoinAddress& naPrivateKey,
|
|
||||||
uint32 uTransitRate,
|
|
||||||
uint32 uTransitStart,
|
|
||||||
uint32 uTransitExpire)
|
|
||||||
{
|
|
||||||
if (uTransitRate)
|
|
||||||
mTransaction->setITFieldU32(sfTransitRate, uTransitRate);
|
|
||||||
if (uTransitStart)
|
|
||||||
mTransaction->setITFieldU32(sfTransitStart, uTransitStart);
|
|
||||||
if (uTransitExpire)
|
|
||||||
mTransaction->setITFieldU32(sfTransitExpire, uTransitExpire);
|
|
||||||
|
|
||||||
sign(naPrivateKey);
|
|
||||||
|
|
||||||
return shared_from_this();
|
|
||||||
}
|
|
||||||
|
|
||||||
Transaction::pointer Transaction::sharedTransitSet(
|
|
||||||
const NewcoinAddress& naPublicKey, const NewcoinAddress& naPrivateKey,
|
|
||||||
const NewcoinAddress& naSourceAccount,
|
|
||||||
uint32 uSeq,
|
|
||||||
const STAmount& saFee,
|
|
||||||
uint32 uSourceTag,
|
|
||||||
uint32 uTransitRate,
|
|
||||||
uint32 uTransitStart,
|
|
||||||
uint32 uTransitExpire)
|
|
||||||
{
|
|
||||||
pointer tResult = boost::make_shared<Transaction>(ttTRANSIT_SET, naPublicKey, naSourceAccount, uSeq, saFee, uSourceTag);
|
|
||||||
|
|
||||||
return tResult->setTransitSet(naPrivateKey, uTransitRate, uTransitStart, uTransitExpire);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// WalletAdd
|
// WalletAdd
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -96,12 +96,6 @@ private:
|
|||||||
const STAmount& saSendMax,
|
const STAmount& saSendMax,
|
||||||
const STPathSet& spPaths);
|
const STPathSet& spPaths);
|
||||||
|
|
||||||
Transaction::pointer setTransitSet(
|
|
||||||
const NewcoinAddress& naPrivateKey,
|
|
||||||
uint32 uTransitRate,
|
|
||||||
uint32 uTransitStart,
|
|
||||||
uint32 uTransitExpire);
|
|
||||||
|
|
||||||
Transaction::pointer setWalletAdd(
|
Transaction::pointer setWalletAdd(
|
||||||
const NewcoinAddress& naPrivateKey,
|
const NewcoinAddress& naPrivateKey,
|
||||||
const STAmount& saAmount,
|
const STAmount& saAmount,
|
||||||
@@ -206,17 +200,6 @@ public:
|
|||||||
const STAmount& saSendMax,
|
const STAmount& saSendMax,
|
||||||
const STPathSet& saPaths);
|
const STPathSet& saPaths);
|
||||||
|
|
||||||
// Set transit fees.
|
|
||||||
static Transaction::pointer sharedTransitSet(
|
|
||||||
const NewcoinAddress& naPublicKey, const NewcoinAddress& naPrivateKey,
|
|
||||||
const NewcoinAddress& naSourceAccount,
|
|
||||||
uint32 uSeq,
|
|
||||||
const STAmount& saFee,
|
|
||||||
uint32 uSourceTag,
|
|
||||||
uint32 uTransitRate,
|
|
||||||
uint32 uTransitStart,
|
|
||||||
uint32 uTransitExpire);
|
|
||||||
|
|
||||||
// Add an account to a wallet.
|
// Add an account to a wallet.
|
||||||
static Transaction::pointer sharedWalletAdd(
|
static Transaction::pointer sharedWalletAdd(
|
||||||
const NewcoinAddress& naPublicKey, const NewcoinAddress& naPrivateKey,
|
const NewcoinAddress& naPublicKey, const NewcoinAddress& naPrivateKey,
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ void printHelp(const po::options_description& desc)
|
|||||||
cout << " peers" << endl;
|
cout << " peers" << endl;
|
||||||
cout << " send <seed> <paying_account> <account_id> <amount> [<currency>] [<send_max>] [<send_currency>]" << endl;
|
cout << " send <seed> <paying_account> <account_id> <amount> [<currency>] [<send_max>] [<send_currency>]" << endl;
|
||||||
cout << " stop" << endl;
|
cout << " stop" << endl;
|
||||||
cout << " transit_set <seed> <paying_account> <transit_rate> <starts> <expires>" << endl;
|
|
||||||
cout << " tx <id>" << endl;
|
cout << " tx <id>" << endl;
|
||||||
cout << " unl_add <domain>|<public> [<comment>]" << endl;
|
cout << " unl_add <domain>|<public> [<comment>]" << endl;
|
||||||
cout << " unl_delete <domain>|<public_key>" << endl;
|
cout << " unl_delete <domain>|<public_key>" << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user