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

[3.6.2] GetNativeContracts Exception #850

Closed
Devel484 opened this issue Nov 24, 2023 · 1 comment · Fixed by #851
Closed

[3.6.2] GetNativeContracts Exception #850

Devel484 opened this issue Nov 24, 2023 · 1 comment · Fixed by #851

Comments

@Devel484
Copy link

Describe the bug
Calling the RPC Method GetNativeContracts results in an exception on client side. RPC side is sending a json object without the field updatehistory, but Client side is expecting the field.

public static RpcNativeContract FromJson(JObject json)
{
return new RpcNativeContract
{
Id = (int)json["id"].AsNumber(),
Hash = UInt160.Parse(json["hash"].AsString()),
Nef = RpcNefFile.FromJson((JObject)json["nef"]),
Manifest = ContractManifest.FromJson((JObject)json["manifest"]),
UpdateHistory = ((JArray)json["updatehistory"]).Select(u => (uint)u.GetInt32()).ToArray()
};
}

public static JObject NativeContractToJson(this NativeContract contract, ProtocolSettings settings)
{
return new JObject
{
["id"] = contract.Id,
["hash"] = contract.Hash.ToString(),
["nef"] = contract.Nef.ToJson(),
["manifest"] = contract.Manifest.ToJson()
};
}

@shargon
Copy link
Member

shargon commented Nov 24, 2023

I will remove it also in client according to #828

shargon added a commit that referenced this issue Nov 24, 2023
superboyiii pushed a commit that referenced this issue Nov 29, 2023
* Fix RpcNativeContract

Close #850

* Fix UT
superboyiii added a commit that referenced this issue Nov 29, 2023
@superboyiii superboyiii mentioned this issue Nov 29, 2023
superboyiii added a commit that referenced this issue Nov 29, 2023
Jim8y added a commit to Jim8y/neo-modules that referenced this issue Dec 13, 2023
* 'master' of github.com:neo-project/neo-modules:
  Fix workflow (neo-project#857)
  Fix stack exception name (neo-project#855)
  update workflow (neo-project#856)
  Refac build configs (neo-project#846)
  Hotfix for neo-project#850 (neo-project#853)
  Fix RpcNativeContract (neo-project#851)
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 a pull request may close this issue.

2 participants