Skip to content

Commit 750f938

Browse files
add missing await
1 parent 0151e06 commit 750f938

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@
6969
"semver": "https://github.com/RequestNetwork/requestNetwork/security/dependabot/197",
7070
"json-schema": "https://github.com/RequestNetwork/requestNetwork/security/dependabot/51",
7171
"json5": "https://github.com/RequestNetwork/requestNetwork/security/dependabot/165"
72-
}
72+
},
73+
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
7374
}

packages/payment-processor/src/payment/erc-20-private-payment-hinkal.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { Contract, ContractTransaction, Signer, BigNumberish, providers, BigNumber } from 'ethers';
1+
import { BigNumber, BigNumberish, Contract, ContractTransaction, providers, Signer } from 'ethers';
22
import { erc20FeeProxyArtifact } from '@requestnetwork/smart-contracts';
33
import {
4+
ERC20__factory,
45
ERC20FeeProxy__factory,
56
ERC20Proxy__factory,
6-
ERC20__factory,
77
} from '@requestnetwork/smart-contracts/types';
88
import { ClientTypes, ExtensionTypes } from '@requestnetwork/types';
99
import { Erc20PaymentNetwork, getPaymentNetworkExtension } from '@requestnetwork/payment-detection';
1010
import { EvmChains } from '@requestnetwork/currency';
1111
import {
1212
getAmountToPay,
1313
getProvider,
14+
getProxyAddress,
1415
getRequestPaymentValues,
1516
getSigner,
16-
validateRequest,
1717
validateErc20FeeProxyRequest,
18-
getProxyAddress,
18+
validateRequest,
1919
} from './utils';
2020
import { IPreparedPrivateTransaction } from './prepared-transaction';
2121

@@ -85,10 +85,8 @@ export async function payErc20ProxyRequestFromHinkalShieldedAddress(
8585
const signer = getSigner(signerOrProvider);
8686
const hinkalObject = await addToHinkalStore(signer);
8787

88-
const { amountToPay, tokenAddress, ops } = prepareErc20ProxyPaymentFromHinkalShieldedAddress(
89-
request,
90-
amount,
91-
);
88+
const { amountToPay, tokenAddress, ops } =
89+
await prepareErc20ProxyPaymentFromHinkalShieldedAddress(request, amount);
9290

9391
return hinkalObject.actionPrivateWallet(
9492
[tokenAddress],
@@ -114,11 +112,8 @@ export async function payErc20FeeProxyRequestFromHinkalShieldedAddress(
114112
const signer = getSigner(signerOrProvider);
115113
const hinkalObject = await addToHinkalStore(signer);
116114

117-
const { amountToPay, tokenAddress, ops } = prepareErc20FeeProxyPaymentFromHinkalShieldedAddress(
118-
request,
119-
amount,
120-
feeAmount,
121-
);
115+
const { amountToPay, tokenAddress, ops } =
116+
await prepareErc20FeeProxyPaymentFromHinkalShieldedAddress(request, amount, feeAmount);
122117

123118
return hinkalObject.actionPrivateWallet(
124119
[tokenAddress],
@@ -133,10 +128,10 @@ export async function payErc20FeeProxyRequestFromHinkalShieldedAddress(
133128
* @param request request to pay
134129
* @param amount optionally, the amount to pay. Defaults to remaining amount of the request.
135130
*/
136-
export function prepareErc20ProxyPaymentFromHinkalShieldedAddress(
131+
export async function prepareErc20ProxyPaymentFromHinkalShieldedAddress(
137132
request: ClientTypes.IRequestData,
138133
amount?: BigNumberish,
139-
): IPreparedPrivateTransaction {
134+
): Promise<IPreparedPrivateTransaction> {
140135
validateRequest(request, ExtensionTypes.PAYMENT_NETWORK_ID.ERC20_PROXY_CONTRACT);
141136

142137
const { value: tokenAddress } = request.currencyInfo;
@@ -152,7 +147,6 @@ export function prepareErc20ProxyPaymentFromHinkalShieldedAddress(
152147
const amountToPay = getAmountToPay(request, amount);
153148
const { emporiumOp } = await import('@hinkal/common');
154149

155-
156150
const ops = [
157151
emporiumOp(tokenContract, 'approve', [proxyContract.address, amountToPay]),
158152
emporiumOp(proxyContract, 'transferFromWithReference', [
@@ -176,11 +170,11 @@ export function prepareErc20ProxyPaymentFromHinkalShieldedAddress(
176170
* @param amount optionally, the amount to pay. Defaults to remaining amount of the request.
177171
* @param feeAmountOverride optionally, the fee amount to pay. Defaults to the fee amount of the request.
178172
*/
179-
export function prepareErc20FeeProxyPaymentFromHinkalShieldedAddress(
173+
export async function prepareErc20FeeProxyPaymentFromHinkalShieldedAddress(
180174
request: ClientTypes.IRequestData,
181175
amount?: BigNumberish,
182176
feeAmountOverride?: BigNumberish,
183-
): IPreparedPrivateTransaction {
177+
): Promise<IPreparedPrivateTransaction> {
184178
validateErc20FeeProxyRequest(request, amount, feeAmountOverride);
185179

186180
const { value: tokenAddress, network } = request.currencyInfo;

0 commit comments

Comments
 (0)