m002

package
v1.0.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeprecateNFTData = migrations.Migration{
	Contract: accounts.Contract,
	Apply: func(state kv.KVStore, log *logger.Logger) error {
		oldNFTDataMap := collections.NewMap(state, "ND")
		nftToOwnerMap := collections.NewMap(state, "NW")
		oldNFTDataMap.Iterate(func(nftIDBytes, nftDataBytes []byte) bool {
			rr := rwutil.NewBytesReader(nftDataBytes)

			rr.PushBack().WriteN(nftIDBytes)
			nft, err := isc.NFTFromReader(rr)
			if err != nil {
				panic(err)
			}
			if nft.Owner == nil {
				log.Errorf("DeprecateNFTData migration | nil owner at NFTID: %s", iotago.EncodeHex(nftIDBytes))
			}
			nftToOwnerMap.SetAt(nftIDBytes, nft.Owner.Bytes())
			return true
		})
		return nil
	},
}

for testnet -- delete when deploying ShimmerEVM

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL