-
Notifications
You must be signed in to change notification settings - Fork 210
/
sdk.go
43 lines (35 loc) · 1.06 KB
/
sdk.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
package testutil
import (
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func Coin(t testing.TB) sdk.Coin {
t.Helper()
return sdk.NewCoin("testcoin", sdk.NewInt(int64(RandRangeInt(1, 1000)))) // nolint: gosec
}
func DecCoin(t testing.TB) sdk.DecCoin {
t.Helper()
return sdk.NewDecCoin("testcoin", sdk.NewInt(int64(RandRangeInt(1, 1000)))) // nolint: gosec
}
// AkashCoinRandom provides simple interface to the Akash sdk.Coin type.
func AkashCoinRandom(t testing.TB) sdk.Coin {
t.Helper()
amt := sdk.NewInt(int64(RandRangeInt(1, 1000)))
return sdk.NewCoin(CoinDenom, amt)
}
// AkashCoin provides simple interface to the Akash sdk.Coin type.
func AkashCoin(t testing.TB, amount int64) sdk.Coin {
t.Helper()
amt := sdk.NewInt(amount)
return sdk.NewCoin(CoinDenom, amt)
}
func AkashDecCoin(t testing.TB, amount int64) sdk.DecCoin {
t.Helper()
amt := sdk.NewInt(amount)
return sdk.NewDecCoin(CoinDenom, amt)
}
func AkashDecCoinRandom(t testing.TB) sdk.DecCoin {
t.Helper()
amt := sdk.NewInt(int64(RandRangeInt(1, 1000)))
return sdk.NewDecCoin(CoinDenom, amt)
}