Skip to content

Commit 52c0b43

Browse files
authored
Merge pull request #15 from Golem-Base/rvdp/dev
chore: fixes to example
2 parents 2a31bd2 + e803b83 commit 52c0b43

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

example/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function main() {
4141
1337,
4242
key,
4343
'http://localhost:8545',
44-
'ws://localhost:8546',
44+
'ws://localhost:8545',
4545
log,
4646
),
4747
demo: await createClient(
@@ -79,6 +79,9 @@ async function main() {
7979
onDeleted: (args) => {
8080
log.info("Got deletion event:", args)
8181
},
82+
onError: (error) => {
83+
log.error("Got error:", error)
84+
},
8285
pollingInterval: 500,
8386
transport: "http",
8487
})
@@ -195,17 +198,18 @@ async function main() {
195198
await client.queryEntities("ix = 1 || ix = 2 || ix = 3"),
196199
async result => {
197200
const metadata = await client.getEntityMetaData(result.entityKey)
198-
return metadata.owner === await client.getOwnerAddress()
201+
return metadata.owner === (await client.getOwnerAddress()).toLocaleLowerCase()
199202
}
200203
)).map(result => result.entityKey)
201204

205+
log.info("Entities to delete:", toDelete)
202206
if (toDelete.length !== 0) {
203207
await client.deleteEntities(toDelete)
204208
}
205209

206210
log.info("Number of entities owned:", await numOfEntitiesOwned())
207211

208-
log.debug("Current balance: ", formatEther(await client.getRawClient().httpClient.getBalance({
212+
log.info("Current balance: ", formatEther(await client.getRawClient().httpClient.getBalance({
209213
address: await client.getOwnerAddress(),
210214
blockTag: 'latest'
211215
})))

0 commit comments

Comments
 (0)