Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor with common-sdk integration #21

Open
wants to merge 40 commits into
base: staging
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
fe75c8b
refactoring
smaulik13 Jan 8, 2025
dacfe33
refactoring 2
smaulik13 Jan 8, 2025
f7ec7e6
fix
smaulik13 Jan 8, 2025
295d20d
fix 2
smaulik13 Jan 8, 2025
e07625b
refactor
smaulik13 Jan 16, 2025
8102de5
refactor 2
smaulik13 Jan 16, 2025
d649bba
wasm refactor
smaulik13 Jan 16, 2025
b59dcf4
refactor 2
smaulik13 Jan 16, 2025
fcca97e
refactor 3
smaulik13 Jan 16, 2025
f01b993
fix
smaulik13 Jan 17, 2025
a0ce8cc
added version
smaulik13 Jan 17, 2025
cd7b1e1
wasm fix
smaulik13 Jan 17, 2025
bdbf983
revert some changes
smaulik13 Jan 17, 2025
3fb79d2
revert changes
smaulik13 Jan 17, 2025
2ee8e28
fix
smaulik13 Jan 17, 2025
bae7a6e
revert
smaulik13 Jan 17, 2025
0f7477d
lint fix
smaulik13 Jan 17, 2025
e49091c
version update
smaulik13 Jan 17, 2025
59f3dd8
gosdk to common
smaulik13 Jan 17, 2025
eb3184b
common update
smaulik13 Jan 17, 2025
088847b
dumy
smaulik13 Jan 17, 2025
f2d815f
dummy
smaulik13 Jan 17, 2025
9b4ae2c
core changes
smaulik13 Jan 21, 2025
7775b2f
updated changes
smaulik13 Jan 21, 2025
acb0596
windows build fix
smaulik13 Jan 22, 2025
8bd0f07
revert changes
smaulik13 Jan 22, 2025
92fabe3
common sdk update version
smaulik13 Jan 22, 2025
f83199a
refactor
smaulik13 Jan 23, 2025
f467a95
added v2 enpoint
smaulik13 Jan 23, 2025
816f388
delete file
smaulik13 Jan 23, 2025
6545972
updates
smaulik13 Jan 24, 2025
29a8e71
updates
smaulik13 Jan 24, 2025
9445d47
fixes
smaulik13 Feb 1, 2025
de1ffc8
fixes
smaulik13 Feb 1, 2025
5d8f32c
some refactor
smaulik13 Feb 3, 2025
dcf5a69
refactor
smaulik13 Feb 3, 2025
93191f4
refactor
smaulik13 Feb 4, 2025
5586b1e
added gosdk leftover changes
smaulik13 Feb 27, 2025
fea75d5
added alloc version check for rollback
smaulik13 Feb 28, 2025
23dfbea
added fix
smaulik13 Mar 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
common sdk update version
smaulik13 committed Jan 22, 2025
commit 92fabe3af5bf42c070444f2c93e7456564ca581f
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ require (
)

