Skip to content

Commit

Permalink
feat(schema): update node schema
Browse files Browse the repository at this point in the history
  • Loading branch information
polebug authored Jan 11, 2024
1 parent 025e54e commit a176247
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
16 changes: 8 additions & 8 deletions internal/hub/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func (h *Hub) getNode(ctx context.Context, address common.Address) (*schema.Node
node.Name = nodeInfo.Name
node.Description = nodeInfo.Description
node.TaxFraction = nodeInfo.TaxFraction
node.OperatingPoolTokens = nodeInfo.OperatingPoolTokens
node.StakingPoolTokens = nodeInfo.StakingPoolTokens
node.TotalShares = nodeInfo.TotalShares
node.SlashedTokens = nodeInfo.SlashedTokens
node.OperatingPoolTokens = nodeInfo.OperatingPoolTokens.String()
node.StakingPoolTokens = nodeInfo.StakingPoolTokens.String()
node.TotalShares = nodeInfo.TotalShares.String()
node.SlashedTokens = nodeInfo.SlashedTokens.String()

return node, nil
}
Expand Down Expand Up @@ -58,10 +58,10 @@ func (h *Hub) getNodes(ctx context.Context, request *BatchNodeRequest) ([]*schem
node.Name = nodeInfo.Name
node.Description = nodeInfo.Description
node.TaxFraction = nodeInfo.TaxFraction
node.OperatingPoolTokens = nodeInfo.OperatingPoolTokens
node.StakingPoolTokens = nodeInfo.StakingPoolTokens
node.TotalShares = nodeInfo.TotalShares
node.SlashedTokens = nodeInfo.SlashedTokens
node.OperatingPoolTokens = nodeInfo.OperatingPoolTokens.String()
node.StakingPoolTokens = nodeInfo.StakingPoolTokens.String()
node.TotalShares = nodeInfo.TotalShares.String()
node.SlashedTokens = nodeInfo.SlashedTokens.String()
}
}

Expand Down
10 changes: 4 additions & 6 deletions schema/node.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package schema

import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/naturalselectionlabs/rss3-node/config"
)
Expand All @@ -13,10 +11,10 @@ type Node struct {
Description string `json:"description"`
TaxFraction uint64 `json:"taxFraction"`
IsPublicGood bool `json:"isPublicGood"`
OperatingPoolTokens *big.Int `json:"operatingPoolTokens"`
StakingPoolTokens *big.Int `json:"stakingPoolTokens"`
TotalShares *big.Int `json:"totalShares"`
SlashedTokens *big.Int `json:"slashedTokens"`
OperatingPoolTokens string `json:"operatingPoolTokens"`
StakingPoolTokens string `json:"stakingPoolTokens"`
TotalShares string `json:"totalShares"`
SlashedTokens string `json:"slashedTokens"`
Endpoint string `json:"-"`
Stream *config.Stream `json:"-"`
Config *config.Node `json:"-"`
Expand Down

0 comments on commit a176247

Please sign in to comment.