Skip to content

Commit

Permalink
expose auction result fields
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Jul 25, 2024
1 parent 147fba7 commit 8908bbc
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions types/src/v0/impls/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use std::str::FromStr;
use thiserror::Error;
use url::Url;

use super::v0_3::AuctionResults;

impl FullNetworkTx {
/// Proxy for `execute` method of each transaction variant.
pub fn execute(&self, state: &mut ValidatedState) -> Result<(), ExecutionError> {
Expand Down Expand Up @@ -145,6 +147,32 @@ impl From<FeeError> for ExecutionError {
}
}

impl AuctionResults {
pub fn new(
view_number: ViewNumber,
winning_bids: Vec<BidTx>,
reserve_bids: Vec<(NamespaceId, Url)>,
) -> Self {
Self {
view_number,
winning_bids,
reserve_bids,
}
}

pub fn get_view(&self) -> ViewNumber {
self.view_number
}

pub fn get_winning_bids(&self) -> &Vec<BidTx> {
&self.winning_bids
}

pub fn get_reserve_bids(&self) -> &Vec<(NamespaceId, Url)> {
&self.reserve_bids
}
}

impl BidTx {
/// Execute `BidTx`.
/// * verify signature
Expand Down Expand Up @@ -213,6 +241,10 @@ impl BidTx {
pub fn account(&self) -> FeeAccount {
self.body.account
}

pub fn get_view(&self) -> ViewNumber {
self.body.view
}
}

impl HasUrls for BidTx {
Expand Down

0 comments on commit 8908bbc

Please sign in to comment.