@@ -2176,15 +2176,15 @@ export class Wallet implements IWallet {
2176
2176
}
2177
2177
2178
2178
// Doing a sanity check for password here to avoid doing further work if we know it's wrong
2179
- const keychains = await this . getKeychainsAndValidatePassphrase ( {
2179
+ // Doing a sanity check for password here to avoid doing further work if we know it's wrong
2180
+ const keychainPromise = this . getKeychainsAndValidatePassphrase ( {
2180
2181
reqId : params . reqId ,
2181
2182
walletPassphrase : params . walletPassphrase ,
2182
2183
customSigningFunction : params . customSigningFunction ,
2183
2184
} ) ;
2184
2185
2185
2186
let txPrebuildQuery : Promise < PrebuildTransactionResult | string > ;
2186
2187
if ( isPrebuildTransactionResult ( params . prebuildTx ) && params . prebuildTx . buildParams ?. preview ) {
2187
- // If we prebuilt the txRequest with preview=true, then we should rebuild with preview=false to persist the request
2188
2188
txPrebuildQuery = this . prebuildTransaction ( {
2189
2189
...params ,
2190
2190
...{ ...params . prebuildTx . buildParams , preview : false } ,
@@ -2193,8 +2193,10 @@ export class Wallet implements IWallet {
2193
2193
txPrebuildQuery = params . prebuildTx ? Promise . resolve ( params . prebuildTx ) : this . prebuildTransaction ( params ) ;
2194
2194
}
2195
2195
2196
- // the prebuild can be overridden by providing an explicit tx
2197
- const txPrebuild = ( await txPrebuildQuery ) as PrebuildTransactionResult ;
2196
+ const [ keychains , txPrebuild ] = ( await Promise . all ( [ keychainPromise , txPrebuildQuery ] ) ) as [
2197
+ any ,
2198
+ PrebuildTransactionResult
2199
+ ] ;
2198
2200
2199
2201
try {
2200
2202
await this . baseCoin . verifyTransaction ( {
0 commit comments