Skip to content

Commit

Permalink
remove byte price (#157)
Browse files Browse the repository at this point in the history
* remove byte price
  • Loading branch information
Voxelot authored and xgreenx committed Dec 20, 2022
1 parent ff646af commit 4134380
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 78 deletions.
8 changes: 0 additions & 8 deletions fuel-tx/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ impl<'a> TransactionBuilder<'a> {
Default::default(),
Default::default(),
Default::default(),
Default::default(),
salt,
storage_slots,
Default::default(),
Expand All @@ -41,7 +40,6 @@ impl<'a> TransactionBuilder<'a> {
Default::default(),
Default::default(),
Default::default(),
Default::default(),
script,
script_data,
Default::default(),
Expand Down Expand Up @@ -69,12 +67,6 @@ impl<'a> TransactionBuilder<'a> {
self
}

pub fn byte_price(&mut self, byte_price: Word) -> &mut Self {
self.tx.set_byte_price(byte_price);

self
}

pub fn maturity(&mut self, maturity: Word) -> &mut Self {
self.tx.set_maturity(maturity);

Expand Down
2 changes: 0 additions & 2 deletions fuel-tx/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use fuel_types::{Bytes32, Salt};
pub const TRANSACTION_SCRIPT_FIXED_SIZE: usize = WORD_SIZE // Identifier
+ WORD_SIZE // Gas price
+ WORD_SIZE // Gas limit
+ WORD_SIZE // Byte price
+ WORD_SIZE // Maturity
+ WORD_SIZE // Script size
+ WORD_SIZE // Script data size
Expand All @@ -16,7 +15,6 @@ pub const TRANSACTION_SCRIPT_FIXED_SIZE: usize = WORD_SIZE // Identifier
pub const TRANSACTION_CREATE_FIXED_SIZE: usize = WORD_SIZE // Identifier
+ WORD_SIZE // Gas price
+ WORD_SIZE // Gas limit
+ WORD_SIZE // Byte price
+ WORD_SIZE // Maturity
+ WORD_SIZE // Bytecode size
+ WORD_SIZE // Bytecode witness index
Expand Down
25 changes: 0 additions & 25 deletions fuel-tx/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub enum Transaction {
Script {
gas_price: Word,
gas_limit: Word,
byte_price: Word,
maturity: Word,
receipts_root: Bytes32,
script: Vec<u8>,
Expand All @@ -57,7 +56,6 @@ pub enum Transaction {
Create {
gas_price: Word,
gas_limit: Word,
byte_price: Word,
maturity: Word,
bytecode_length: Word,
bytecode_witness_index: u8,
Expand All @@ -83,7 +81,6 @@ impl Default for Transaction {
0,
ConsensusParameters::DEFAULT.max_gas_per_tx,
0,
0,
script,
vec![],
vec![],
Expand All @@ -97,7 +94,6 @@ impl Transaction {
pub const fn script(
gas_price: Word,
gas_limit: Word,
byte_price: Word,
maturity: Word,
script: Vec<u8>,
script_data: Vec<u8>,
Expand All @@ -110,7 +106,6 @@ impl Transaction {
Self::Script {
gas_price,
gas_limit,
byte_price,
maturity,
receipts_root,
script,
Expand All @@ -125,7 +120,6 @@ impl Transaction {
pub fn create(
gas_price: Word,
gas_limit: Word,
byte_price: Word,
maturity: Word,
bytecode_witness_index: u8,
salt: Salt,
Expand All @@ -144,7 +138,6 @@ impl Transaction {
Self::Create {
gas_price,
gas_limit,
byte_price,
maturity,
bytecode_length,
bytecode_witness_index,
Expand Down Expand Up @@ -245,20 +238,6 @@ impl Transaction {
}
}

pub const fn byte_price(&self) -> Word {
match self {
Self::Script { byte_price, .. } => *byte_price,
Self::Create { byte_price, .. } => *byte_price,
}
}

pub fn set_byte_price(&mut self, price: Word) {
match self {
Self::Script { byte_price, .. } => *byte_price = price,
Self::Create { byte_price, .. } => *byte_price = price,
}
}

pub const fn maturity(&self) -> Word {
match self {
Self::Script { maturity, .. } => *maturity,
Expand Down Expand Up @@ -495,7 +474,6 @@ mod tests {
let script_with_no_witnesses = Transaction::Script {
gas_price: 0,
gas_limit: 0,
byte_price: 0,
maturity: 0,
receipts_root: Default::default(),
script: vec![],
Expand All @@ -508,7 +486,6 @@ mod tests {
let script_with_witnesses = Transaction::Script {
gas_price: 0,
gas_limit: 0,
byte_price: 0,
maturity: 0,
receipts_root: Default::default(),
script: vec![],
Expand All @@ -527,7 +504,6 @@ mod tests {
let create_with_no_witnesses = Transaction::Create {
gas_price: 0,
gas_limit: 0,
byte_price: 0,
maturity: 0,
bytecode_length: 0,
bytecode_witness_index: 0,
Expand All @@ -541,7 +517,6 @@ mod tests {
let create_with_witnesses = Transaction::Create {
gas_price: 0,
gas_limit: 0,
byte_price: 0,
maturity: 0,
bytecode_length: 0,
bytecode_witness_index: 0,
Expand Down
Loading

0 comments on commit 4134380

Please sign in to comment.