-
Notifications
You must be signed in to change notification settings - Fork 2
/
system.go
66 lines (54 loc) · 1.43 KB
/
system.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package chain
import (
"github.com/uuosio/chain/eosio"
)
func Check(b bool, msg string) {
if !b {
eosio.EosioAssert(false, msg)
}
}
//Aborts processing of this action and unwinds all pending changes if the test condition is true
func Assert(test bool, msg string) {
if !test {
eosio.EosioAssert(false, msg)
}
}
//Aborts processing of this action and unwinds all pending changes if the test condition is true
func EosioAssert(test bool, msg string) {
if !test {
eosio.EosioAssert(test, msg)
}
}
//Aborts processing of this action and unwinds all pending changes if the test condition is true
func EosioAssertCode(test bool, code uint64) {
if !test {
eosio.EosioAssertCode(test, code)
}
}
//Returns the time in microseconds from 1970 of the current block
func CurrentTime() TimePoint {
return TimePoint{uint64(eosio.CurrentTime())}
}
//Returns the time in microseconds from 1970 of the current block
func Now() TimePoint {
return CurrentTime()
}
func NowSeconds() uint32 {
t := CurrentTime().Elapsed / 1000000
return uint32(t)
}
func CurrentTimeSeconds() uint32 {
t := CurrentTime().Elapsed / 1000000
return uint32(t)
}
//Check if specified protocol feature has been activated
func IsFeatureActivated(featureDigest [32]byte) bool {
return eosio.IsFeatureActivated(featureDigest)
}
//Return name of account that sent current inline action
func GetSender() uint64 {
return uint64(eosio.GetSender())
}
func Exit() {
eosio.Exit()
}