Skip to content

Commit

Permalink
apply go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitprincess committed Oct 25, 2023
1 parent ea0b635 commit 9ceb03f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contract/system/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
)

var (
votingCatalog []types.VotingIssue
votingCatalog []types.VotingIssue
lastBpCount int
defaultVoteKey = []byte(types.OpvoteBP.ID())
)
Expand Down
2 changes: 1 addition & 1 deletion contract/vm_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ func transformAmount(amountStr string) (*big.Int, error) {

// Define the units and corresponding multipliers
for _, data := range []struct {
unit string
unit string
multiplier *big.Int
}{
{"aergo", mulAergo},
Expand Down
16 changes: 8 additions & 8 deletions contract/vm_callback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import (
)

func bigIntFromString(str string) *big.Int {
bigInt, success := new(big.Int).SetString(str, 10)
if !success {
panic("bigIntFromString: invalid number: " + str)
}
return bigInt
bigInt, success := new(big.Int).SetString(str, 10)
if !success {
panic("bigIntFromString: invalid number: " + str)
}
return bigInt
}

func TestTransformAmount(t *testing.T) {
// Define the test cases
tests := []struct {
amountStr string
expectedAmount *big.Int
expectedError error
amountStr string
expectedAmount *big.Int
expectedError error
}{
// Empty Input String
{"", big.NewInt(0), nil},
Expand Down

0 comments on commit 9ceb03f

Please sign in to comment.