Skip to content

Commit 3724cd3

Browse files
authored
Merge pull request #1210 from dev-protocol/remove-always-caller
Remove `always` wrapper
2 parents 96b0eab + 8b6b226 commit 3724cd3

File tree

26 files changed

+31
-48
lines changed

26 files changed

+31
-48
lines changed

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
"functional/no-return-void": "off"
3131
},
3232
"overrides": [
33+
{
34+
"files": ["**/index.ts"],
35+
"rules": {
36+
"functional/functional-parameters": "off"
37+
}
38+
},
3339
{
3440
"files": ["**/*.spec.ts"],
3541
"rules": {

lib/agent/fixtures/swap/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ export const createSwapContract =
5252
swapEthAndStakeDevCaller: createSwapEthAndStakeDevCaller(contract),
5353
swapEthAndStakeDevPolygonCaller:
5454
createSwapEthAndStakeDevPolygonCaller(contract),
55-
contract: always(contract),
55+
contract: () => contract,
5656
}
5757
}

lib/ethereum/allocator/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ContractRunner, ethers } from 'ethers'
22
import { allocatorAbi } from './abi'
33
import { createCalculateMaxRewardsPerBlockCaller } from './calculateMaxRewardsPerBlock'
4-
import { always } from 'ramda'
54

65
export type CreateAllocatorContract = {
76
readonly calculateMaxRewardsPerBlock: () => Promise<string>
@@ -15,6 +14,6 @@ export const createAllocatorContract =
1514
return {
1615
calculateMaxRewardsPerBlock:
1716
createCalculateMaxRewardsPerBlockCaller(contract),
18-
contract: always(contract),
17+
contract: () => contract,
1918
}
2019
}

lib/ethereum/dev/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { createAllowanceCaller } from '../../common/erc20/allowance'
1212
import { createDepositCaller } from './deposit'
1313
import { FallbackableOverrides } from '../../common/utils/execute'
1414
import { TransactionResponse } from '@ethersproject/abstract-provider'
15-
import { always } from 'ramda'
1615

1716
export type DevContract = {
1817
readonly totalSupply: () => Promise<string>
@@ -52,6 +51,6 @@ export const createDevContract =
5251
symbol: createSymbolCaller(contract),
5352
decimals: createDecimalsCaller(contract),
5453
deposit: createDepositCaller(contract),
55-
contract: always(contract),
54+
contract: () => contract,
5655
}
5756
}

lib/ethereum/lockup/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { createDepositToPositionCaller } from './depositToPosition'
1717
import { createMigrateToSTokensCaller } from './migrateToSTokens'
1818
import { FallbackableOverrides } from '../../common/utils/execute'
1919
import { TransactionResponse } from '@ethersproject/abstract-provider'
20-
import { always } from 'ramda'
2120

2221
export type LockupContract = {
2322
readonly getValue: (
@@ -101,6 +100,6 @@ export const createLockupContract =
101100
depositToProperty: createDepositToPropertyCaller(contract),
102101
depositToPosition: createDepositToPositionCaller(contract),
103102
migrateToSTokens: createMigrateToSTokensCaller(contract),
104-
contract: always(contract),
103+
contract: () => contract,
105104
}
106105
}

lib/ethereum/market-behavior/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ContractRunner, ethers } from 'ethers'
22
import { marketBehaviorAbi } from './abi'
33
import { createGetIdCaller } from './getId'
44
import { createGetMetricsCaller } from './getMetrics'
5-
import { always } from 'ramda'
65

76
export type CreateMarketBehaviorContract = {
87
readonly getId: (metricsAddress: string) => Promise<string>
@@ -23,6 +22,6 @@ export const createMarketBehaviorContract =
2322
return {
2423
getId: createGetIdCaller(contract),
2524
getMetrics: createGetMetricsCaller(contract),
26-
contract: always(contract),
25+
contract: () => contract,
2726
}
2827
}

lib/ethereum/market-factory/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { marketFactoryAbi } from './abi'
33
import { createCreateCaller } from './create'
44
import { FallbackableOverrides } from '../../common/utils/execute'
55
import { TransactionResponse } from '@ethersproject/abstract-provider'
6-
import { always } from 'ramda'
76

87
export type MarketFactoryContract = {
98
readonly create: (
@@ -23,6 +22,6 @@ export const createMarketFactoryContract =
2322
)
2423
return {
2524
create: createCreateCaller(contract),
26-
contract: always(contract),
25+
contract: () => contract,
2726
}
2827
}

lib/ethereum/metrics-group/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ContractRunner, ethers } from 'ethers'
22
import { metricsGroupAbi } from './abi'
33
import { createTotalAuthenticatedPropertiesCaller } from './totalAuthenticatedProperties'
4-
import { always } from 'ramda'
54
import { createTotalIssuedMetrics } from './totalIssuedMetrics'
65

76
export type CreateMetricsGroupContract = {
@@ -23,6 +22,6 @@ export const createMetricsGroupContract =
2322
totalAuthenticatedProperties:
2423
createTotalAuthenticatedPropertiesCaller(contract),
2524
totalIssuedMetrics: createTotalIssuedMetrics(contract),
26-
contract: always(contract),
25+
contract: () => contract,
2726
}
2827
}

lib/ethereum/metrics/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ContractRunner, ethers } from 'ethers'
22
import { metricsAbi } from './abi'
33
import { createPropertyCaller } from './property'
44
import { createMarketCaller } from './market'
5-
import { always } from 'ramda'
65

76
export type CreateMetricsContract = {
87
readonly property: () => Promise<string>
@@ -19,6 +18,6 @@ export const createMetricsContract =
1918
return {
2019
property: createPropertyCaller(contract),
2120
market: createMarketCaller(contract),
22-
contract: always(contract),
21+
contract: () => contract,
2322
}
2423
}

lib/ethereum/policy-factory/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { createCreateCaller } from './create'
44
import { createForceAttachCaller } from './forceAttach'
55
import { FallbackableOverrides } from '../../common/utils/execute'
66
import { TransactionResponse } from '@ethersproject/abstract-provider'
7-
import { always } from 'ramda'
87

98
export type PolicyFactoryContract = {
109
readonly create: (
@@ -33,6 +32,6 @@ export const createPolicyFactoryContract: CreatePolicyFactoryContract =
3332
return {
3433
create: createCreateCaller(contract),
3534
forceAttach: createForceAttachCaller(contract),
36-
contract: always(contract),
35+
contract: () => contract,
3736
}
3837
}

0 commit comments

Comments
 (0)