Skip to content

Commit

Permalink
fix(lib/babe, lib/runtime/wasmer): fixes for v0.9.8+ runtime (ChainSa…
Browse files Browse the repository at this point in the history
  • Loading branch information
noot authored Nov 30, 2021
1 parent 7bf40e1 commit 2f9f80c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dot/rpc/modules/author.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ type decodedKey struct {
type ExtrinsicStatus struct {
IsFuture bool
IsReady bool
Isfinalised bool
Asfinalised common.Hash
IsFinalized bool
AsFinalized common.Hash
IsUsurped bool
AsUsurped common.Hash
IsBroadcast bool
Expand Down
3 changes: 2 additions & 1 deletion lib/babe/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ func (b *BlockBuilder) buildBlockExtrinsics(slot Slot, rt runtime.Instance) []*t
func (b *BlockBuilder) buildBlockInherents(slot Slot, rt runtime.Instance) ([][]byte, error) {
// Setup inherents: add timstap0
idata := types.NewInherentsData()
err := idata.SetInt64Inherent(types.Timstap0, uint64(time.Now().Unix()))
timestamp := uint64(time.Now().UnixMilli())
err := idata.SetInt64Inherent(types.Timstap0, timestamp)
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion lib/runtime/wasmer/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -1906,10 +1906,14 @@ func ext_storage_clear_prefix_version_2(context unsafe.Pointer, prefixSpan, lim
return C.int64_t(ret)
}

if len(limit) == 0 {
// limit is None, set limit to max
limit = []byte{0xff, 0xff, 0xff, 0xff}
}

limitUint := binary.LittleEndian.Uint32(limit)
numRemoved, all := storage.ClearPrefixLimit(prefix, limitUint)
encBytes, err := toKillStorageResultEnum(all, numRemoved)

if err != nil {
logger.Errorf("[ext_storage_clear_prefix_version_2] failed to allocate memory: %s", err)
ret, _ := toWasmMemory(instanceContext, nil)
Expand Down

0 comments on commit 2f9f80c

Please sign in to comment.