require (
github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e
github.com/0chain/gosdk_common v0.0.0-20250122192236-7180658d2e00
github.com/hack-pad/go-webworkers v0.1.0
github.com/minio/sha256-simd v1.0.1
github.com/valyala/bytebufferpool v1.0.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -44,10 +44,10 @@ github.com/0chain/common v1.18.3 h1:42dYOv2KyMTSanuS67iDtfv+ErbSRqR8NJ3MG72MwaI=
github.com/0chain/common v1.18.3/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw=
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_common v0.0.0-20250117135422-7c4f2f249631 h1:UGvlsDCcYL8G+GNweLzmWKPcpLG7F1VKQwORugtbTNw=
github.com/0chain/gosdk_common v0.0.0-20250117135422-7c4f2f249631/go.mod h1:5MtnciUdibSOd2nDEWw346eWXmvpZZAywwrgFm/qmKM=
github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e h1:TskvG+KrEWp4obrELJk1QRX3tjnsr1mlBapeb1fV2cU=
github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e/go.mod h1:5MtnciUdibSOd2nDEWw346eWXmvpZZAywwrgFm/qmKM=
github.com/0chain/gosdk_common v0.0.0-20250122192236-7180658d2e00 h1:wXxNBOnZxE1nG+6oKjdK5S58yckasW0W8UW2h70ZZTc=
github.com/0chain/gosdk_common v0.0.0-20250122192236-7180658d2e00/go.mod h1:5MtnciUdibSOd2nDEWw346eWXmvpZZAywwrgFm/qmKM=
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/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=

Unchanged files with check annotations Beta

// - params is the query parameters
// - handler is the handler function to handle the response
func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string, handler SCRestAPIHandler) ([]byte, error) {
numSharders := len(blockchain.GetSharders())

Check failure on line 936 in zboxcore/zboxutil/http.go

GitHub Actions / go-test

undefined: blockchain.GetSharders

Check failure on line 936 in zboxcore/zboxutil/http.go

GitHub Actions / lint

undefined: blockchain.GetSharders
sharders := blockchain.GetSharders()

Check failure on line 937 in zboxcore/zboxutil/http.go

GitHub Actions / go-test

undefined: blockchain.GetSharders

Check failure on line 937 in zboxcore/zboxutil/http.go

GitHub Actions / lint

undefined: blockchain.GetSharders
responses := make(map[int]int)
mu := &sync.Mutex{}
entityResult := make(map[string][]byte)
client := &http.Client{Transport: DefaultTransport}
response, err := client.Get(urlObj.String())
if err != nil {
blockchain.Sharders.Fail(sharder)

Check failure on line 969 in zboxcore/zboxutil/http.go

GitHub Actions / go-test

undefined: blockchain.Sharders

Check failure on line 969 in zboxcore/zboxutil/http.go

GitHub Actions / lint

undefined: blockchain.Sharders
return
}
entityBytes, _ := io.ReadAll(response.Body)
mu.Lock()
if response.StatusCode > http.StatusBadRequest {
blockchain.Sharders.Fail(sharder)

Check failure on line 977 in zboxcore/zboxutil/http.go

GitHub Actions / go-test

undefined: blockchain.Sharders

Check failure on line 977 in zboxcore/zboxutil/http.go

GitHub Actions / lint

undefined: blockchain.Sharders
} else {
blockchain.Sharders.Success(sharder)

Check failure on line 979 in zboxcore/zboxutil/http.go

GitHub Actions / go-test

undefined: blockchain.Sharders

Check failure on line 979 in zboxcore/zboxutil/http.go

GitHub Actions / lint

undefined: blockchain.Sharders
}
responses[response.StatusCode]++
if responses[response.StatusCode] > maxCount {
}
entityResult[sharder] = entityBytes
blockchain.Sharders.Success(sharder)

Check failure on line 992 in zboxcore/zboxutil/http.go

GitHub Actions / go-test

undefined: blockchain.Sharders

Check failure on line 992 in zboxcore/zboxutil/http.go

GitHub Actions / lint

undefined: blockchain.Sharders (typecheck)
mu.Unlock()
}(sharder)
}
// Utility functions to support the functionality of the SDK.

Check failure on line 1 in zboxcore/zboxutil/doc.go

GitHub Actions / lint

: # github.com/0chain/gosdk/zboxcore/zboxutil [github.com/0chain/gosdk/zboxcore/zboxutil.test]
package zboxutil
}
type statusBar struct {

Check failure on line 59 in wasmsdk/demo/main.go

GitHub Actions / lint

type `statusBar` is unused (unused)
walletString string
wg *sync.WaitGroup
success bool
return err
}
func (a *Allocation) createDir(remotePath string, threshConsensus, fullConsensus int, mask zboxutil.Uint128) error {

Check failure on line 2131 in zboxcore/sdk/allocation.go

GitHub Actions / lint

func `(*Allocation).createDir` is unused (unused)
if !a.isInitialized() {
return notInitialized
}
const objAlreadyExists = "Object Already exists"
func (req *CopyRequest) getObjectTreeFromBlobber(blobber *blockchain.StorageNode) (fileref.RefEntity, error) {

Check failure on line 50 in zboxcore/sdk/copyworker.go

GitHub Actions / lint

func `(*CopyRequest).getObjectTreeFromBlobber` is unused (unused)
return getObjectTreeFromBlobber(req.ctx, req.allocationID, req.allocationTx, req.sig, req.remotefilepath, blobber, req.allocationObj.Owner)
}