mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-07 10:46:42 +00:00
[fold] fix bad merge
- add back filter for ripple state on account_channels - add back network id test (env auto adds network id in xahau)
This commit is contained in:
@@ -38,7 +38,7 @@ addChannel(Json::Value& jsonLines, SLE const& line)
|
||||
jDst[jss::channel_id] = to_string(line.key());
|
||||
jDst[jss::account] = to_string(line[sfAccount]);
|
||||
jDst[jss::destination_account] = to_string(line[sfDestination]);
|
||||
jDst[jss::amount] = line[sfAmount].getText();
|
||||
line[sfAmount].setJson(jDst[jss::amount]);
|
||||
jDst[jss::balance] = line[sfBalance].getText();
|
||||
if (publicKeyType(line[sfPublicKey]))
|
||||
{
|
||||
@@ -170,6 +170,10 @@ doAccountChannels(RPC::JsonContext& context)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Filter out ripple state objects.
|
||||
if (sleCur->getType() != ltPAYCHAN)
|
||||
return false;
|
||||
|
||||
if (++count == limit)
|
||||
{
|
||||
marker = sleCur->key();
|
||||
|
||||
@@ -129,10 +129,28 @@ public:
|
||||
BEAST_EXPECT(env.app().config().NETWORK_ID == 1025);
|
||||
|
||||
// try to submit a txn without network id, this should not work
|
||||
{
|
||||
env.fund(XRP(200), alice);
|
||||
Json::Value jvn;
|
||||
jvn[jss::Account] = alice.human();
|
||||
jvn[jss::TransactionType] = jss::AccountSet;
|
||||
jvn[jss::Fee] = to_string(env.current()->fees().base);
|
||||
jvn[jss::Sequence] = env.seq(alice);
|
||||
jvn[jss::LastLedgerSequence] = env.current()->info().seq + 2;
|
||||
auto jt = env.jtnofill(jvn, alice);
|
||||
Serializer s;
|
||||
jt.stx->add(s);
|
||||
BEAST_EXPECT(
|
||||
env.rpc(
|
||||
"submit",
|
||||
strHex(s.slice()))[jss::result][jss::engine_result] ==
|
||||
"telREQUIRES_NETWORK_ID");
|
||||
env.close();
|
||||
}
|
||||
|
||||
Json::Value jv;
|
||||
jv[jss::Account] = alice.human();
|
||||
jv[jss::TransactionType] = jss::AccountSet;
|
||||
runTx(env, jv, telREQUIRES_NETWORK_ID);
|
||||
|
||||
// try to submit with wrong network id
|
||||
jv[jss::NetworkID] = 0;
|
||||
|
||||
Reference in New Issue
Block a user