-
Notifications
You must be signed in to change notification settings - Fork 39
/
context.go
52 lines (47 loc) · 1.59 KB
/
context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package icmodule
import (
"math/big"
"github.com/icon-project/goloop/module"
"github.com/icon-project/goloop/service/state"
"github.com/icon-project/goloop/service/trace"
)
type WorldContext interface {
Revision() module.Revision
BlockHeight() int64
Origin() module.Address
Treasury() module.Address
TransactionID() []byte
ConsensusInfo() module.ConsensusInfo
GetBalance(address module.Address) *big.Int
Deposit(address module.Address, amount *big.Int, opType module.OpType) error
Withdraw(address module.Address, amount *big.Int, opType module.OpType) error
Transfer(from module.Address, to module.Address, amount *big.Int, opType module.OpType) error
GetTotalSupply() *big.Int
AddTotalSupply(amount *big.Int) (*big.Int, error)
SetValidators(validators []module.Validator) error
StepPrice() *big.Int
GetScoreOwner(score module.Address) (module.Address, error)
SetScoreOwner(from module.Address, score module.Address, owner module.Address) error
GetBTPContext() state.BTPContext
GetActiveDSAMask() int64
Governance() module.Address
}
type CallContext interface {
WorldContext
From() module.Address
HandleBurn(address module.Address, amount *big.Int) error
SumOfStepUsed() *big.Int
OnEvent(addr module.Address, indexed, data [][]byte)
CallOnTimer(to module.Address, params []byte) error
FrameLogger() *trace.Logger
TransactionInfo() *state.TransactionInfo
}
type StateContext interface {
BlockHeight() int64
RevisionValue() int
TermRevisionValue() int
TermIISSVersion() int
GetActiveDSAMask() int64
GetBondRequirement() Rate
AddEventEnable(from module.Address, status EnableStatus) error
}