Skip to content

Commit

Permalink
use StreamRegistry ABI and type from npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
teogeb committed Oct 2, 2024
1 parent b6a9ea1 commit 5ddee47
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 2,649 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"devDependencies": {
"@inquirer/testing": "^2.1.34",
"@streamr/network-contracts-ethers6": "^7.1.4",
"@streamr/network-contracts": "^8.2.0",
"@streamr/test-utils": "101.1.2",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Operator } from '@streamr/network-contracts-ethers6'
import type { Operator } from '@streamr/network-contracts'
import {
ProxyDirection,
StreamPermission,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Operator, StreamrConfig, streamrConfigABI } from '@streamr/network-contracts-ethers6'
import { Operator, StreamrConfig, streamrConfigABI } from '@streamr/network-contracts'
import {
SetupOperatorContractOpts,
_operatorContractUtils,
Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/smoke/inspect.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config as CHAIN_CONFIG } from '@streamr/config'
import { StreamrConfig, streamrConfigABI } from '@streamr/network-contracts-ethers6'
import { StreamrConfig, streamrConfigABI } from '@streamr/network-contracts'
import { _operatorContractUtils } from '@streamr/sdk'
import { fetchPrivateKeyWithGas } from '@streamr/test-utils'
import { Logger, StreamID, TheGraphClient, wait, waitForCondition } from '@streamr/utils'
Expand Down
4 changes: 2 additions & 2 deletions packages/node/test/smoke/profit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { config as CHAIN_CONFIG } from '@streamr/config'
import type { Operator, Sponsorship } from '@streamr/network-contracts-ethers6'
import { StreamrConfig, streamrConfigABI } from '@streamr/network-contracts-ethers6'
import type { Operator, Sponsorship } from '@streamr/network-contracts'
import { StreamrConfig, streamrConfigABI } from '@streamr/network-contracts'
import { _operatorContractUtils } from '@streamr/sdk'
import { fetchPrivateKeyWithGas } from '@streamr/test-utils'
import { waitForCondition } from '@streamr/utils'
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@protobuf-ts/runtime-rpc": "^2.8.2",
"@streamr/config": "^5.3.13",
"@streamr/dht": "101.1.2",
"@streamr/network-contracts": "^8.2.0",
"@streamr/proto-rpc": "101.1.2",
"@streamr/trackerless-network": "101.1.2",
"@streamr/utils": "101.1.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/sdk/src/contracts/StreamRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { RpcProviderSource } from '../RpcProviderSource'
import { Stream, StreamMetadata } from '../Stream'
import { StreamIDBuilder } from '../StreamIDBuilder'
import { StreamrClientError } from '../StreamrClientError'
import type { StreamRegistryV4 as StreamRegistryContract } from '../ethereumArtifacts/StreamRegistryV4'
import StreamRegistryArtifact from '../ethereumArtifacts/StreamRegistryV4Abi.json'
import type { StreamRegistry as StreamRegistryContract } from '@streamr/network-contracts'
import { streamRegistryABI } from '@streamr/network-contracts'
import { getEthersOverrides } from '../ethereumUtils'
import { StreamrClientEventEmitter } from '../events'
import {
Expand Down Expand Up @@ -123,12 +123,12 @@ export class StreamRegistry {
this.logger = loggerFactory.createLogger(module)
this.streamRegistryContractReadonly = this.contractFactory.createReadContract<StreamRegistryContract>(
toEthereumAddress(this.config.contracts.streamRegistryChainAddress),
StreamRegistryArtifact,
streamRegistryABI,
this.rpcProviderSource.getProvider(),
'streamRegistry'
)
const chainEventPoller = new ChainEventPoller(this.rpcProviderSource.getSubProviders().map((p) => {
return contractFactory.createEventContract(toEthereumAddress(this.config.contracts.streamRegistryChainAddress), StreamRegistryArtifact, p)
return contractFactory.createEventContract(toEthereumAddress(this.config.contracts.streamRegistryChainAddress), streamRegistryABI, p)
// eslint-disable-next-line no-underscore-dangle
}), config.contracts.pollInterval)
initContractEventGateway({
Expand Down Expand Up @@ -191,7 +191,7 @@ export class StreamRegistry {
const chainSigner = await this.authentication.getTransactionSigner(this.rpcProviderSource)
this.streamRegistryContract = this.contractFactory.createWriteContract<StreamRegistryContract>(
toEthereumAddress(this.config.contracts.streamRegistryChainAddress),
StreamRegistryArtifact,
streamRegistryABI,
chainSigner,
'streamRegistry'
)
Expand Down
Loading

0 comments on commit 5ddee47

Please sign in to comment.