Skip to content

Commit

Permalink
update CertIdleSpace and ReplaceIdleSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
AstaFrode committed Dec 16, 2023
1 parent 8b4c96f commit 1a1e9f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions chain/fileBank.go
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ func (c *chainClient) RestoralComplete(restoralFragmentHash string) (string, err
}
}

func (c *chainClient) CertIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, tee_acc []byte) (string, error) {
func (c *chainClient) CertIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, teeWorkAcc string) (string, error) {
c.lock.Lock()
defer func() {
c.lock.Unlock()
Expand All @@ -1480,7 +1480,10 @@ func (c *chainClient) CertIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pa
if !c.GetChainState() {
return txhash, pattern.ERR_RPC_CONNECTION
}

tee_acc, err := utils.ParsingPublickey(teeWorkAcc)
if err != nil {
return txhash, errors.Wrap(err, fmt.Sprintf("[ParsingPublickey(%s)]", teeWorkAcc))
}
acc, err := types.NewAccountID(tee_acc)
if err != nil {
return txhash, errors.Wrap(err, "[NewAccountID]")
Expand Down Expand Up @@ -1572,7 +1575,7 @@ func (c *chainClient) CertIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pa
}
}

func (c *chainClient) ReplaceIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, tee_acc []byte) (string, error) {
func (c *chainClient) ReplaceIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, teeWorkAcc string) (string, error) {
c.lock.Lock()
defer func() {
c.lock.Unlock()
Expand All @@ -1589,6 +1592,10 @@ func (c *chainClient) ReplaceIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign
if !c.GetChainState() {
return txhash, pattern.ERR_RPC_CONNECTION
}
tee_acc, err := utils.ParsingPublickey(teeWorkAcc)
if err != nil {
return txhash, errors.Wrap(err, fmt.Sprintf("[ParsingPublickey(%s)]", teeWorkAcc))
}

acc, err := types.NewAccountID(tee_acc)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions core/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ type SDK interface {
// GenerateStorageOrder for generating storage orders
GenerateStorageOrder(roothash string, segment []pattern.SegmentDataInfo, owner []byte, filename, buckname string, filesize uint64) (string, error)
// CertIdleSpace
CertIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, tee_acc []byte) (string, error)
CertIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, teeWorkAcc string) (string, error)
// ReplaceIdleSpace
ReplaceIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, tee_acc []byte) (string, error)
ReplaceIdleSpace(idleSignInfo pattern.SpaceProofInfo, sign pattern.TeeSignature, teeWorkAcc string) (string, error)
// ReportTagCalculated
ReportTagCalculated(teeSig pattern.TeeSignature, tagSigInfo pattern.TagSigInfo) (string, error)

Expand Down

0 comments on commit 1a1e9f5

Please sign in to comment.