Skip to content

Commit

Permalink
Fixed expiration plus duration units.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Dec 4, 2023
1 parent 47c2bb6 commit 53175a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/data/formulas/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const expirationPlusDuration = (
if ('at_height' in expiration && 'height' in duration) {
return { at_height: expiration.at_height + duration.height }
} else if ('at_time' in expiration && 'time' in duration) {
return { at_time: expiration.at_time + duration.time }
// `duration.time` is in seconds, so convert to nanoseconds for `at_time`.
return { at_time: expiration.at_time + duration.time * 1e6 }
}

// Should never happen.
Expand Down

0 comments on commit 53175a9

Please sign in to comment.