Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Conversation

@p0lunin
Copy link
Contributor

@p0lunin p0lunin commented Nov 30, 2020

Server api implementation for node.
A part of #468.
Schema of api: https://github.com/stellar/slingshot/blob/main/node/api.md

height,
prev: prev.0,
timestamp_ms,
txroot: txroot.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use the Hash type that we already have?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is hard question about newtypes. API users should not be aware of what newtypes we use inside the application. But using them will make code a little easier because they are used internally by the application.

.or(submit(bc))
}

fn status(bc: BlockchainRef) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more readable if those routes were declared as local variables instead of functions? Then we wouldn't need those long return type definitions all over the place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated by e498280

) -> ResponseResult<responses::NewReceiver> {
let mut wallet_ref = wallet.write().await;
let update_wallet = |wallet: &mut Wallet| {
let requests::NewReceiver { flv, qty, exp } = req; // TODO: expiration time?
Copy link
Contributor

@oleganza oleganza Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. I'm starting to think that the expiration time is the storage policy of the node. How about we remove this parameter from the request entirely for now?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants