Skip to content
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

rpc-sidecar: include new style bid records in auction info #259

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions rpc_sidecar/src/rpcs/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,17 @@ impl RpcWithOptionalParams for GetAuctionInfo {
.unwrap();

let state_identifier = block_identifier.map(GlobalStateIdentifier::from);
let bid_stored_values = node_client
let legacy_bid_stored_values = node_client
.query_global_state_by_tag(state_identifier, KeyTag::Bid)
.await
.map_err(|err| Error::NodeRequest("auction bids", err))?;
let bids = bid_stored_values
let bid_stored_values = node_client
.query_global_state_by_tag(state_identifier, KeyTag::BidAddr)
.await
.map_err(|err| Error::NodeRequest("auction bids", err))?;
let bids = legacy_bid_stored_values
.into_iter()
.chain(bid_stored_values.into_iter())
.map(|bid| bid.into_bid_kind().ok_or(Error::InvalidAuctionState))
.collect::<Result<Vec<_>, Error>>()?;

Expand Down