Skip to content

Commit c31d241

Browse files
committed
rename Providerfees to ProviderFees
1 parent 45264e0 commit c31d241

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/components/core/compute/initialize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
isDataTokenTemplate4,
1313
isERC20Template4Active
1414
} from '../../../utils/asset.js'
15-
import { Providerfees } from '../utils/feesHandler.js'
15+
import { ProviderFees } from '../utils/feesHandler.js'
1616

1717
import { validateOrderTransaction } from '../utils/validateOrders.js'
1818
import { EncryptMethod } from '../../../@types/fileObject.js'
@@ -532,7 +532,7 @@ export class ComputeInitializeHandler extends CommandHandler {
532532
message: false
533533
}
534534
result.consumerAddress = env.consumerAddress
535-
const fees = new Providerfees(node)
535+
const fees = new ProviderFees(node)
536536
if ('transferTxId' in elem && elem.transferTxId) {
537537
// search for that compute env and see if it has access to dataset
538538
const paymentValidation = await validateOrderTransaction(

src/components/core/handler/downloadHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandHandler } from './handler.js'
22
import { MetadataStates, PROTOCOL_COMMANDS } from '../../../utils/constants.js'
33
import { P2PCommandResponse } from '../../../@types/OceanNode.js'
4-
import { Providerfees } from '../utils/feesHandler.js'
4+
import { ProviderFees } from '../utils/feesHandler.js'
55
import { FindDdoHandler } from './ddoHandler.js'
66
import crypto from 'crypto'
77
import { GENERIC_EMOJIS, LOG_LEVELS_STR } from '../../../utils/logging/Logger.js'
@@ -410,7 +410,7 @@ export class DownloadHandler extends CommandHandler {
410410
}
411411
}
412412
// 5. check that the provider fee transaction is valid
413-
const fees = new Providerfees(node)
413+
const fees = new ProviderFees(node)
414414
const validFee = await fees.verifyProviderFees(
415415
task.transferTxId,
416416
task.consumerAddress,

src/components/core/handler/feesHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandHandler } from './handler.js'
22
import { GetFeesCommand } from '../../../@types/commands.js'
33
import { P2PCommandResponse } from '../../../@types/OceanNode.js'
4-
import { Providerfees } from '../utils/feesHandler.js'
4+
import { ProviderFees } from '../utils/feesHandler.js'
55
import { Readable } from 'stream'
66
import { GENERIC_EMOJIS, LOG_LEVELS_STR } from '../../../utils/logging/Logger.js'
77
import { PROVIDER_LOGGER } from '../../../utils/logging/common.js'
@@ -100,7 +100,7 @@ export class FeesHandler extends CommandHandler {
100100
const nonceDB = (await this.getOceanNode().getDatabase()).nonce
101101
const nonceHandlerResponse = await getNonce(nonceDB, task.consumerAddress)
102102
const nonce = await streamToString(nonceHandlerResponse.stream as Readable)
103-
const feesClass = new Providerfees(this.getOceanNode())
103+
const feesClass = new ProviderFees(this.getOceanNode())
104104
try {
105105
const providerFee = await feesClass.createProviderFee(ddo, service, validUntil)
106106
if (providerFee) {

src/components/core/utils/feesHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
FeeTokens,
1313
ProviderFeeData,
1414
ProviderFeeValidation,
15-
ProviderFees
15+
ProviderFees as ProviderFeesResult
1616
} from '../../../@types/Fees'
1717
import { Service, DDOManager, Asset } from '@oceanprotocol/ddo-js'
1818
import { getDatatokenDecimals, verifyMessage } from '../../../utils/blockchain.js'
@@ -23,7 +23,7 @@ import ERC20Template from '@oceanprotocol/contracts/artifacts/contracts/template
2323
import { fetchEventFromTransaction } from '../../../utils/util.js'
2424
import { fetchTransactionReceipt } from './validateOrders.js'
2525

26-
export class Providerfees {
26+
export class ProviderFees {
2727
private node: OceanNode
2828

2929
constructor(_node: OceanNode) {
@@ -58,7 +58,7 @@ export class Providerfees {
5858
asset: Asset,
5959
service: Service,
6060
validUntil: number
61-
): Promise<ProviderFees> | undefined {
61+
): Promise<ProviderFeesResult> | undefined {
6262
// round for safety
6363
validUntil = Math.round(validUntil)
6464

src/test/integration/indexer.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import { QueryCommand } from '../../@types/commands.js'
4848
import { getConfiguration } from '../../utils/config.js'
4949
import { EncryptMethod } from '../../@types/fileObject.js'
5050
import { deleteIndexedMetadataIfExists } from '../../utils/asset.js'
51-
import { Providerfees } from '../../components/core/utils/feesHandler.js'
51+
import { ProviderFees } from '../../components/core/utils/feesHandler.js'
5252

5353
describe('********** Indexer stores a new metadata events and orders.', () => {
5454
let database: Database
@@ -412,7 +412,7 @@ describe('********** Indexer stores a new metadata events and orders.',
412412
paymentCollector?.toLowerCase() === publisherAddress?.toLowerCase(),
413413
'paymentCollector not correct'
414414
)
415-
const fees = new Providerfees(oceanNode)
415+
const fees = new ProviderFees(oceanNode)
416416
const feeData = await fees.createFee(
417417
resolvedDDO as DDO,
418418
0,
@@ -515,7 +515,7 @@ describe('********** Indexer stores a new metadata events and orders.',
515515

516516
it('should detect OrderReused event', async function () {
517517
this.timeout(DEFAULT_TEST_TIMEOUT * 2)
518-
const fees = new Providerfees(oceanNode)
518+
const fees = new ProviderFees(oceanNode)
519519
const feeData = await fees.createFee(
520520
resolvedDDO as DDO,
521521
0,

src/test/integration/operationsDashboard.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import { CollectFeesHandler } from '../../components/core/admin/collectFeesHandl
5656
import { KeyManager } from '../../components/KeyManager/index.js'
5757
import { BlockchainRegistry } from '../../components/BlockchainRegistry/index.js'
5858
import { createHashForSignature, safeSign } from '../utils/signature.js'
59-
import { Providerfees } from '../../components/core/utils/feesHandler.js'
59+
import { ProviderFees } from '../../components/core/utils/feesHandler.js'
6060

6161
describe('********** OperationsDashboard tests', () => {
6262
let config: OceanNodeConfig
@@ -155,7 +155,7 @@ describe('********** OperationsDashboard tests', () => {
155155
PROTOCOL_COMMANDS.COLLECT_FEES
156156
)
157157
let signature = await safeSign(adminWallet, messageHashBytes)
158-
const fees = new Providerfees(oceanNode)
158+
const fees = new ProviderFees(oceanNode)
159159
const collectFeesCommand: AdminCollectFeesCommand = {
160160
command: PROTOCOL_COMMANDS.COLLECT_FEES,
161161
tokenAddress: fees.getProviderFeeToken(DEVELOPMENT_CHAIN_ID),

0 commit comments

Comments
 (0)