Skip to content

Commit

Permalink
Merge pull request #209 from algorandfoundation/fix/resource_pop_signing
Browse files Browse the repository at this point in the history
fix: transactions signed twice with resource population
  • Loading branch information
robdmoore authored Jan 21, 2024
2 parents c7c56d9 + 22f29b7 commit 664dd0b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 10 additions & 10 deletions docs/code/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ the estimated rate.

#### Defined in

[src/transaction.ts:684](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L684)
[src/transaction.ts:690](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L690)

___

Expand Down Expand Up @@ -405,7 +405,7 @@ Allows for control of fees on a `Transaction` or `SuggestedParams` object

#### Defined in

[src/transaction.ts:707](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L707)
[src/transaction.ts:713](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L713)

___

Expand Down Expand Up @@ -1477,7 +1477,7 @@ The array of transactions with signers

#### Defined in

[src/transaction.ts:739](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L739)
[src/transaction.ts:745](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L745)

___

Expand Down Expand Up @@ -1810,7 +1810,7 @@ The suggested transaction parameters

#### Defined in

[src/transaction.ts:730](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L730)
[src/transaction.ts:736](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L736)

___

Expand Down Expand Up @@ -2145,7 +2145,7 @@ The dryrun result

#### Defined in

[src/transaction.ts:535](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L535)
[src/transaction.ts:541](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L541)

___

Expand All @@ -2170,7 +2170,7 @@ The simulation result, which includes various details about how the transactions

#### Defined in

[src/transaction.ts:550](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L550)
[src/transaction.ts:556](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L556)

___

Expand Down Expand Up @@ -2276,7 +2276,7 @@ A new ATC with the resources packed into the transactions

#### Defined in

[src/transaction.ts:279](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L279)
[src/transaction.ts:285](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L285)

___

Expand Down Expand Up @@ -2436,7 +2436,7 @@ An object with transaction IDs, transactions, group transaction ID (`groupTransa

#### Defined in

[src/transaction.ts:410](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L410)
[src/transaction.ts:416](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L416)

___

Expand All @@ -2461,7 +2461,7 @@ An object with transaction IDs, transactions, group transaction ID (`groupTransa

#### Defined in

[src/transaction.ts:582](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L582)
[src/transaction.ts:588](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L588)

___

Expand Down Expand Up @@ -2740,4 +2740,4 @@ Throws an error if the transaction is not confirmed or rejected in the next `tim

#### Defined in

[src/transaction.ts:627](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L627)
[src/transaction.ts:633](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L633)
8 changes: 7 additions & 1 deletion src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,15 @@ async function getUnnamedAppCallResourcesAccessed(atc: algosdk.AtomicTransaction
const simReq = new algosdk.modelsv2.SimulateRequest({
txnGroups: [],
allowUnnamedResources: true,
allowEmptySignatures: true,
})

const emptySignerAtc = atc.clone()
emptySignerAtc['transactions'].forEach((t: algosdk.TransactionWithSigner) => {
t.signer = algosdk.makeEmptyTransactionSigner()
})

const result = await atc.simulate(algod, simReq)
const result = await emptySignerAtc.simulate(algod, simReq)

const groupResponse = result.simulateResponse.txnGroups[0]

Expand Down

0 comments on commit 664dd0b

Please sign in to comment.