Skip to content

Commit b3409d2

Browse files
committed
chore: tweaks
1 parent 8c1d4eb commit b3409d2

File tree

3 files changed

+19
-26
lines changed

3 files changed

+19
-26
lines changed

src/tempo/Formatters.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,9 @@ export function formatTransactionRequest(
125125
account && 'accessKeyAddress' in account
126126
? account.accessKeyAddress
127127
: undefined
128-
const keyAuthorization = rpc.keyAuthorization
129-
? {
130-
...rpc.keyAuthorization,
131-
// FIXME(ox): remove once https://github.com/tempoxyz/tempo/pull/1683 is deployed.
132-
chainId:
133-
rpc.keyAuthorization.chainId === '0x' ||
134-
rpc.keyAuthorization.chainId === '0x0'
135-
? 0
136-
: parseInt(rpc.keyAuthorization.chainId || '0x0', 16),
137-
}
138-
: undefined
139128

140129
return {
141130
...rpc,
142-
...(keyAuthorization ? { keyAuthorization } : {}),
143131
...(keyData ? { keyData } : {}),
144132
...(keyId ? { keyId } : {}),
145133
...(keyType ? { keyType } : {}),

src/tempo/chainConfig.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ export const chainConfig = {
4848
}
4949

5050
request.nonceKey = (() => {
51-
if (typeof request.nonceKey !== 'undefined') return request.nonceKey
51+
if (
52+
typeof request.nonceKey !== 'undefined' &&
53+
request.nonceKey !== 'random'
54+
)
55+
return request.nonceKey
5256

5357
const address = request.account?.address ?? request.from
5458
if (!address) return undefined

test/src/tempo/config.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { Mnemonic } from 'ox'
22
import { generateMnemonic } from '../../../src/accounts/generateMnemonic.js'
33
import { english } from '../../../src/accounts/wordlists.js'
44
import { sendTransactionSync } from '../../../src/actions/index.js'
5-
import { tempoLocalnet, tempoTestnet } from '../../../src/chains/index.js'
5+
import {
6+
tempoDevnet,
7+
tempoLocalnet,
8+
tempoTestnet,
9+
} from '../../../src/chains/index.js'
610
import {
711
type Address,
812
type Chain,
@@ -41,7 +45,8 @@ export const addresses = {
4145
} as const
4246

4347
export const chain = (() => {
44-
if (nodeEnv === 'testnet' || nodeEnv === 'devnet') return tempoTestnet
48+
if (nodeEnv === 'devnet') return tempoDevnet
49+
if (nodeEnv === 'testnet') return tempoTestnet
4550
return tempoLocalnet
4651
})()
4752

@@ -267,17 +272,13 @@ export async function fundAddress(
267272
const { address } = parameters
268273
const account = accounts.at(0)!
269274
if (account.address === address) return
270-
await Promise.all(
271-
// fund pathUSD, alphaUSD
272-
[0n, 1n].map((feeToken) =>
273-
Actions.token.transferSync(client, {
274-
account,
275-
amount: parseUnits('10000', 6),
276-
to: address,
277-
token: feeToken,
278-
}),
279-
),
280-
)
275+
for (const token of [0n, 1n])
276+
await Actions.token.transferSync(client, {
277+
account,
278+
amount: parseUnits('10000', 6),
279+
to: address,
280+
token,
281+
})
281282
}
282283

283284
export declare namespace fundAddress {

0 commit comments

Comments
 (0)