[Regression, 0.11, important] Inconsistent handling of homeDomain in Transaction object
See original GitHub issueSummary
0.11 seems to have introduced a regression were tx.operations[x].homeDomain is set to null
instead of undefined
when not defined. When this parameter is set to an empty string (to clear it), tx.operations[x].homeDomain is set to null
as well. This introduce a confusion that could lead to a wrong interpretation of the transaction purpose, hence the important tag.
Expected behavior
The property at tx.operations[x].homeDomain
should be set to undefined
if it was not set among the setOptions operation options as for any other parameter. If the parameter were ‘’, it should properly reflect as well.
Reproduce
const StellarSdk = require('stellar-sdk')
const keypair = StellarSdk.Keypair.random()
const account = new StellarSdk.Account(keypair.publicKey(), '0')
// First operation do nothing.
const tx1 = new StellarSdk.TransactionBuilder(account)
.addOperation(StellarSdk.Operation.setOptions({}))
.build()
// Second operation unset homeDomain
const tx2 = new StellarSdk.TransactionBuilder(account)
.addOperation(StellarSdk.Operation.setOptions({ homeDomain: ''}))
.build()
// Both operations set tx.operations[0].homeDomain to `null`.
console.log(tx1.operations[0].homeDomain)
console.log(tx2.operations[0].homeDomain)
// However the `tx` tree remains consistent (first: undefined, second: '')
console.log(tx1.tx._attributes.operations[0]._attributes.body._value._attributes.homeDomain)
console.log(tx2.tx._attributes.operations[0]._attributes.body._value._attributes.homeDomain)
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Feuille1 - PLOS
RNA was extracted after 48 hours of treatment using Tri-reagent. ... Regression analysis of calculated GFR’s from 1 to 36 months yielded a...
Read more >Languages | Free Full-Text | Gender in Unilingual and Mixed ... - MDPI
This study explores how bilingual speakers juggle languages with conflicting features, with a specific focus on gender in nominal constructions. We study ...
Read more >Chapter 9: Risk Factors for Non-Insulin-Dependent Diabetes
This review of the risk factors for NIDDM summarizes findings related to the epidemiology and natural his- tory of the disease. Risk factors...
Read more >Searching Genome-wide Disease Association Through SNP ...
The logistic regression model with both main effect. (marginal effect) terms and interaction terms, i.e., the full model has the following ...
Read more >physically consistent manner: Topics by Science.gov
Testing this questionnaire in non-symptomatic employees and comparing its performance with objective assessments of physical workload are important next ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, you are right. Fix ready in https://github.com/stellar/js-stellar-base/pull/144.
Good point, changed.