-
Notifications
You must be signed in to change notification settings - Fork 38
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
发送交易时报错 #2
Comments
看起来是无法反序列化,你将反序列化失败的文本输出来看看。 另外内容可以markdown格式化下 |
我现在在仿真,在源码里面打断点调试 |
已经修复了此问题,临时发布了SNAPSHOT版本 0.9.14版本 http://repo1.maven.org/maven2/io/jafka/jeos/0.9.14/ 已经发布,预计未来几个小时会同步到全网。 |
新版本有Gradle版本吗? |
可以了 已经同步了
|
功能已经正常了,可以正常转账了,给大神点赞! |
请问大神一个问题,如果在android App上面调用这个库来转账,上面说的在线转账需要启动keosd服务所以不能用,这种情况需要用离线签名转账方式。这个函数: |
`@Override
这里已经把代币名称(eosio.token)写死在函数源码里,需要设置成参数让用户去设置。 |
@liuzhijun23 Hi Thanks you so much! |
I have a smart contract with the method name is |
我在本地建立了一条私有链,用你的SDK的例子,查询余额操作正常,但是在发送交易的时候,报错:
我的程序是:
`public class TestEOS {
public static String url_wallet = "http://192.168.1.75:18888";
public static String url_chain = "http://192.168.1.75:8888";//"http://jungle.cryptolions.io:18888"
public static EosApi client;
public static void main(String[] args) throws Exception{
BasicConfigurator.configure();
client = EosApiFactory.create(url_wallet, url_chain, url_chain);
ChainInfo info = client.getChainInfo();
//System.out.println("chain info:"+info);
}
报的错误是:
Exception in thread "main" io.jafka.jeos.exception.EosApiException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance ofio.jafka.jeos.core.common.transaction.TransactionAuthorization
(no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 242] (through reference chain: io.jafka.jeos.core.common.transaction.SignedPackedTransaction["actions"]->java.util.ArrayList[0]->io.jafka.jeos.core.common.transaction.TransactionAction["authorization"]->java.util.ArrayList[0])
at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:64)
at io.jafka.jeos.impl.EosApiRestClientImpl.signTransaction(EosApiRestClientImpl.java:210)
at org.web3j.sample.TestEOS.transfer(TestEOS.java:95)
at org.web3j.sample.TestEOS.main(TestEOS.java:46)
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)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of
io.jafka.jeos.core.common.transaction.TransactionAuthorization
(no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 242] (through reference chain: io.jafka.jeos.core.common.transaction.SignedPackedTransaction["actions"]->java.util.ArrayList[0]->io.jafka.jeos.core.common.transaction.TransactionAction["authorization"]->java.util.ArrayList[0])
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1028)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1297)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1611)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1203)
at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32)16:23:48.399 [main] INFO io.jafka.jeos.impl.LoggingInterceptor - OkHttp-6-3--<head http://192.168.1.75:18888/v1/wallet/sign_transaction 9ms Connection: close`
我在本地执行json-rpc命令:
curl http://192.168.1.75:18888/v1/wallet/sign_transaction -d ' [ { "expiration" : "2018-12-07T06:46:48", "ref_block_num" : 56141, "ref_block_prefix" : 3654011199, "max_net_usage_words" : 0, "max_cpu_usage_ms" : 0, "context_free_actions" : [ ], "actions" : [ { "account" : "acctoken", "name" : "transfer", "authorization" : [ { "actor" : "acca", "permission" : "active" } ], "data" : "0000000000601032000000000070103240420f000000000004535953000000000fe68891e698afe4b8ade59bbde4baba" } ], "transaction_extensions" : [ ], "context_free_data" : [ ], "region" : "0" }, [ "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" ], "38dc6e87bb9f6b33a21dd56b9f2c24813d83c71009077279c8d746fbd0eaf09d" ] '
是由结果的:
{"expiration":"2018-12-07T06:46:48","ref_block_num":56141,"ref_block_prefix":3654011199,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"acctoken","name":"transfer","authorization":[{"actor":"acca","permission":"active"}],"data":"0000000000601032000000000070103240420f000000000004535953000000000fe68891e698afe4b8ade59bbde4baba"}],"transaction_extensions":[],"signatures":["SIG_K1_JyNeuGBhirhUC7nLcZTxPiUKxBmTTD3dRRDbyDEpMMuTq6qTawuaG1jsGs4hKQRBYTGJzQwWyyLdwwJ7U8CevJtMdX389A"],"context_free_data":[]}
求大神帮忙看一下是什么原因。
The text was updated successfully, but these errors were encountered: