m001

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountDecimals = migrations.Migration{
	Contract: accounts.Contract,
	Apply: func(state kv.KVStore, log *logger.Logger) error {
		migrateBaseTokens := func(accKey []byte) {

			key := accounts.BaseTokensKey(kv.Key(accKey))
			amountBytes := state.Get(key)
			if amountBytes == nil {
				return
			}
			amount := codec.MustDecodeUint64(amountBytes)
			amountMigrated := util.BaseTokensDecimalsToEthereumDecimals(amount, 6)
			state.Set(key, codec.EncodeBigIntAbs(amountMigrated))
		}

		allAccountsMap := accounts.AllAccountsMapR(state)
		allAccountsMap.IterateKeys(func(accountKey []byte) bool {

			migrateBaseTokens(accountKey)
			return true
		})

		migrateBaseTokens([]byte(accounts.L2TotalsAccount))
		return nil
	},
}

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