update no autofill (change autosign)

This commit is contained in:
Denis Angell
2023-06-12 00:01:34 +00:00
parent 51e8a1b222
commit df4891c4a7
3 changed files with 14 additions and 4 deletions

View File

@@ -129,7 +129,7 @@ public:
jvn[jss::Fee] = to_string(env.current()->fees().base); jvn[jss::Fee] = to_string(env.current()->fees().base);
jvn[jss::Sequence] = env.seq(alice); jvn[jss::Sequence] = env.seq(alice);
jvn[jss::LastLedgerSequence] = env.current()->info().seq + 2; jvn[jss::LastLedgerSequence] = env.current()->info().seq + 2;
auto jt = env.jtnofill(jvn); auto jt = env.jtnofill(jvn, alice);
Serializer s; Serializer s;
jt.stx->add(s); jt.stx->add(s);
BEAST_EXPECT(env.rpc("submit", strHex(s.slice()))[jss::result][jss::engine_result] == "telREQUIRES_NETWORK_ID"); BEAST_EXPECT(env.rpc("submit", strHex(s.slice()))[jss::result][jss::engine_result] == "telREQUIRES_NETWORK_ID");

View File

@@ -446,13 +446,13 @@ public:
} }
/** Create a JTx from parameters. */ /** Create a JTx from parameters. */
template <class JsonValue, class... FN> template <class JsonValue, class Account, class... FN>
JTx JTx
jtnofill(JsonValue&& jv, FN const&... fN) jtnofill(JsonValue&& jv, Account account, FN const&... fN)
{ {
JTx jt(std::forward<JsonValue>(jv)); JTx jt(std::forward<JsonValue>(jv));
invoke(jt, fN...); invoke(jt, fN...);
autofill_sig(jt); nofill_sig(jt, account);
jt.stx = st(jt); jt.stx = st(jt);
return jt; return jt;
} }
@@ -664,6 +664,9 @@ protected:
void void
autofill_sig(JTx& jt); autofill_sig(JTx& jt);
void
nofill_sig(JTx& jt, Account account);
virtual void virtual void
autofill(JTx& jt); autofill(JTx& jt);

View File

@@ -424,6 +424,13 @@ Env::autofill_sig(JTx& jt)
jtx::sign(jv, account); jtx::sign(jv, account);
} }
void
Env::nofill_sig(JTx& jt, Account account)
{
auto& jv = jt.jv;
jtx::sign(jv, account);
}
void void
Env::autofill(JTx& jt) Env::autofill(JTx& jt)
{ {