make-software / casper-net-sdk

.NET SDK to interact with the Casper Network nodes via RPC
Apache License 2.0
13 stars 14 forks source link

Standard Tests: CLTypes: Complex types not exposing inner types #40

Closed stormeye2000 closed 1 year ago

stormeye2000 commented 1 year ago

Hi

A complex type is created with inner simple types. Deploy is successful, the complex type is accessible but the inner types cannot be accessed to test their values. Java, Python and Typescript SDK's all pass this test

The complex types are here

The test is here

Happy to discuss this further

Many thanks

Telegram: @cnorburn

davidatwhiletrue commented 1 year ago

hi @stormeye2000

inner types should be aaccessible. For a boolean:

  var option1 = CLValue.Option(CLValue.Bool(true));
  var namedArg = new NamedArg("option1", option1);

  Console.WriteLine("Named Arg value bytes: " + Hex.ToHexString(namedArg.Value.Bytes));

  if (namedArg.Value.IsSome())
  {
      namedArg.Value.Some(out var v);
      Console.WriteLine("Named Arg value: " + v);
  }
  else
      Console.WriteLine("Named Arg value: none");

Please, let me know if for other types you can't get the values and I'll look at those. Thanks.

stormeye2000 commented 1 year ago

Thanks @davidatwhiletrue I can see that this works for Option and can use it in the test

But what about the other complex types?