Skip to content

Commit

Permalink
fix(dectools): storedBlockLogs (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
aLIEzsss4 authored Nov 4, 2023
1 parent 3a6c40d commit ed7dbfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ setup().then(async (result) => {
publicClient: result.network.publicClient,
walletClient: result.network.walletClient,
latestBlock$: result.network.latestBlock$,
blockStorageOperations$: result.network.blockStorageOperations$,
storedBlockLogs$: result.network.storedBlockLogs$,
worldAddress: result.network.worldContract.address,
worldAbi: result.network.worldContract.abi,
write$: result.network.write$,
Expand Down
24 changes: 10 additions & 14 deletions packages/client/src/mud/setupNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,15 @@ export async function setupNetwork() {
* to the viem publicClient to make RPC calls to fetch MUD
* events from the chain.
*/
const {
components,
latestBlock$,
blockStorageOperations$,
waitForTransaction,
} = await syncToRecs({
world,
config: mudConfig,
address: networkConfig.worldAddress as Hex,
publicClient,
startBlock: BigInt(networkConfig.initialBlockNumber),
indexerUrl: networkConfig.indexerUrl,
});
const { components, latestBlock$, storedBlockLogs$, waitForTransaction } =
await syncToRecs({
world,
config: mudConfig,
address: networkConfig.worldAddress as Hex,
publicClient,
startBlock: BigInt(networkConfig.initialBlockNumber),
indexerUrl: networkConfig.indexerUrl,
});

/*
* If there is a faucet, request (test) ETH if you have
Expand Down Expand Up @@ -140,7 +136,7 @@ export async function setupNetwork() {
publicClient,
walletClient: burnerWalletClient,
latestBlock$,
blockStorageOperations$,
storedBlockLogs$,
waitForTransaction,
worldContract,
write$: write$.asObservable().pipe(share()),
Expand Down

0 comments on commit ed7dbfb

Please sign in to comment.