Skip to content

Commit

Permalink
Fix from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Rey committed Aug 23, 2024
1 parent a7525df commit aa7d253
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeStatus } from 'src/generated/client'
import { NodeStatusInfo } from 'src/provider'
import { NodeStatus } from '../generated/client'
import { NodeStatusInfo } from '../provider'

export function formatNodeStatusObject(status: NodeStatus): NodeStatusInfo {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/provider/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ export type Provider = {
deploySC(params: DeploySCParams): Promise<SmartContract>
getOperationStatus(opId: string): Promise<OperationStatus>
getEvents(filter: EventFilter): Promise<SCEvent[]>
getStatus(): Promise<NodeStatusInfo>
getNodeStatus(): Promise<NodeStatusInfo>
}
4 changes: 2 additions & 2 deletions src/provider/web3Provider/web3Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
getAbsoluteExpirePeriod,
OperationManager,
} from '../../operation/operationManager'
import { formatNodeStatusObject } from '../../utils/formatObjects/nodeStatusInfo'
import { formatNodeStatusObject } from '../../client/formatObjects'

export class Web3Provider extends SCProvider implements Provider {
static fromRPCUrl(url: string, account: Account): Web3Provider {
Expand Down Expand Up @@ -206,7 +206,7 @@ export class Web3Provider extends SCProvider implements Provider {
return this.client.getEvents(filter)
}

public async getStatus(): Promise<NodeStatusInfo> {
public async getNodeStatus(): Promise<NodeStatusInfo> {

Check warning on line 209 in src/provider/web3Provider/web3Provider.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
const status = await this.client.status()
return formatNodeStatusObject(status)
}
Expand Down
1 change: 0 additions & 1 deletion src/utils/formatObjects/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export * from './isNode'
export * from './networks'
export * from './events'
export * from './maths'
export * from './formatObjects'
5 changes: 1 addition & 4 deletions test/integration/MRC20.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ describe('Token wrapper tests', () => {
const amount = 123_000_000n
let operation = await usdcContract.increaseAllowance(
'AU1wN8rn4SkwYSTDF3dHFY4U28KtsqKL1NnEjDZhHnHEy6cEQm53',
amount,
{
coins: Mas.fromString('0.1'),
}
amount
)
await operation.waitSpeculativeExecution()

Expand Down
2 changes: 1 addition & 1 deletion test/integration/events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('SC Event tests', () => {

test('poll transfer event from operationId', async () => {
const amount = 1_000n
const { lastSlot: currentSlot } = await provider.getStatus()
const { lastSlot: currentSlot } = await provider.getNodeStatus()

const operation = await usdcContract.transfer(
'AU1wN8rn4SkwYSTDF3dHFY4U28KtsqKL1NnEjDZhHnHEy6cEQm53',
Expand Down
2 changes: 1 addition & 1 deletion test/integration/provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Provider tests', () => {
})

test('Node Status', async () => {
const status = await provider.getStatus()
const status = await provider.getNodeStatus()
expect(status.config).toBeDefined()
expect(status.connectedNodes).toBeDefined()
expect(status.consensusStats).toBeDefined()
Expand Down

0 comments on commit aa7d253

Please sign in to comment.