provablehq / aleo-rust Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
As of a few weeks ago, I was able to successfully find unspent records and execute private transfers on testnet. However now something seems wrong the AleoApiClient
. When trying to find unspent records, I get this error:
Error: Failed to parse blocks 5050 (inclusive) to 5099 (exclusive): Failed to read JSON: Failed to parse string. Parsing Error: VerboseError { errors: [("sr1yvt089c2zf09hhuzrxaty20ymjyz3sz6x2rkje9c7a86kn9tevxsm4gpd5", Nom(OneOf)), ("sr1yvt089c2zf09hhuzrxaty20ymjyz3sz6x2rkje9c7a86kn9tevxsm4gpd5", Nom(Many1))] } at line 1034 column 3
That error comes from AleoApiClient.get_blocks. When I drill down the call stack, I can get the url it's hitting, and when I hit that in postman, it's valid json. It also fails for a similar reason when just getting a single block with get_block
. According to the line/col numbers, it seems to fail at the last character of the response, despite being valid json.
I notice there's a reference to nom in the errors, which is a dep of some of the snarkvm packages.
aleo_rust
hasn't been updated in months, and is using the old, version 14 of snarkvm
, while the most recent version is 16, perhaps that's related? Although I don't know why my code was working before.
use aleo_rust::AleoAPIClient;
use snarkvm_console::network::Testnet3;
let api_client = AleoAPIClient::<Testnet3>::new("https://apiv2.aleo.network", "testnet3").unwrap()
let block = api_client.get_block(5538).unwrap();
Error: Failed to parse blocks 5050 (inclusive) to 5099 (exclusive): Failed to read JSON: Failed to parse string. Parsing Error: VerboseError { errors: [("sr1yvt089c2zf09hhuzrxaty20ymjyz3sz6x2rkje9c7a86kn9tevxsm4gpd5", Nom(OneOf)), ("sr1yvt089c2zf09hhuzrxaty20ymjyz3sz6x2rkje9c7a86kn9tevxsm4gpd5", Nom(Many1))] } at line 1034 column 3
It was supposed to get the block instead of erroring out.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.