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

Methods mig to zbox #1685

Open
wants to merge 21 commits into
base: sprint-1.18
Choose a base branch
from
Open

Methods mig to zbox #1685

wants to merge 21 commits into from

Conversation

smaulik13
Copy link
Collaborator

Changes

Fixes

Tests

Tasks to complete before merging PR:

  • Ensure system tests are passing. If not Run them manually to check for any regressions 📋
  • Do any new system tests need added to test this change? do any existing system tests need updated? If so create a PR at 0chain/system_test
  • Merge your system tests PR to master AFTER merging this PR

Associated PRs (Link as appropriate):

  • blobber:
  • 0chain:
  • system_test:
  • zboxcli:
  • zwalletcli:
  • Other: ...

@@ -324,6 +326,7 @@ func InitSDK(walletJSON string,
return err
}
SetSdkInitialized(true)
node.SetIsWasm(true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't force it for everyone using gosdk.

Set it in wasm initialisation and mobile initialisation (we need to use it on mobile as well, perhaps change the name to something resonable).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This InitSdk method is being called from both sdks only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is called from other repos using gosdk as well. We need to get it in input. Gosdk is used in 0box, blobber, CLIs and 0chain. Everywhere it can't use 0box.

@@ -177,7 +181,7 @@ func GetMinerSCNodeInfo(id string) ([]byte, error) {
return nil, err
}

return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_NODE, Params{
return node.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_NODE, Params{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use 0box calls here? If not why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used by any sdk (wasm or mobile).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

func GetMiners(active, stakable bool, limit, offset int) ([]byte, error) {
if err := CheckConfig(); err != nil {
return nil, err
}

return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{
return node.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAA

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still we can use "MakeSCRestAPICall" to protect in future. It will not create any problem right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not implemented in zbox

@@ -213,7 +220,7 @@ func GetSharders(active, stakable bool, limit, offset int) ([]byte, error) {
return nil, err
}

return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{
return node.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here and in multiple places in same file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smaulik13 smaulik13 closed this Nov 26, 2024
@smaulik13 smaulik13 reopened this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants