Add doc: When Operation Source Accounts differ from that of the Parent Transaction #1022#1413
Add doc: When Operation Source Accounts differ from that of the Parent Transaction #1022#1413anataliocs wants to merge 3 commits intomainfrom
Conversation
ElliotFriend
left a comment
There was a problem hiding this comment.
great start! left some notes throughout.
| sidebar_position: 40 | ||
| --- | ||
|
|
||
| # When Operation Source Accounts differ from that of the Parent Transaction |
There was a problem hiding this comment.
on the markdown side of things, having this "top-level" single-# heading is redundant if it's the same as the title.
| --- | ||
| title: "When Operation Source Accounts differ from that of the Parent Transaction" | ||
| sidebar_label: Unique Source Accounts for Operations | ||
| description: "Learn" |
There was a problem hiding this comment.
This seems a little vague for a description? were you meaning for this to be "Learn" or was it a placeholder maybe?
| 1. Operations that affect more than one account | ||
| 2. Operations with a high threshold weight |
There was a problem hiding this comment.
It would really be more like Transactions that ... and Transactions with ... here
|
|
||
| If a transaction has operations with multiple source accounts, it will require the source account signature for each operation. | ||
|
|
||
| One case where this happens is with specialized transactions such as [Sponsored Reserves](../../encyclopedia/transactions-specialized/sponsored-reserves) where a sponsoring account agrees to pay the base reserves for a sponsored account. |
There was a problem hiding this comment.
| One case where this happens is with specialized transactions such as [Sponsored Reserves](../../encyclopedia/transactions-specialized/sponsored-reserves) where a sponsoring account agrees to pay the base reserves for a sponsored account. | |
| One case where this happens is with specialized transactions such as [Sponsored Reserves](../../encyclopedia/transactions-specialized/sponsored-reserves.mdx) where a sponsoring account agrees to pay the base reserves for a sponsored account. |
|
|
||
| ## Operations that Affect multiple Accounts | ||
|
|
||
| If a transaction has operations with multiple source accounts, it will require the source account signature for each operation. |
There was a problem hiding this comment.
this could be clearer. it reads a little like a single operation could have multiple source accounts attached to it. and signature for each operation sounds like every operation has to be signed. the transaction requires a valid signature from all source accounts present in the tx and/or the operations.
| // 2. Both S1 and S2 sponsor trustlines for Account A for different assets. | ||
| // | ||
| let aAccount = await server.loadAccount(A.publicKey()); | ||
| let tx = new TransactionBuilder(aAccount, { fee: BASE_FEE }) |
There was a problem hiding this comment.
you'll need the network passphrase in the tx builder options, too
| }), | ||
| ) | ||
| .addOperation(Operation.endSponsoringFutureReserves({})) | ||
| .setNetworkPassphrase(Networks.TESTNET) |
There was a problem hiding this comment.
oh, neat! i didn't know there was a .setNetworkPassphrase method... learned something new!
| let txResponse = await server.submitTransaction(tx); | ||
| ``` | ||
|
|
||
| Learn more about [Sponsored Reserves here](../../encyclopedia/transactions-specialized/sponsored-reserves). |
There was a problem hiding this comment.
| Learn more about [Sponsored Reserves here](../../encyclopedia/transactions-specialized/sponsored-reserves). | |
| Learn more about [Sponsored Reserves here](../../encyclopedia/transactions-specialized/sponsored-reserves.mdx). |
|
|
||
| Learn more about [Sponsored Reserves here](../../encyclopedia/transactions-specialized/sponsored-reserves). | ||
|
|
||
| ## Operations with a High Threshold Weight |
There was a problem hiding this comment.
this part is less about the operation having a high threshold. by default, every account has equal low/med/high threshold weights, and the master signer can sign for any of them. it's more about the account having some kind of multisig scheme set up. i think this section could be revised to make that dynamic more of the focus
|
|
||
| ```ts | ||
| // | ||
| // 2. Both S1 and S2 sponsor trustlines for Account A for different assets. |
There was a problem hiding this comment.
Is this meant to be numbered as 2.? seems a bit out of place
|
In general, I wonder if the second example is a relevant scenario in which you would use a different source account for operations within a transaction. For high threshold operations, you would be more concerned about the signatures of the transaction (multisig) rather than different operation source accounts. Unless I'm missing something here! |
|
Also, not sure if this should go in the sidebar like this. It kind of reads more like a how-to guide? We should maybe move it into Stellar Basics or something and then link to it from the Operations and Transactions section. |
#1022