Skip to content

Commit

Permalink
restore the set noder certificate without sudo (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamadazmy authored Jan 16, 2024
1 parent 8dfb941 commit 34002e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clients/tfchain-client-go/burning.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
)

type BurnTransaction struct {
Block types.U32 `json:"block"`
Block BlockNumber `json:"block"`
Amount types.U64 `json:"amount"`
Source types.OptionAccountID `json:"source"`
Target string `json:"target"`
Expand Down
21 changes: 21 additions & 0 deletions clients/tfchain-client-go/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,3 +804,24 @@ func (s *Substrate) GetDedicatedNodePrice(nodeID uint32) (uint64, error) {

return uint64(price), nil
}

// SetNodeCertificate sets the node certificate type
func (s *Substrate) SetNodeCertificate(identity Identity, id uint32, cert NodeCertification) error {
cl, meta, err := s.GetClient()
if err != nil {
return err
}

c, err := types.NewCall(meta, "TfgridModule.set_node_certification",
id, cert,
)
if err != nil {
return errors.Wrap(err, "failed to create call")
}

if _, err := s.Call(cl, meta, identity, c); err != nil {
return errors.Wrap(err, "failed to set node certificate")
}

return nil
}

0 comments on commit 34002e6

Please sign in to comment.