Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: update numberOfAddresses to numberOfAccounts
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Dec 14, 2022
1 parent 96fd218 commit a8b5433
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions lib/IO/request-items/one-time-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type OneTimeAccounts = {
response: OneTimeAccountsWithoutProofOfOwnershipResponseItem
}
method: {
input: { numberOfAddresses?: number }
input: { numberOfAccounts?: number }
output: {
oneTimeAccounts: Account[]
}
Expand All @@ -25,7 +25,7 @@ export type OneTimeAccounts = {
response: OneTimeAccountsWithProofOfOwnershipResponseItem
}
method: {
input: { numberOfAddresses?: number }
input: { numberOfAccounts?: number }
output: {
oneTimeAccounts: AccountWithProofOfOwnership[]
}
Expand All @@ -40,21 +40,21 @@ type NotAllowedKeys = Partial<{

export const oneTimeAccounts = {
withoutProofOfOwnership:
(numberOfAddresses?: number) =>
(numberOfAccounts?: number) =>
<I>(input: I extends NotAllowedKeys ? never : I) => ({
...input,
oneTimeAccountsWithoutProofOfOwnership: {
requiresProofOfOwnership: false,
numberOfAddresses,
numberOfAccounts,
},
}),
withProofOfOwnership:
(numberOfAddresses?: number) =>
(numberOfAccounts?: number) =>
<I>(input: I extends NotAllowedKeys ? never : I) => ({
...input,
oneTimeAccountsWithProofOfOwnership: {
requiresProofOfOwnership: true,
numberOfAddresses,
numberOfAccounts,
},
}),
}
12 changes: 6 additions & 6 deletions lib/IO/request-items/ongoing-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type OngoingAccounts = {
response: OngoingAccountsResponseItem
}
method: {
input: { numberOfAddresses?: number }
input: { numberOfAccounts?: number }
output: { ongoingAccounts: Account[] }
}
}
Expand All @@ -22,7 +22,7 @@ export type OngoingAccounts = {
response: OngoingAccountsResponseItem
}
method: {
input: { numberOfAddresses?: number }
input: { numberOfAccounts?: number }
output: { ongoingAccounts: AccountWithProofOfOwnership[] }
}
}
Expand All @@ -40,21 +40,21 @@ type NotAllowedKeys = Partial<{

export const ongoingAccounts = {
withoutProofOfOwnership:
(numberOfAddresses?: number) =>
(numberOfAccounts?: number) =>
<I extends RequiredKeys>(input: I extends NotAllowedKeys ? never : I) => ({
...input,
ongoingAccountsWithoutProofOfOwnership: {
requiresProofOfOwnership: false,
numberOfAddresses,
numberOfAccounts,
},
}),
withProofOfOwnership:
(numberOfAddresses?: number) =>
(numberOfAccounts?: number) =>
<I extends RequiredKeys>(input: I extends NotAllowedKeys ? never : I) => ({
...input,
ongoingAccountsWithProofOfOwnership: {
requiresProofOfOwnership: true,
numberOfAddresses,
numberOfAccounts,
},
}),
}
8 changes: 4 additions & 4 deletions lib/__tests__/transform-method-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('transformMethodInput', () => {
expected: {
requestType: RequestTypeSchema.oneTimeAccountsRead.value,
requiresProofOfOwnership: false,
numberOfAddresses: 3,
numberOfAccounts: 3,
},
},
{
Expand All @@ -35,7 +35,7 @@ describe('transformMethodInput', () => {
expected: {
requestType: RequestTypeSchema.oneTimeAccountsRead.value,
requiresProofOfOwnership: true,
numberOfAddresses: 1,
numberOfAccounts: 1,
},
},
].forEach((testItem) => {
Expand All @@ -60,7 +60,7 @@ describe('transformMethodInput', () => {
expected: {
requestType: RequestTypeSchema.ongoingAccountsRead.value,
requiresProofOfOwnership: false,
numberOfAddresses: 3,
numberOfAccounts: 3,
},
},
{
Expand All @@ -75,7 +75,7 @@ describe('transformMethodInput', () => {
expected: {
requestType: RequestTypeSchema.ongoingAccountsRead.value,
requiresProofOfOwnership: true,
numberOfAddresses: 1,
numberOfAccounts: 1,
},
},
].forEach((testItem) => {
Expand Down

0 comments on commit a8b5433

Please sign in to comment.