Skip to content

Commit

Permalink
Base fbucket (#141)
Browse files Browse the repository at this point in the history
* update deoss and filebank

* update p2p
  • Loading branch information
AstaFrode authored Aug 30, 2023
1 parent 8dcb6da commit d0713fc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 39 deletions.
14 changes: 8 additions & 6 deletions chain/deoss.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,14 @@ func (c *chainClient) AuthorizeSpace(ossAccount string) (string, error) {

list, err := c.QuaryAuthorizedAccounts(c.GetSignatureAccPulickey())
if err != nil {
return txhash, errors.Wrap(err, "[QuaryAuthorizedAccounts]")
}

for _, v := range list {
if v == ossAccount {
return "", nil
if err.Error() != pattern.ERR_Empty {
return txhash, errors.Wrap(err, "[QuaryAuthorizedAccounts]")
}
} else {
for _, v := range list {
if v == ossAccount {
return "", nil
}
}
}

Expand Down
24 changes: 0 additions & 24 deletions chain/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,30 +218,6 @@ func (c *chainClient) RetrieveEvent_Audit_SubmitIdleVerifyResult(blockhash types
vf := reflect.ValueOf(v.Value)
if vf.Len() > 0 {
allValue := fmt.Sprintf("%v", vf.Index(0))
// if strings.Contains(v.Name, "AccountId32.tee") {
// temp := strings.Split(allValue, "] ")
// puk := make([]byte, types.AccountIDLen)
// for _, v := range temp {
// if strings.Count(v, " ") == (types.AccountIDLen - 1) {
// subValue := strings.TrimPrefix(v, "[")
// ids := strings.Split(subValue, " ")
// if len(ids) != types.AccountIDLen {
// continue
// }
// for kk, vv := range ids {
// intv, _ := strconv.Atoi(vv)
// puk[kk] = byte(intv)
// }
// }
// }

// accid, err := types.NewAccountID(puk)
// if err != nil {
// continue
// }
// suc = true
// result.Tee = *accid
// }
if strings.Contains(v.Name, "AccountId32.miner") {
temp := strings.Split(allValue, "] ")
puk := make([]byte, types.AccountIDLen)
Expand Down
14 changes: 8 additions & 6 deletions chain/fileBank.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,14 @@ func (c *chainClient) CreateBucket(owner_pkey []byte, name string) (string, erro

buckets, err := c.QueryBucketList(owner_pkey)
if err != nil {
return txhash, errors.Wrap(err, "[QueryBucketList]")
}

for _, v := range buckets {
if utils.CompareSlice(v, []byte(name)) {
return "", nil
if err.Error() != pattern.ERR_Empty {
return txhash, errors.Wrap(err, "[QueryBucketList]")
}
} else {
for _, v := range buckets {
if utils.CompareSlice(v, []byte(name)) {
return "", nil
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/CESSProject/go-keyring v0.0.0-20220614131247-ee3a8da30fde
github.com/CESSProject/p2p-go v0.1.12
github.com/CESSProject/p2p-go v0.1.13
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cbergoon/merkletree v0.2.0
github.com/centrifuge/go-substrate-rpc-client/v4 v4.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CESSProject/go-keyring v0.0.0-20220614131247-ee3a8da30fde h1:5MDRjjtg6PEhqyVjupwaapN96cOZiddOGAYwKQeaTu0=
github.com/CESSProject/go-keyring v0.0.0-20220614131247-ee3a8da30fde/go.mod h1:RUXBd3ROP98MYepEEa0Y0l/T0vQlIKqFJxI/ocdnRLM=
github.com/CESSProject/p2p-go v0.1.12 h1:q4QjJs1iSiyyPis3TXeFvgKsY2CaH0zVUOQmqp5+Bgc=
github.com/CESSProject/p2p-go v0.1.12/go.mod h1:+hN9tEOCcS812sMgLLEANMOccUCk6wc0lGc/hytv06Q=
github.com/CESSProject/p2p-go v0.1.13 h1:92fZiy3p8mlWtOu5PJWgHBF4wqy+jjyck0hwrV0DBoc=
github.com/CESSProject/p2p-go v0.1.13/go.mod h1:+hN9tEOCcS812sMgLLEANMOccUCk6wc0lGc/hytv06Q=
github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM=
github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
Expand Down

0 comments on commit d0713fc

Please sign in to comment.