Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

lazy/v1 package

Overview

untrusted-render: records are seeded in init or derived from lazy/v0's own init; this realm exposes no setter, so no caller string ever reaches Render.

Package lazy is version 1 of the "lazy migration" upgrade pattern (pattern D of the exploration; see ../README.md).

v1 changes the stored shape (Score widens, Active is new) and migrates one record at a time, on first touch, paid for by whoever touched it. There is no migration transaction and no pause.

The catch on today's gno: migrating on read MUTATES, so the read path has to be a crossing function. Get therefore costs a transaction and is invisible to vm/qeval and to Render. Peek is the honest read-only half, and it reports the pre-migration answer for records that have not been touched yet.

Function

Migrated

func Migrated() int

Migrated is how many records have actually moved over.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/upgrade/lazy/v1.Migrated()"

Result