Skip to content

Commit

Permalink
Fix default asset decimal pointer (#943)
Browse files Browse the repository at this point in the history
* update go.sum

* fix pointer

* update hello world plugin
  • Loading branch information
Thykof authored May 20, 2024
1 parent 0ea6636 commit cefe77e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/go-openapi/runtime v0.25.0
github.com/jessevdk/go-flags v1.5.0
github.com/massalabs/station v0.6.4
github.com/massalabs/station-massa-hello-world v0.0.11-0.20240417140254-7d634fa41a71
github.com/massalabs/station-massa-hello-world v0.0.11-0.20240503070604-6b14a27fcdff
github.com/pkg/errors v0.9.1
github.com/rs/cors v1.8.3
github.com/shopspring/decimal v1.3.1
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/massalabs/station v0.6.3-0.20240415204727-599dc5497976 h1:OysVIvd80xvUyhRtKjWRAc7h/6GLYxdcI+GQGfzAZv4=
github.com/massalabs/station v0.6.3-0.20240415204727-599dc5497976/go.mod h1:qOUOGLMF6jCRVGncNGPATcvsPHwgj3rBKr44qa74ayU=
github.com/massalabs/station v0.6.4 h1:qAIj13cCQxboBBGdQwtcdoHCPPafOFM/+kO2+t2H2xo=
github.com/massalabs/station v0.6.4/go.mod h1:i9d/zAqeDYxY0Od5LEfEkP6V2osUhA13GwA72ByM8bQ=
github.com/massalabs/station-massa-hello-world v0.0.11-0.20240417140254-7d634fa41a71 h1:Pnkm1bBoIdFH6VpIxOJHqZlBl79yuryobo8VvPYzw+E=
github.com/massalabs/station-massa-hello-world v0.0.11-0.20240417140254-7d634fa41a71/go.mod h1:2i/w0wPin6bCPSeWRYcEKt48DYoUQC1mZmhPVIUWL14=
github.com/massalabs/station-massa-hello-world v0.0.11-0.20240503070604-6b14a27fcdff h1:SZoRmXdbolVjhbsxO/3KWX8429Q1VnaQdQy0h718CqE=
github.com/massalabs/station-massa-hello-world v0.0.11-0.20240503070604-6b14a27fcdff/go.mod h1:QbRHQvJFrm4mO+vPzr4Uiwa5REL/CgBlV4PDFdhewa0=
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
Expand Down
3 changes: 2 additions & 1 deletion pkg/assets/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,11 @@ func (s *AssetsStore) All(nickname string) []*AssetInfoWithBalances {
includedAddresses := map[string]bool{}

for _, asset := range defaultAssets {
decimals := asset.Decimals // Copy the decimals value to avoid a pointer to a local variable
completeAsset := &AssetInfoWithBalances{
AssetInfo: &models.AssetInfo{
Address: asset.Address,
Decimals: &asset.Decimals,
Decimals: &decimals,
Name: asset.Name,
Symbol: asset.Symbol,
},
Expand Down

0 comments on commit cefe77e

Please sign in to comment.