neoneo-go/pkg/core/native/gas_record.go
Anna Shaleva 0232bbcb0c core: refactor GASRecord handling
We should store each GAS record as
{
    Key: ContractID + RecordsPrefix + RecordID,
    Value: RecordValue,
}
So don't use state.GASRecord for storing anymore. However, it's still
useful to cache GasRecord values by using state.GASRecords, because we
have to keep GASIndexPairs sorted by indexes.
2020-10-23 12:49:12 +03:00

13 lines
337 B
Go

package native
import "math/big"
// gasIndexPair contains block index together with generated gas per block.
// It is used to cache NEO GASRecords.
type gasIndexPair struct {
Index uint32
GASPerBlock big.Int
}
// gasRecord contains history of gas per block changes. It is used only by NEO cache.
type gasRecord []gasIndexPair