-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Mobile backend issues #20941
Comments
Originally |
We currently don't have the time to work on these issues. If someone wants to pick it up, please feel free! If you have any questions, you can ask here or ask me on gitter directly. It's really not a hard issue, most of it is essentially cleaning up the java api. |
@MariusVanDerWijden Does it also make sense to implement the Stringer interface for the above mentioned types ? |
Yeah, I would say so. We are using golang's mobile package (https://github.com/golang/mobile) to generate the java library. If we implement the stringer interface, we should automatically get the |
Yes. I'd love to try it. |
An error in golang is always a stringer, so you could return the string representation of the error. But I think that might not be the best idea. I would prefer, if you returned nil, because than the caller can test if |
The method signature for |
We are currently thinking about fixing some bugs in the mobile backend.
This issue shall act as an umbrella issue to collect some of the quirks of the backend that could be improved in the future. If you have any suggestions, feel free to add.
All functions are undocumented
Maybe we can find a way to insert Javadoc into the generated.aar
Address.toString() returns {}Address
In order to get the proper hex representation of the address, you need to call Address.getHex(). The method .toString() should return a proper printable representation of the object.
Hash.toString() returns {}Hash
In order to get the proper representation you need to call Hash.getHex()
Block.toString() returns {}Block
In order to get a serialized form of block, you need to call block.encodeJson()
Transaction.toString() returns {}Transaction
In order to get a serialized form of a transaction, you need to call tx.encodeJson()
Header.toString() returns {}Header
In order to get a serialized form of a header, you need to call header.encodeJson()
FoundationBootnodes() only returns mainnet bootnodes
Currently developers are afaics not able to connect to the testnets without having to input a v5 enabled bootnode themselves. See params, cmd/utils, mobile: remove DiscoveryV5Bootnodes #20949
Remove the enodes type
Type aliases for array types complicate the java code a lot. To add a enode to your config you have to run the following code.
If we remove the enodes type and let setBootstrapNodes accept an array of Enode, it could look something like this:
Currently a lot of our code can panic, e.g. the reflection code used in mobile/interfaces.go. If a code panics, the resulting panic is not returned to the application, the application just stops working. This is not acceptable, we should write a small layer that checks for panics and returns an error if a panic occured.
The text was updated successfully, but these errors were encountered: