Skip to content

Commit 561610f

Browse files
committed
fix: format and more
1 parent c7a7d93 commit 561610f

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

packages/r/intermarch3/goo/court.gno

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func RevealVote(_ realm, id string, value int64, salt string) {
132132
}
133133

134134
// ResolveDispute finalizes a dispute after the reveal period, tallying votes and setting the winning value.
135-
func ResolveDispute(DEADLINE_TIMESTAMP realm, id string) {
135+
func ResolveDispute(_ realm, id string) {
136136
dispute := getDispute(id)
137137
if dispute.IsResolved {
138138
panic("error: Dispute is already resolved.")

packages/r/intermarch3/goo/court_test.gno

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ package goo
22

33
import (
44
"chain"
5-
"testing"
65
"strconv"
6+
"testing"
77
"time"
88

9-
"gno.land/p/nt/urequire"
109
"gno.land/p/nt/testutils"
10+
"gno.land/p/nt/urequire"
1111
)
1212

1313
var user4 = testutils.TestAddress("user4")
1414

1515
func TestBuyInitialVoteToken(t *testing.T) {
1616
testing.SetRealm(testing.NewUserRealm(user1))
17-
urequire.AbortsWithMessage(t, "error: Must send exactly " + strconv.Itoa(int(VoteTokenPrice/1_000_000)) + " gnot to get a vote token.", func() {
17+
urequire.AbortsWithMessage(t, "error: Must send exactly "+strconv.Itoa(int(VoteTokenPrice/1_000_000))+" gnot to get a vote token.", func() {
1818
BuyInitialVoteToken(cross)
1919
}, "user should not be able to buy a vote token without sending the correct amount")
2020

@@ -74,7 +74,7 @@ func TestVoteOnDispute(t *testing.T) {
7474
}, "user should not be able to vote on dispute if they have already voted")
7575

7676
testing.SetRealm(testing.NewUserRealm(user4))
77-
setTime(time.Now().Add(time.Duration(DisputeDuration) * time.Second + time.Second))
77+
setTime(time.Now().Add(time.Duration(DisputeDuration)*time.Second + time.Second))
7878
urequire.AbortsWithMessage(t, "error: Vote period has ended.", func() {
7979
VoteOnDispute(cross, id, "hash")
8080
}, "user should not be able to vote on dispute after the voting period has ended")
@@ -99,7 +99,7 @@ func TestRevealVote(t *testing.T) {
9999
VoteOnDispute(cross, id, "a96e0beb59a16b085a7d2b3b5ffd6e5971870aa2903c6df86f26fa908ded2e21")
100100

101101
testing.SetRealm(testing.NewUserRealm(user3))
102-
setTime(time.Now().Add(time.Duration(DisputeDuration) * time.Second + time.Second))
102+
setTime(time.Now().Add(time.Duration(DisputeDuration)*time.Second + time.Second))
103103
urequire.AbortsWithMessage(t, "error: Hash does not match the revealed value and salt.", func() {
104104
RevealVote(cross, id, 1, "mysalt")
105105
}, "vote reveal with incorrect value and salt should fail")
@@ -133,16 +133,16 @@ func TestResolveDispute(t *testing.T) {
133133
// vote on dispute
134134
testing.SetRealm(testing.NewUserRealm(user3))
135135
VoteOnDispute(cross, id, "a96e0beb59a16b085a7d2b3b5ffd6e5971870aa2903c6df86f26fa908ded2e21")
136-
setTime(time.Now().Add(time.Duration(DisputeDuration) * time.Second + time.Second))
136+
setTime(time.Now().Add(time.Duration(DisputeDuration)*time.Second + time.Second))
137137
RevealVote(cross, id, 0, "test")
138138

139-
setTime(time.Now().Add(time.Duration(RevealDuration) * time.Second + time.Second))
140-
CreateGnotCoins(cross, (Bond * 2) + RequesterReward)
139+
setTime(time.Now().Add(time.Duration(RevealDuration)*time.Second + time.Second))
140+
CreateGnotCoins(cross, (Bond*2)+RequesterReward)
141141
urequire.NotPanics(t, func() {
142142
ResolveDispute(cross, id)
143143
}, "user should be able to resolve dispute after the reveal period has ended")
144144

145145
urequire.AbortsWithMessage(t, "error: Dispute is already resolved.", func() {
146146
ResolveDispute(cross, id)
147147
}, "user should not be able to resolve dispute before the reveal period has ended")
148-
}
148+
}

packages/r/intermarch3/goo/oracle_test.gno

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package goo
22

33
import (
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"
@@ -19,7 +19,7 @@ var (
1919

2020
func 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

201201
func CreateGnotCoins(_ realm, amount int64) {
202202
testing.IssueCoins(runtime.CurrentRealm().Address(), chain.Coins{{Denom: "ugnot", Amount: amount}})
203-
}
203+
}

0 commit comments

Comments
 (0)