Skip to content

Commit

Permalink
Base chal (#53)
Browse files Browse the repository at this point in the history
* update QueryChallenge

* update QueryUnverifyProof
  • Loading branch information
AstaFrode committed May 17, 2023
1 parent f0df6f2 commit 97087fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
7 changes: 4 additions & 3 deletions core/chain/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ import (
"github.com/pkg/errors"
)

func (c *chainClient) QueryUnverifyProof() ([]AllProofInfo, error) {
var list []AllProofInfo
func (c *chainClient) QueryUnverifyProof() ([]ProofAssignmentInfo, error) {
var list []ProofAssignmentInfo
key := createPrefixedKey(AUDIT, UNVERIFYPROOF)
keys, err := c.api.RPC.State.GetKeysLatest(key)
if err != nil {
return list, errors.Wrap(err, "[GetKeysLatest]")
}
set, err := c.api.RPC.State.QueryStorageAtLatest(keys)

if err != nil {
return list, errors.Wrap(err, "[QueryStorageAtLatest]")
}
for _, elem := range set {
for _, change := range elem.Changes {
var data AllProofInfo
var data ProofAssignmentInfo
if err := codec.Decode(change.StorageData, &data); err != nil {
log.Println(err)
continue
Expand Down
2 changes: 1 addition & 1 deletion core/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type Chain interface {
QueryTeeInfoList() ([]TeeWorkerInfo, error)

//
QueryUnverifyProof() ([]AllProofInfo, error)
QueryUnverifyProof() ([]ProofAssignmentInfo, error)

// Register is used to register OSS or BUCKET roles.
Register(role string, puk []byte, income string, pledge uint64) (string, error)
Expand Down
7 changes: 1 addition & 6 deletions core/chain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,12 @@ type TeeWorkerInfo struct {
StashAccount types.AccountID
}

type ProveInfo struct {
type ProofAssignmentInfo struct {
SnapShot MinerSnapShot
IdleProve types.Bytes
ServiceProve types.Bytes
}

type AllProofInfo struct {
Acc types.AccountID
UnverifyProofList []ProveInfo
}

func CompareSlice(s1, s2 []byte) bool {
if len(s1) != len(s2) {
return false
Expand Down

0 comments on commit 97087fd

Please sign in to comment.