Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to go 1.20 #23

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/spacemeshos/economics

go 1.19
go 1.20

require (
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05
Expand Down
3 changes: 2 additions & 1 deletion rewards/rewards.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package rewards

import (
"log"

"github.com/spacemeshos/economics/constants"

"github.com/ericlagergren/decimal"
"log"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions rewards/rewards_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package rewards

import (
"math"
"testing"

"github.com/ericlagergren/decimal"
"github.com/spacemeshos/economics/constants"
"github.com/stretchr/testify/assert"
"math"
"testing"
)

func Test_Lambda(t *testing.T) {
Expand Down
17 changes: 7 additions & 10 deletions sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package main
import (
"flag"
"fmt"
"log"
"os"
"strconv"
"time"

"github.com/spacemeshos/economics/constants"
"github.com/spacemeshos/economics/rewards"
"github.com/spacemeshos/economics/vesting"
Expand All @@ -13,15 +18,9 @@ import (
"github.com/tcnksm/go-input"
"golang.org/x/text/language"
"golang.org/x/text/message"
"log"
"os"
"strconv"
"time"
)

var (
qFlag = flag.Bool("q", false, "quiet mode (noninteractive)")
)
var qFlag = flag.Bool("q", false, "quiet mode (noninteractive)")

func main() {
// parse flags
Expand Down Expand Up @@ -145,9 +144,7 @@ const (
defaultEndLayer = 10 * constants.OneYear
)

var (
defaultGenesisDate, _ = time.Parse("20060102", defaultGenesisDateStr)
)
var defaultGenesisDate, _ = time.Parse("20060102", defaultGenesisDateStr)

func getParams() (time.Time, uint32, uint32) {
// short-circuit UI in quiet mode
Expand Down
3 changes: 2 additions & 1 deletion vesting/vesting.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package vesting

import (
"github.com/spacemeshos/economics/constants"
"log"

"github.com/spacemeshos/economics/constants"
)

func AccumulatedVestAtLayer(layersAfterEffectiveGenesis uint32) uint64 {
Expand Down
3 changes: 2 additions & 1 deletion vesting/vesting_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package vesting

import (
"testing"

"github.com/spacemeshos/economics/constants"
"github.com/stretchr/testify/assert"
"testing"
)

func Test_Genesis(t *testing.T) {
Expand Down