sablier-labs / v2-merkle-api

https://v2-services.vercel.app
GNU General Public License v3.0
4 stars 0 forks source link

refactor: improve initial project setup #1

Closed gavriliumircea closed 11 months ago

gavriliumircea commented 11 months ago

This PR aims to implement all the changes discussed with @razgraf.

razgraf commented 11 months ago

We'll probably need the hex representation of both the root and the proof instead of u8 arrays. Apart from api/eligibility and api/campaign should we also return them within api/upload?


I'm currently playing with the eligibility route and added two extra items to the response so I can hopefully use them when interacting with the contracts. Using the hex crate...

let response_json = &EligibilityResponse {
     index: recipient_index,
     proof: serialized_proof,
     proof_hex: proof.lemma().iter().map(|x| hex::encode(x)).collect(),
     root_hex: hex::encode(root),
};