forked from filecoin-project/go-state-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchain.go
32 lines (24 loc) · 907 Bytes
/
chain.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
package abi
import (
"strconv"
"github.com/filecoin-project/go-state-types/big"
)
// Epoch number of the chain state, which acts as a proxy for time within the VM.
type ChainEpoch int64
func (e ChainEpoch) String() string {
return strconv.FormatInt(int64(e), 10)
}
// TokenAmount is an amount of Filecoin tokens. This type is used within
// the VM in message execution, to account movement of tokens, payment
// of VM gas, and more.
//
// BigInt types are aliases rather than new types because the latter introduce incredible amounts of noise converting to
// and from types in order to manipulate values. We give up some type safety for ergonomics.
type TokenAmount = big.Int
func NewTokenAmount(t int64) TokenAmount {
return big.NewInt(t)
}
// Randomness is a string of random bytes
type Randomness []byte
// RandomnessLength is the length of the randomness slice.
const RandomnessLength = 32