Skip to content

Commit 3422bcc

Browse files
authored
chore!: remove CoinStatus and block_created from Coin (#1664)
closing: #1663 # Breaking Changes removed `CoinStatus` and `created_at` from `Coin` ```rust //old pub struct Coin { pub amount: u64, pub block_created: u32, pub asset_id: AssetId, pub utxo_id: UtxoId, pub owner: Bech32Address, pub status: CoinStatus, } ``` ```rust //new pub struct Coin { pub amount: u64, pub asset_id: AssetId, pub utxo_id: UtxoId, pub owner: Bech32Address, } ```
1 parent 1bb6b69 commit 3422bcc

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

packages/fuels-core/src/types/wrappers/coin.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,21 @@ use fuel_core_client::client::types::{
88

99
use crate::types::bech32::Bech32Address;
1010

11-
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
12-
pub enum CoinStatus {
13-
#[default]
14-
Unspent,
15-
Spent,
16-
}
17-
1811
#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]
1912
pub struct Coin {
2013
pub amount: u64,
21-
pub block_created: u32,
2214
pub asset_id: AssetId,
2315
pub utxo_id: UtxoId,
2416
pub owner: Bech32Address,
25-
pub status: CoinStatus,
2617
}
2718

2819
impl From<ClientCoin> for Coin {
2920
fn from(coin: ClientCoin) -> Self {
3021
Self {
3122
amount: coin.amount,
32-
block_created: coin.block_created,
3323
asset_id: coin.asset_id,
3424
utxo_id: coin.utxo_id,
3525
owner: Bech32Address::from(coin.owner),
36-
status: CoinStatus::Unspent,
3726
}
3827
}
3928
}
@@ -43,11 +32,10 @@ impl From<Coin> for CoinConfig {
4332
Self {
4433
tx_id: *coin.utxo_id.tx_id(),
4534
output_index: coin.utxo_id.output_index(),
46-
tx_pointer_block_height: coin.block_created.into(),
47-
tx_pointer_tx_idx: Default::default(),
4835
owner: coin.owner.into(),
4936
amount: coin.amount,
5037
asset_id: coin.asset_id,
38+
..Default::default()
5139
}
5240
}
5341
}

packages/fuels-programs/src/calls/utils.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,7 @@ mod test {
345345
use std::slice;
346346

347347
use fuels_accounts::signers::private_key::PrivateKeySigner;
348-
use fuels_core::types::{
349-
coin::{Coin, CoinStatus},
350-
coin_type::CoinType,
351-
param_types::ParamType,
352-
};
348+
use fuels_core::types::{coin::Coin, coin_type::CoinType, param_types::ParamType};
353349
use rand::{Rng, thread_rng};
354350

355351
use super::*;
@@ -526,11 +522,9 @@ mod test {
526522
.map(|asset_id| {
527523
let coin = CoinType::Coin(Coin {
528524
amount: 100,
529-
block_created: 0u32,
530525
asset_id,
531526
utxo_id: Default::default(),
532527
owner: Default::default(),
533-
status: CoinStatus::Unspent,
534528
});
535529
Input::resource_signed(coin)
536530
})

packages/fuels-test-helpers/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use fuel_types::{AssetId, Nonce};
88
use fuels_accounts::provider::Provider;
99
use fuels_core::types::{
1010
bech32::Bech32Address,
11-
coin::{Coin, CoinStatus},
11+
coin::Coin,
1212
errors::Result,
1313
message::{Message, MessageStatus},
1414
};
@@ -96,8 +96,6 @@ pub fn setup_single_asset_coins(
9696
utxo_id,
9797
amount: amount_per_coin,
9898
asset_id,
99-
status: CoinStatus::Unspent,
100-
block_created: Default::default(),
10199
}
102100
})
103101
.collect();

0 commit comments

Comments
 (0)