Skip to content

Commit 98f91c6

Browse files
authored
Merge pull request #360 from algorandfoundation/fix-account-type
fix: correct the account type
2 parents 0611b81 + fa9382f commit 98f91c6

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

docs/code/modules/types_account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Account information at a given round.
6262
| `appsTotalExtraPages?` | `number` | The sum of all extra application program pages for this account. |
6363
| `appsTotalSchema?` | `ApplicationStateSchema` | (tsch) stores the sum of all of the local schemas and global schemas in this account. Note: the raw account uses `StateSchema` for this type. |
6464
| `assets?` | `AssetHolding`[] | Assets held by this account. |
65-
| `authAddress?` | `Address` | The address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the `RekeyTo` field. |
65+
| `authAddr?` | `Address` | The address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the `RekeyTo` field. |
6666
| `balance` | [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) | The balance of Algo currently held by the account. |
6767
| `createdApps?` | `Application`[] | Parameters of applications created by this account including app global data. |
6868
| `createdAssets?` | `Asset`[] | (apar) parameters of assets created by this account. Note: the raw account uses `map[int] -> Asset` for this type. |

src/types/account-manager.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import algosdk from 'algosdk'
22
import { v4 as uuid } from 'uuid'
33
import { beforeEach, describe, expect, test } from 'vitest'
4+
import { algo } from '../amount'
45
import { algorandFixture } from '../testing'
56

67
describe('AccountManager', () => {
@@ -42,4 +43,17 @@ describe('AccountManager', () => {
4243
expect(account.addr).toEqual(account2.addr)
4344
expect(account.account.sk).toEqual(account2.account.sk)
4445
}, 10e6)
46+
47+
test('Rekeyed account is retrievable', async () => {
48+
const { algorand, generateAccount } = localnet.context
49+
50+
const rekeyed = await generateAccount({ initialFunds: algo(1) })
51+
const rekeyTo = await generateAccount({ initialFunds: algo(0.1) })
52+
53+
await algorand.account.rekeyAccount(rekeyed.addr, rekeyTo)
54+
55+
const accountInfo = await algorand.account.getInformation(rekeyed.addr)
56+
expect(accountInfo.address.toString()).toBe(rekeyed.addr.toString())
57+
expect(accountInfo.authAddr!.toString()).toBe(rekeyTo.addr.toString())
58+
}, 10e6)
4559
})

src/types/account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export type AccountInformation = {
213213
* address of the current account is used. This field can be updated in any
214214
* transaction by setting the `RekeyTo` field.
215215
*/
216-
authAddress?: Address
216+
authAddr?: Address
217217

218218
/**
219219
* Parameters of applications created by this account including app global data.

0 commit comments

Comments
 (0)