Skip to content

Commit

Permalink
fix arm state generation
Browse files Browse the repository at this point in the history
  • Loading branch information
apexearth committed Jan 3, 2025
1 parent f0c0355 commit 2b8886e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/templates/origin-arm/origin-arm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ export const createOriginARMProcessors = ({
}
const getCurrentState = async (block: Block) => {
const stateId = getStateId(block)
if (states[states.length - 1]?.id === stateId) {
return states[states.length - 1]
let armStateEntity = states.find((state) => state.id === stateId)
if (armStateEntity) {
return armStateEntity
}
const previousState = await getPreviousState()
const armContract = new originLidoArmAbi.Contract(ctx, block.header, armAddress)
Expand All @@ -180,7 +181,7 @@ export const createOriginARMProcessors = ({
armContract.previewRedeem(10n ** 18n),
])
const date = new Date(block.header.timestamp)
const armStateEntity = new ArmState({
armStateEntity = new ArmState({
id: stateId,
chainId: ctx.chain.id,
timestamp: date,
Expand Down

0 comments on commit 2b8886e

Please sign in to comment.