Skip to content

Commit

Permalink
add missing references
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Aug 3, 2020
1 parent fe99bb6 commit e3ecd55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions rust/src/fees.rs
Expand Up @@ -228,8 +228,8 @@ mod tests {
&Coin::new(1000000), // pledge
&Coin::new(1000000), // cost
&UnitInterval::new(
BigNum::new(3),
BigNum::new(100),
&BigNum::new(3),
&BigNum::new(100),
), // margin
&RewardAddress::new(
network,
Expand Down
14 changes: 7 additions & 7 deletions rust/src/lib.rs
Expand Up @@ -41,10 +41,10 @@ impl UnitInterval {
self.denominator.clone()
}

pub fn new(numerator: BigNum, denominator: BigNum) -> Self {
pub fn new(numerator: &BigNum, denominator: &BigNum) -> Self {
Self {
numerator: numerator,
denominator: denominator,
numerator: numerator.clone(),
denominator: denominator.clone(),
}
}
}
Expand Down Expand Up @@ -1195,12 +1195,12 @@ impl TransactionMetadata {
self.0.len()
}

pub fn insert(&mut self, key: TransactionMetadatumLabel, value: &TransactionMetadatum) -> Option<TransactionMetadatum> {
self.0.insert(key, value.clone())
pub fn insert(&mut self, key: &TransactionMetadatumLabel, value: &TransactionMetadatum) -> Option<TransactionMetadatum> {
self.0.insert(key.clone(), value.clone())
}

pub fn get(&self, key: TransactionMetadatumLabel) -> Option<TransactionMetadatum> {
self.0.get(&key).map(|v| v.clone())
pub fn get(&self, key: &TransactionMetadatumLabel) -> Option<TransactionMetadatum> {
self.0.get(key).map(|v| v.clone())
}
}

Expand Down

0 comments on commit e3ecd55

Please sign in to comment.