feature/1125 offload sync service worker (#1144)

- **feat: provide access to block time**
- **refactor: move block expiry calculation to helper function**
- **feat: register decentralized web node HTMX views**
- **feat: Reorganize methods in layout.templ file alphabetically**
- **feat: add support for layout variants**
- **feat: update Allocate RPC to use GET request with path parameters**
- **feat: add gRPC Gateway endpoint for Allocate**
- **refactor: rename SyncCurrent to Sync**
- **feat: improve code organization by making vault assembly private**
- **feat: add a new method for syncing DID documents**
This commit is contained in:
Prad Nukala
2024-10-18 13:07:52 -04:00
committed by GitHub
parent c2f7a53017
commit 2cd44c0b66
23 changed files with 571 additions and 4641 deletions
-21
View File
@@ -1,21 +0,0 @@
package ctx
import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type SonrContext struct {
sdk.Context
}
func GetSonrCTX(ctx sdk.Context) *SonrContext {
return &SonrContext{ctx}
}
func (s *SonrContext) GetBlockExpiration(duration time.Duration) int64 {
blockTime := s.BlockTime()
avgBlockTime := float64(blockTime.Sub(blockTime).Seconds())
return int64(duration.Seconds() / avgBlockTime)
}