Skip to content

Commit

Permalink
support isTxExtraTooBig in SubmitTxResult
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed May 26, 2023
1 parent 54b4af0 commit eb97bb2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/js/daemon/MoneroDaemonRpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,7 @@ class MoneroDaemonRpc extends MoneroDaemon {
else if (key === "credits") result.setCredits(BigInteger.parse(val))
else if (key === "status" || key === "untrusted") {} // handled elsewhere
else if (key === "top_hash") result.setTopBlockHash("" === val ? undefined : val);
else if (key === "tx_extra_too_big") result.setIsTxExtraTooBig(val);
else console.log("WARNING: ignoring unexpected field in submit tx hex result: " + key + ": " + val);
}
return result;
Expand Down
9 changes: 9 additions & 0 deletions src/main/js/daemon/model/MoneroSubmitTxResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ class MoneroSubmitTxResult {
this.state.topBlockHash = topBlockHash;
return this;
}

isTxExtraTooBig() {
return this.state.isTxExtraTooBig;
}

setIsTxExtraTooBig(isTxExtraTooBig) {
this.state.isTxExtraTooBig = isTxExtraTooBig;
return this;
}
}

module.exports = MoneroSubmitTxResult;
1 change: 1 addition & 0 deletions src/test/TestMoneroDaemonRpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,7 @@ function testSubmitTxResultGood(result) {
assert.equal(result.getSanityCheckFailed(), false);
TestUtils.testUnsignedBigInteger(result.getCredits(), false); // 0 credits
assert.equal(result.getTopBlockHash(), undefined);
assert.equal(result.isTxExtraTooBig(), false);
assert.equal(result.isGood(), true);
} catch (e) {
console.log("Submit result is not good: " + JSON.stringify(result));
Expand Down

0 comments on commit eb97bb2

Please sign in to comment.