11package goo
22
33import (
4- "time"
54 "chain"
65 "chain/runtime"
7- "testing"
86 "strconv"
7+ "testing"
8+ "time"
99
1010 "gno.land/p/nt/testutils"
1111 "gno.land/p/nt/urequire"
1919
2020func TestRequestData(t *testing.T) {
2121 testing.SetRealm(testing.NewUserRealm(user1))
22- urequire.AbortsWithMessage(t, "error: Incorrect reward amount sent. Required: " + strconv.FormatInt(RequesterReward, 10) + " ugnot.", func() {
22+ urequire.AbortsWithMessage(t, "error: Incorrect reward amount sent. Required: "+ strconv.FormatInt(RequesterReward, 10)+ " ugnot.", func() {
2323 RequestData(cross, "test", true, time.Now().Add(24*time.Hour).Unix())
2424 }, "user should not be able to request data without sending the requester reward")
2525
@@ -62,13 +62,13 @@ func TestProposeValue(t *testing.T) {
6262
6363 testing.SetRealm(testing.NewUserRealm(user1))
6464 testing.SetOriginSend([]chain.Coin{{Denom: "ugnot", Amount: 0}})
65- urequire.AbortsWithMessage(t, "error: Incorrect bond amount sent. Required: " + strconv.FormatInt(Bond, 10) + " ugnot", func() {
65+ urequire.AbortsWithMessage(t, "error: Incorrect bond amount sent. Required: "+ strconv.FormatInt(Bond, 10)+ " ugnot", func() {
6666 ProposeValue(cross, id, 0)
6767 }, "user should not be able to propose a value without sending the bond")
6868
6969 testing.SetRealm(testing.NewUserRealm(user1))
7070 testing.SetOriginSend([]chain.Coin{{Denom: "ugnot", Amount: Bond}})
71- setTime(time.Now().Add(25* time.Hour))
71+ setTime(time.Now().Add(25 * time.Hour))
7272 urequire.AbortsWithMessage(t, "error: Deadline for proposal has passed.", func() {
7373 ProposeValue(cross, id, 0)
7474 }, "user should not be able to propose a value after the deadline")
@@ -111,13 +111,13 @@ func TestDisputeData(t *testing.T) {
111111
112112 testing.SetRealm(testing.NewUserRealm(user2))
113113 testing.SetOriginSend([]chain.Coin{{Denom: "ugnot", Amount: 0}})
114- urequire.AbortsWithMessage(t, "error: Incorrect bond amount sent. Required: " + strconv.FormatInt(Bond, 10) + " ugnot", func() {
114+ urequire.AbortsWithMessage(t, "error: Incorrect bond amount sent. Required: "+ strconv.FormatInt(Bond, 10)+ " ugnot", func() {
115115 DisputeData(cross, id)
116116 }, "user should not be able to dispute a value without sending the bond")
117117
118118 testing.SetRealm(testing.NewUserRealm(user2))
119119 testing.SetOriginSend([]chain.Coin{{Denom: "ugnot", Amount: Bond}})
120- setTime(time.Now().Add(time.Duration(ResolutionTime) * time.Second + time.Second))
120+ setTime(time.Now().Add(time.Duration(ResolutionTime)* time.Second + time.Second))
121121 urequire.AbortsWithMessage(t, "error: Dispute period has ended.", func() {
122122 DisputeData(cross, id)
123123 }, "user should not be able to dispute a value after the dispute period has ended")
@@ -158,8 +158,8 @@ func TestResolveRequest(t *testing.T) {
158158 ResolveRequest(cross, id)
159159 }, "user should not be able to resolve a request if the resolution period has not ended yet")
160160
161- setTime(now.Add(time.Duration(ResolutionTime) * time.Second + time.Second))
162- CreateGnotCoins(cross, Bond + RequesterReward)
161+ setTime(now.Add(time.Duration(ResolutionTime)* time.Second + time.Second))
162+ CreateGnotCoins(cross, Bond+ RequesterReward)
163163 urequire.NotPanics(t, func() {
164164 ResolveRequest(cross, id)
165165 }, "user should be able to resolve a request")
@@ -174,7 +174,7 @@ func TestRequesterRetreiveFund(t *testing.T) {
174174 // setup: create request
175175 testing.SetRealm(testing.NewUserRealm(user1))
176176 testing.SetOriginSend([]chain.Coin{{Denom: "ugnot", Amount: RequesterReward}})
177- duration := time.Now().Add(24* time.Hour)
177+ duration := time.Now().Add(24 * time.Hour)
178178 id := RequestData(cross, "test", true, duration.Unix())
179179
180180 testing.SetRealm(testing.NewUserRealm(user2))
@@ -200,4 +200,4 @@ func setTime(newTime time.Time) {
200200
201201func CreateGnotCoins(_ realm, amount int64) {
202202 testing.IssueCoins(runtime.CurrentRealm().Address(), chain.Coins{{Denom: "ugnot", Amount: amount}})
203- }
203+ }
0 commit comments