-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add doc: When Operation Source Accounts differ from that of the Parent Transaction #1022 #1413
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Preview is available here: |
#1022