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

offline transfer report error #3

Open
liuzhijun23 opened this issue Dec 10, 2018 · 1 comment
Open

offline transfer report error #3

liuzhijun23 opened this issue Dec 10, 2018 · 1 comment

Comments

@liuzhijun23
Copy link

I use the offline transfer function,the code as follow:
`static void transferOffline() throws Exception{
// --- get the current state of blockchain
EosApi eosApi = EosApiFactory.create("http://192.168.1.75:8888");
SignArg arg = eosApi.getSignArg(120);
System.out.println(eosApi.getObjectMapper().writeValueAsString(arg));

    // --- sign the transation of token tansfer
    String privateKey = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3";//replace the real private key
    String from1 = "acca";
    String to1 = "accb";
    String quantity = "100 SYS";
    String memo = "sent by eos sdk";
    LocalApi localApi = EosApiFactory.createLocalApi();
    PushTransactionRequest req = localApi.transfer(arg, privateKey, from1, to1, quantity, memo);
    System.out.println(localApi.getObjectMapper().writeValueAsString(req));


    // --- push the signed-transaction to the blockchain
    PushedTransaction pts = eosApi.pushTransaction(req);
    System.out.println(localApi.getObjectMapper().writeValueAsString(pts));
}`

But it report error as follow:
Exception in thread "main" io.jafka.jeos.exception.EosApiException: Internal Service Error: eosio_assert_message assertion failure at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:61) at io.jafka.jeos.impl.EosApiRestClientImpl.pushTransaction(EosApiRestClientImpl.java:131) at org.web3j.sample.TestEOS.transferOffline(TestEOS.java:129) at org.web3j.sample.TestEOS.main(TestEOS.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

I can use offline transfer function with another SDK eos4j-1.0.2.jar.I think there are something wrong with
this SDK.Please help!

@liuzhijun23
Copy link
Author

I find the reason now.The error is because I pass the quantity string "100 SYS",the quantity string should be "100.0000 SYS".

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

No branches or pull requests

1 participant