Code Monkey home page Code Monkey logo

Comments (12)

lookjoil avatar lookjoil commented on August 16, 2024 1

It worked.
Thank you very much.

from eos-sharp.

mmcs85 avatar mmcs85 commented on August 16, 2024

Did a commit with some fixes and a unit test for this.
Owner and active key must be a authority Structure.
Sync the source code.

Something like this should work now.

var result = await Eos.CreateTransaction(new Transaction()
{
    Actions = new List<Api.v1.Action>()
    {
        new Api.v1.Action()
        {
            Account = "eosio",
            Authorization = new List<PermissionLevel>()
            {
                new PermissionLevel() {Actor = "tester112345", Permission = "active"}
            },
            Name = "newaccount",
            Data = new {
                creator = "tester112345",
                name = "mynewaccount",
                owner = new {
                    threshold = 1,
                    keys = new List<object>() {
                        new { key = "EOS8Q8CJqwnSsV4A6HDBEqmQCqpQcBnhGME1RUvydDRnswNngpqfr", weight = 1}
                    }
                },
                active = new {
                    threshold = 1,
                    keys = new List<object>() {
                        new { key = "EOS8Q8CJqwnSsV4A6HDBEqmQCqpQcBnhGME1RUvydDRnswNngpqfr", weight = 1}
                    }
                }
            }
        },
        new Api.v1.Action()
        {
            Account = "eosio",
            Authorization = new List<PermissionLevel>()
            {
                new PermissionLevel() { Actor = "tester112345", Permission = "active"}
            },
            Name = "buyrambytes",
            Data = new {
                payer = "tester112345",
                receiver = "mynewaccount",
                bytes = 8192,
            }
        },
        new Api.v1.Action()
        {
            Account = "eosio",
            Authorization = new List<PermissionLevel>()
            {
                new PermissionLevel() { Actor = "tester112345", Permission = "active"}
            },
            Name = "delegatebw",
            Data = new {
                from = "tester112345",
                receiver = "mynewaccount",
                stake_net_quantity = "1.0000 EOS",
                stake_cpu_quantity = "1.0000 EOS",
                transfer = false,
            }
        }
    }
});

from eos-sharp.

lookjoil avatar lookjoil commented on August 16, 2024

Thank you for your help.
But I still got "Out of Range" message using your code.

from eos-sharp.

mmcs85 avatar mmcs85 commented on August 16, 2024

Did you get the master latest version? I did a commit to fix those errors.

from eos-sharp.

lookjoil avatar lookjoil commented on August 16, 2024

Yes, I tested with the master latest version. Have you tested?

from eos-sharp.

mmcs85 avatar mmcs85 commented on August 16, 2024

Yes I did.
Created unittest here: https://github.com/GetScatter/eos-sharp/blob/master/EosSharp/EosSharp.UnitTests/EosUnitTests.cs#L184

If you debug and create a breakpoint and it pass this line:
https://github.com/GetScatter/eos-sharp/blob/master/EosSharp/EosSharp/Eos.cs#L308

It means the transaction is packed and ready to be sent. The out of range erros is packing the trx.

Please can you show more detail on the exception? Stack trace etc?

from eos-sharp.

lookjoil avatar lookjoil commented on August 16, 2024

The trx is packed and sent successfully.
"out of range" message is responsed from the EOS mainnet:
{"code":500,"error":{"code":8,"name":"out_of_range_exception","what":"Out of Range","details":[]}

from eos-sharp.

lookjoil avatar lookjoil commented on August 16, 2024

I have tested https://github.com/GetScatter/eos-sharp/blob/master/EosSharp/EosSharp.UnitTests/EosUnitTests.cs#L184 on EOS mainnet,
and got the same error.

from eos-sharp.

mmcs85 avatar mmcs85 commented on August 16, 2024

Ok then show me the output information that serializes the exception throw.

from eos-sharp.

lookjoil avatar lookjoil commented on August 16, 2024

{"code":500,"error":{"code":8,"name":"out_of_range_exception","what":"Out of Range","details":[]},"Message":"引发类型为“EosSharp.Exceptions.ApiErrorException”的异常。","Data":{},"InnerException":null,"TargetSite":{"Name":"MoveNext","AssemblyName":"EosSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","ClassName":"EosSharp.Helpers.HttpHelper+d__18","Signature":"Void MoveNext()","Signature2":"System.Void MoveNext()","MemberType":8,"GenericArguments":null},"StackTrace":" 在 EosSharp.Helpers.HttpHelper.d__18.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() 在 EosSharp.Helpers.HttpHelper.<SendAsync>d__12.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)" 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
在 EosSharp.Helpers.HttpHelper.d__61.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
在 EosSharp.Api.v1.EosApi.d__22.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() 在 EosSharp.Eos.<CreateTransaction>d__30.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
在 EosSharp.UnitTests.EosUnitTests.d__12.MoveNext() 位置 D:\tt\eos-sharp-master(3)\eos-sharp-master\EosSharp\EosSharp.UnitTests\EosUnitTests.cs:行号 189","HelpLink":null,"Source":"EosSharp","HResult":-2146233088}

from eos-sharp.

mmcs85 avatar mmcs85 commented on August 16, 2024

Ok thank you for your efford. I was getting a out of range inside eos-sharp. But with your exception I can see is now throwing from nodeos. Managed to replicate.

Looking into it.

from eos-sharp.

mmcs85 avatar mmcs85 commented on August 16, 2024

This commit fixs this problems 54ff219

Check the unit test for a working new version.

from eos-sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.