Repository navigation
v11.2.0
-
NormalizeInnerTransactionno longer rewrites the transaction it is given (#157). The method stripsTxnSignature,SignersandLastLedgerSequenceand overwritesFee,SigningPubKeyandFlags. It did that to the caller's ownJsonObjectand returned that same instance, so anything a consumer held and passed in came back altered. It now normalises a copy and leaves the argument alone.- the two overloads no longer disagree.
NormalizeInnerTransaction(object)rewrote its argument when the runtime type happened to be aJsonObjectand did not when it was anything else - the same call, with aliasing decided by a type test the caller cannot see SignAsBatchPartdepended on the mutation, and not visibly. It normalises each inner transaction, hashes the results into the batch preimage, and finally encodesouterinto the blob - and the normalised fields reached that blob only because normalisation rewrote the objects living insideouter. The call site read as though it merely collected a list for the txIDs. It now writes the normalised transaction back explicitly, which is what the old code achieved by side effect- nothing pinned any of this. The batch fixture supplied inner transactions that already carried
Fee = "0",SigningPubKey = ""andtfInnerBatchTxn, so normalisation was a no-op on them: making the method return a copy left all 1215 unit tests green while the emitted blob carried inner transactions the signature never committed to. Both halves are now pinned - that the blob carries normalised inners, and that the signature covers a preimage built from them (#158) - a caller who relied on the old behaviour was relying on something the documentation denied until it was corrected in #156
- the two overloads no longer disagree.
-
A malformed
RawTransactionsentry is named instead of failing inside a converter (#160). An element that is not a JSON object was refused bySystem.Text.JsonasExpected StartObject tokenthrown fromDictionaryObjectConverter- the first thing a caller saw about a malformed batch, naming neither the field nor the position, while every other malformed input on this path answers with aValidationExceptionthat says what is wrong.GetBatchSignerAccounts, the gate every batch-signing path reaches before any XLS-56 check, now refuses it asRawTransactions[i] must be an object., and the same holds one level down forRawTransactions[i].RawTransaction.- an element is judged by what it serializes to, never by its runtime type. A
JsonArraybuilt throughAdd<T>holds aJsonValuerather than aJsonObjectand still writes a JSON object; testing the node type would have refused input the old code accepted, and would have accepted or rejected the same object depending on whether it arrived in aJsonArrayor aList<object> SignAsBatchPartno longer filters its inner-transaction loop onn is JsonObjecteither. That guard cannot fire - the gate above refuses such an element first, shown by mutation - but a silent skip is the wrong thing to leave behind, and every other malformed input in that loop is refused rather than droppedBatch.Validatecalled such an element null in its message when it was, for instance, a string. It now says what is actually wrong
- an element is judged by what it serializes to, never by its runtime type. A
-
GetBatchSignerAccountsno longer rewrites the batch it is asked to report on (#161). The method returns the root account and the accounts required to sign, and it also replacedRawTransactions[i].RawTransactionin the caller's own dictionary with a converted copy - theIEnumerablebranch aliases an element that is already aDictionary, so the assignment landed in the caller's object. It is the gate every batch-signing path reaches throughVerifyBatchSubmitter, so this happened on every signature.- the conversion is still made, for reading; only the store-back is gone. No consumer needed it: every reader of
RawTransactionworks from aJsonNodebuilt by re-serializing the transaction, not from the dictionary that was passed in - that the two representations sign identically is now pinned by a test of its own, since it is the property that makes dropping the store-back safe rather than merely tidy
- the conversion is still made, for reading; only the store-back is gone. No consumer needed it: every reader of