Skip to content

Commit

Permalink
Fix/staking (#333)
Browse files Browse the repository at this point in the history
* updated gosdk version

* fixed staking logic
  • Loading branch information
dabasov committed Dec 10, 2022
1 parent 8b23668 commit 40f7be6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
11 changes: 1 addition & 10 deletions cmd/stakepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,12 @@ var spUnlock = &cobra.Command{
}
}

unstake, _, err := sdk.StakePoolUnlock(providerType, providerID, zcncore.ConvertToValue(fee))
_, _, err = sdk.StakePoolUnlock(providerType, providerID, zcncore.ConvertToValue(fee))
// an error
if err != nil {
log.Fatalf("Failed to unlock tokens in stake pool: %v", err)
}

// can't unlock for now
if !unstake {
fmt.Println("tokens can't be unlocked due to opened offers")
fmt.Printf("the pool marked as releasing, wait and retry to succeed")
fmt.Printf("to reduce blobber commitments cancel or finalize allocations")
fmt.Println()
return
}

// success
fmt.Println("tokens unlocked, pool deleted")
},
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.18

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.8.11-0.20221121192822-49dd90d47f7d
github.com/0chain/gosdk v1.8.11-0.20221210103558-6f8c39318910
github.com/icza/bitio v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.6.0
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.8.11-0.20221121192822-49dd90d47f7d h1:M/F36uMNaymknZZ3yiZoSuFqhxMbXiBLsVSdDQOGqo4=
github.com/0chain/gosdk v1.8.11-0.20221121192822-49dd90d47f7d/go.mod h1:sxM3NRQLwMWAzXKsKThR03lxHq03rtIMRODM/fdsZ3E=
github.com/0chain/gosdk v1.8.11-0.20221210103558-6f8c39318910 h1:oAfDVqlaxM1LeIHHRoCHH5gZMjlf50TilLU7RM5WBWE=
github.com/0chain/gosdk v1.8.11-0.20221210103558-6f8c39318910/go.mod h1:LpgbGOl7/r9H2pzNMY8bkxQ+jH8lAUNxgqQ5CbgnX8g=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o=
Expand Down Expand Up @@ -438,7 +438,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down

0 comments on commit 40f7be6

Please sign in to comment.