Comments (3)
Hi @epequeno ! Yes, it's quite tricky to find documentation about this one. The current struct is defined starting from a test call towards the API, which makes it a very poor solution. We don't know which fields are optional and which are not for instance.
Your reference seems to be the best source I am able to find. Another source comes from an automatic implementation of the client based on the Open API Schema that suggests the following implementation for the API response (completely avoiding the problem):
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineResponse2001 {
/// Block header data.
#[serde(rename = "block")]
pub block: serde_json::Value,
/// Optional certificate object. This is only included when the format is set to message pack.
#[serde(rename = "cert", skip_serializing_if = "Option::is_none")]
pub cert: Option<serde_json::Value>,
}
If we are not able to find solid docs this solution might be the less error-prone.
from algonaut.
I'd like to pick this one up, I think I'll need a bit more info to start on this though.
This is the BlockHeader
in algod we should be looking at right?
https://github.com/algorand/go-algorand/blob/91b8ca1ed7677f41815c06d7808a17077941c73b/data/bookkeeping/block.go#L38
Which I believe correlates to this struct in the algod messages module:
algonaut/algonaut_client/src/algod/v2/message.rs
Lines 650 to 667 in b8d19c6
I've tried to line these fields up side by side but it reveals that I'm not sure exactly how to map them to each other:
earn: Option<u64>,
fees: String,
frac: u64,
gen: String, GenesisID string
gh: String, GenesisHash crypto.Digest
prev: String,
proto: String,
rate: u64,
rnd: u64, Round basics.Round
rwcalr: u64,
rwd: String, RewardsState
seed: String, Seed committee.Seed
ts: u64, TimeStamp int64
txn: String, TxnRoot crypto.Digest
Branch BlockHash
UpgradeState
UpgradeVote
TxnCounter uint64
CompactCert map[protocol.CompactCertType]CompactCertState
I'd like to check in and confirm if I'm on the right track and to ask if you could provide any further guidance on how to proceed.
from algonaut.
Closing this, as it seems not urgent and it would be solved as part of #164 and #165
from algonaut.
Related Issues (20)
- `Transaction::note` is a base64 string, but should probably be decoded. HOT 1
- Indexer just launched new version. HOT 5
- ABI support
- Atomic Transaction Composer support
- Consider adding checked arithmetic operations to `MicroAlgos`
- Populate `PendingTransaction.txn`
- Newtypes for app id, asset id, tx id HOT 5
- OpenAPI basic functionality
- OpenAPI types customization
- Add traits for a leaner transaction creation API HOT 4
- Support request retry?
- Add GetApplicationAddress from Algorand SDK HOT 2
- Automated tests stopped working
- Review crate structure HOT 1
- Example `key_reg` stopped working
- Add support for Boxes HOT 11
- Build error when importing `algonaut_transaction` HOT 2
- Implement Logic Crate HOT 2
- querying by tx id fails HOT 1
- Implement Clone on Algod
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algonaut.