Skip to content

Commit

Permalink
Fix #2128
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Jun 28, 2024
1 parent 5da85fd commit b5d1853
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,15 @@ sbp('okTurtles.data/set', PUBSUB_INSTANCE, createServer(hapi.listener, {
// partition
const recoveredState = Object.create(null)
recoveredState.contracts = Object.create(null)
const channels = sbp('okTurtles.data/get', PUBSUB_INSTANCE).channels
await Promise.all(savedStateIndex.split('\x00').map(async (contractID) => {
const cpSerialized = await sbp('chelonia/db/get', `_private_cheloniaState_${contractID}`)
if (!cpSerialized) return
const cp = JSON.parse(cpSerialized)
recoveredState[contractID] = cp.contractState
recoveredState.contracts[contractID] = cp.cheloniaContractInfo
// Add existing contract IDs to the list of channels
channels.add(contractID)
}))
Object.assign(sbp('chelonia/rootState'), recoveredState)
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

0 comments on commit b5d1853

Please sign in to comment.