Skip to content

Commit a280e87

Browse files
authored
refactor: [WT-1694] Corrected spelling of fufil to American spelling (#912)
1 parent 53025db commit a280e87

File tree

14 files changed

+146
-146
lines changed

14 files changed

+146
-146
lines changed

packages/checkout/sdk-sample-app/src/components/SmartCheckoutForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Checkout,
33
ERC20ItemRequirement,
44
ERC721ItemRequirement,
5-
FulfilmentTransaction,
5+
FulfillmentTransaction,
66
GasAmount,
77
GasTokenType,
88
ItemType,
@@ -27,7 +27,7 @@ interface SmartCheckoutProps {
2727
export const SmartCheckoutForm = ({ checkout, provider }: SmartCheckoutProps) => {
2828
const [itemRequirements, setItemRequirements] = useState<(NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement)[]>([]);
2929
const [itemRequirementsError, setItemRequirementsError] = useState<string>('');
30-
const [transactionOrGasAmount, setTransactionOrGasAmount] = useState<FulfilmentTransaction | GasAmount>(
30+
const [transactionOrGasAmount, setTransactionOrGasAmount] = useState<FulfillmentTransaction | GasAmount>(
3131
{
3232
type: TransactionOrGasType.GAS,
3333
gasToken: {
@@ -340,7 +340,7 @@ export const SmartCheckoutForm = ({ checkout, provider }: SmartCheckoutProps) =>
340340
<Option optionKey="erc721">
341341
<Option.Label>ERC721</Option.Label>
342342
</Option>
343-
</Select>
343+
</Select>
344344
</td>
345345
<td>
346346
<FormControl validationStatus={amountError ? 'error' : 'success'}>

packages/checkout/sdk/src/errors/checkoutError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export enum CheckoutErrorType {
3131
GET_ERC20_ALLOWANCE_ERROR = 'GET_ERC20_ALLOWANCE_ERROR',
3232
GET_ERC721_ALLOWANCE_ERROR = 'GET_ERC721_ALLOWANCE_ERROR',
3333
EXECUTE_APPROVAL_TRANSACTION_ERROR = 'EXECUTE_APPROVAL_TRANSACTION_ERROR',
34-
EXECUTE_FULFILMENT_TRANSACTION_ERROR = 'EXECUTE_FULFILMENT_TRANSACTION_ERROR',
34+
EXECUTE_FULFILLMENT_TRANSACTION_ERROR = 'EXECUTE_FULFILLMENT_TRANSACTION_ERROR',
3535
SIGN_MESSAGE_ERROR = 'SIGN_MESSAGE_ERROR',
3636
BRIDGE_GAS_ESTIMATE_ERROR = 'BRIDGE_GAS_ESTIMATE_ERROR',
3737
ORDER_FEE_ERROR = 'ORDER_FEE_ERROR',

packages/checkout/sdk/src/smartCheckout/actions/getUnsignedActions.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PopulatedTransaction, TypedDataDomain } from 'ethers';
55
import {
66
getUnsignedERC20ApprovalTransactions,
77
getUnsignedERC721Transactions,
8-
getUnsignedFulfilmentTransactions,
8+
getUnsignedFulfillmentTransactions,
99
getUnsignedMessage,
1010
} from './getUnsignedActions';
1111

@@ -55,7 +55,7 @@ describe('getUnsignedActions', () => {
5555

5656
await expect(getUnsignedERC721Transactions(actions)).resolves.toEqual({
5757
approvalTransactions: [{ from: '0xAPPROVAL1' }, { from: '0xAPPROVAL2' }],
58-
fulfilmentTransactions: [{ from: '0xTRANSACTION1' }, { from: '0xTRANSACTION2' }],
58+
fulfillmentTransactions: [{ from: '0xTRANSACTION1' }, { from: '0xTRANSACTION2' }],
5959
});
6060
});
6161

@@ -64,7 +64,7 @@ describe('getUnsignedActions', () => {
6464

6565
await expect(getUnsignedERC721Transactions(actions)).resolves.toEqual({
6666
approvalTransactions: [],
67-
fulfilmentTransactions: [],
67+
fulfillmentTransactions: [],
6868
});
6969
});
7070
});
@@ -100,8 +100,8 @@ describe('getUnsignedActions', () => {
100100
});
101101
});
102102

103-
describe('getUnsignedFulfilmentTransactions', () => {
104-
it('should get the unsigned fulfil transactions', async () => {
103+
describe('getUnsignedFulfillmentTransactions', () => {
104+
it('should get the unsigned fulfill transactions', async () => {
105105
const actions: Action[] = [
106106
{
107107
type: ActionType.TRANSACTION,
@@ -120,14 +120,14 @@ describe('getUnsignedActions', () => {
120120
},
121121
];
122122

123-
await expect(getUnsignedFulfilmentTransactions(actions)).resolves
123+
await expect(getUnsignedFulfillmentTransactions(actions)).resolves
124124
.toEqual([{ from: '0xTRANSACTION1' }, { from: '0xTRANSACTION2' }]);
125125
});
126126

127127
it('should return an empty arrays if no transactions', async () => {
128128
const actions: Action[] = [];
129129

130-
await expect(getUnsignedFulfilmentTransactions(actions)).resolves.toEqual([]);
130+
await expect(getUnsignedFulfillmentTransactions(actions)).resolves.toEqual([]);
131131
});
132132
});
133133

packages/checkout/sdk/src/smartCheckout/actions/getUnsignedActions.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ export const getUnsignedERC721Transactions = async (
1111
actions: Action[],
1212
): Promise<UnsignedTransactions> => {
1313
let approvalTransactions: TransactionRequest[] = [];
14-
let fulfilmentTransactions: TransactionRequest[] = [];
14+
let fulfillmentTransactions: TransactionRequest[] = [];
1515

1616
const approvalPromises: Promise<TransactionRequest>[] = [];
17-
const fulfilmentPromises: Promise<TransactionRequest>[] = [];
17+
const fulfillmentPromises: Promise<TransactionRequest>[] = [];
1818
for (const action of actions) {
1919
if (action.type !== ActionType.TRANSACTION) continue;
2020
if (action.purpose === TransactionPurpose.APPROVAL) {
2121
approvalPromises.push(action.buildTransaction());
2222
}
2323
if (action.purpose === TransactionPurpose.FULFILL_ORDER) {
24-
fulfilmentPromises.push(action.buildTransaction());
24+
fulfillmentPromises.push(action.buildTransaction());
2525
}
2626
}
2727
approvalTransactions = await Promise.all(approvalPromises);
28-
fulfilmentTransactions = await Promise.all(fulfilmentPromises);
28+
fulfillmentTransactions = await Promise.all(fulfillmentPromises);
2929

3030
return {
3131
approvalTransactions,
32-
fulfilmentTransactions,
32+
fulfillmentTransactions,
3333
};
3434
};
3535

@@ -50,21 +50,21 @@ export const getUnsignedERC20ApprovalTransactions = async (
5050
return approvalTransactions;
5151
};
5252

53-
export const getUnsignedFulfilmentTransactions = async (
53+
export const getUnsignedFulfillmentTransactions = async (
5454
actions: Action[],
5555
): Promise<TransactionRequest[]> => {
56-
let fulfilmentTransactions: TransactionRequest[] = [];
56+
let fulfillmentTransactions: TransactionRequest[] = [];
5757

58-
const fulfilmentPromises: Promise<TransactionRequest>[] = [];
58+
const fulfillmentPromises: Promise<TransactionRequest>[] = [];
5959
for (const action of actions) {
6060
if (action.type !== ActionType.TRANSACTION) continue;
6161
if (action.purpose === TransactionPurpose.FULFILL_ORDER) {
62-
fulfilmentPromises.push(action.buildTransaction());
62+
fulfillmentPromises.push(action.buildTransaction());
6363
}
6464
}
65-
fulfilmentTransactions = await Promise.all(fulfilmentPromises);
65+
fulfillmentTransactions = await Promise.all(fulfillmentPromises);
6666

67-
return fulfilmentTransactions;
67+
return fulfillmentTransactions;
6868
};
6969

7070
export const getUnsignedMessage = (

packages/checkout/sdk/src/smartCheckout/actions/signActions.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable no-underscore-dangle */
33
import { TransactionRequest, Web3Provider } from '@ethersproject/providers';
44
import { TypedDataDomain } from 'ethers';
5-
import { signApprovalTransactions, signFulfilmentTransactions, signMessage } from './signActions';
5+
import { signApprovalTransactions, signFulfillmentTransactions, signMessage } from './signActions';
66
import { CheckoutErrorType } from '../../errors';
77
import { SignTransactionStatusType, UnsignedMessage } from './types';
88

@@ -108,8 +108,8 @@ describe('signActions', () => {
108108
});
109109
});
110110

111-
describe('signFulfilmentTransactions', () => {
112-
it('should sign fulfilment transactions', async () => {
111+
describe('signFulfillmentTransactions', () => {
112+
it('should sign fulfillment transactions', async () => {
113113
mockProvider = {
114114
getSigner: jest.fn().mockReturnValue({
115115
sendTransaction: jest.fn().mockResolvedValue({
@@ -123,22 +123,22 @@ describe('signActions', () => {
123123
const approvalTransactions: TransactionRequest[] = [
124124
{
125125
to: '0x123',
126-
data: '0xFULFILMENT1',
126+
data: '0xFULFILLMENT1',
127127
},
128128
{
129129
to: '0x123',
130-
data: '0xFULFILMENT2',
130+
data: '0xFULFILLMENT2',
131131
},
132132
];
133133

134-
await signFulfilmentTransactions(mockProvider, approvalTransactions);
134+
await signFulfillmentTransactions(mockProvider, approvalTransactions);
135135
expect(mockProvider.getSigner().sendTransaction).toHaveBeenCalledTimes(2);
136136
expect(mockProvider.getSigner().sendTransaction).toHaveBeenCalledWith({
137-
data: '0xFULFILMENT1',
137+
data: '0xFULFILLMENT1',
138138
to: '0x123',
139139
});
140140
expect(mockProvider.getSigner().sendTransaction).toHaveBeenCalledWith({
141-
data: '0xFULFILMENT2',
141+
data: '0xFULFILLMENT2',
142142
to: '0x123',
143143
});
144144
});
@@ -155,32 +155,32 @@ describe('signActions', () => {
155155
}),
156156
} as unknown as Web3Provider;
157157

158-
const fulfilmentTransactions: TransactionRequest[] = [
158+
const fulfillmentTransactions: TransactionRequest[] = [
159159
{
160160
to: '0x123',
161161
data: '0xAPPROVAL1',
162162
},
163163
];
164164

165-
const result = await signFulfilmentTransactions(mockProvider, fulfilmentTransactions);
165+
const result = await signFulfillmentTransactions(mockProvider, fulfillmentTransactions);
166166
expect(result).toEqual({
167167
type: SignTransactionStatusType.FAILED,
168168
transactionHash: '0xHASH',
169-
reason: 'Fulfilment transaction failed and was reverted',
169+
reason: 'Fulfillment transaction failed and was reverted',
170170
});
171171
});
172172

173-
it('should throw error when sending the fulfilment transaction errors', async () => {
173+
it('should throw error when sending the fulfillment transaction errors', async () => {
174174
mockProvider = {
175175
getSigner: jest.fn().mockReturnValue({
176-
sendTransaction: jest.fn().mockRejectedValue(new Error('fulfilment error')),
176+
sendTransaction: jest.fn().mockRejectedValue(new Error('fulfillment error')),
177177
}),
178178
} as unknown as Web3Provider;
179179

180180
const approvalTransactions: TransactionRequest[] = [
181181
{
182182
to: '0x123',
183-
data: '0xFULFILMENT1',
183+
data: '0xFULFILLMENT1',
184184
},
185185
];
186186

@@ -189,17 +189,17 @@ describe('signActions', () => {
189189
let data;
190190

191191
try {
192-
await signFulfilmentTransactions(mockProvider, approvalTransactions);
192+
await signFulfillmentTransactions(mockProvider, approvalTransactions);
193193
} catch (err: any) {
194194
message = err.message;
195195
type = err.type;
196196
data = err.data;
197197
}
198198

199-
expect(message).toEqual('An error occurred while executing the fulfilment transaction');
200-
expect(type).toEqual(CheckoutErrorType.EXECUTE_FULFILMENT_TRANSACTION_ERROR);
199+
expect(message).toEqual('An error occurred while executing the fulfillment transaction');
200+
expect(type).toEqual(CheckoutErrorType.EXECUTE_FULFILLMENT_TRANSACTION_ERROR);
201201
expect(data).toEqual({
202-
message: 'fulfilment error',
202+
message: 'fulfillment error',
203203
});
204204
});
205205
});

packages/checkout/sdk/src/smartCheckout/actions/signActions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ export const signApprovalTransactions = async (
4444
};
4545
};
4646

47-
export const signFulfilmentTransactions = async (
47+
export const signFulfillmentTransactions = async (
4848
provider: Web3Provider,
49-
fulfilmentTransactions: TransactionRequest[],
49+
fulfillmentTransactions: TransactionRequest[],
5050
): Promise<SignTransactionResult> => {
5151
let receipts: TransactionReceipt[] = [];
5252

5353
try {
54-
const response = await Promise.all(fulfilmentTransactions.map(
54+
const response = await Promise.all(fulfillmentTransactions.map(
5555
(transaction) => provider.getSigner().sendTransaction(transaction),
5656
));
5757
receipts = await Promise.all(response.map((transaction) => transaction.wait()));
5858
} catch (err: any) {
5959
throw new CheckoutError(
60-
'An error occurred while executing the fulfilment transaction',
61-
CheckoutErrorType.EXECUTE_FULFILMENT_TRANSACTION_ERROR,
60+
'An error occurred while executing the fulfillment transaction',
61+
CheckoutErrorType.EXECUTE_FULFILLMENT_TRANSACTION_ERROR,
6262
{
6363
message: err.message,
6464
},
@@ -70,7 +70,7 @@ export const signFulfilmentTransactions = async (
7070
return {
7171
type: SignTransactionStatusType.FAILED,
7272
transactionHash: receipt.transactionHash,
73-
reason: 'Fulfilment transaction failed and was reverted',
73+
reason: 'Fulfillment transaction failed and was reverted',
7474
};
7575
}
7676
}

packages/checkout/sdk/src/smartCheckout/actions/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TypedDataDomain, TypedDataField } from 'ethers';
33

44
export type UnsignedTransactions = {
55
approvalTransactions: TransactionRequest[];
6-
fulfilmentTransactions: TransactionRequest[];
6+
fulfillmentTransactions: TransactionRequest[];
77
};
88

99
export type UnsignedMessage = {

0 commit comments

Comments
 (0)