slash

package
v0.0.0-...-ddf2b42 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Index

Constants

View Source
const PackageName = "惩罚"

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockSlash

type BlockSlash struct {
	SlashRate uint64
	// contains filtered or unexported fields
}

func New

func New(chain util.ChainReader, st util.StateDB, preSt util.StateDB) *BlockSlash

func (*BlockSlash) CalcSlash

func (bp *BlockSlash) CalcSlash(currentState *state.StateDBManage, num uint64, upTimeMap map[common.Address]uint64, parentHash common.Hash, time uint64)

func (*BlockSlash) GetCurrentInterest

func (bp *BlockSlash) GetCurrentInterest(preState *state.StateDBManage, currentState vm.StateDBManager, num uint64) map[common.Address]*big.Int

type SlashDelta

type SlashDelta struct {
	SlashRate uint64
	// contains filtered or unexported fields
}

func DeltaNew

func DeltaNew(chain util.ChainReader, st util.StateDB, preSt *state.StateDBManage) *SlashDelta

func (*SlashDelta) CalcSlash

func (bp *SlashDelta) CalcSlash(currentState *state.StateDBManage, num uint64, upTimeMap map[common.Address]uint64, parentHash common.Hash, time uint64)

func (*SlashDelta) GetDeposit

func (bp *SlashDelta) GetDeposit(parentHash common.Hash) []common.DepositBase

func (*SlashDelta) GetElectAndInterest

func (bp *SlashDelta) GetElectAndInterest(currentState *state.StateDBManage, num uint64, parentHash common.Hash, upTimeMap map[common.Address]uint64, time uint64) (map[common.Address][]common.OperationalInterestSlash, *mc.ElectGraph, error)

func (*SlashDelta) SetSlash

func (bp *SlashDelta) SetSlash(electGraph *mc.ElectGraph, upTimeMap map[common.Address]uint64, allAccountInterest map[common.Address][]common.OperationalInterestSlash, currentState *state.StateDBManage)

type SlashOperator

type SlashOperator interface {
	CalcSlash(currentState *state.StateDBManage, num uint64, upTimeMap map[common.Address]uint64, parentHash common.Hash, time uint64)
}

func ManageNew

func ManageNew(chain util.ChainReader, st util.StateDB, preSt *state.StateDBManage) SlashOperator

Jump to

Keyboard shortcuts

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