Skip to content

Commit

Permalink
update tx builder to have a network option
Browse files Browse the repository at this point in the history
  • Loading branch information
twwu123 committed Aug 16, 2024
1 parent 773e44d commit 38ac315
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 90 deletions.
6 changes: 5 additions & 1 deletion packages/sidan-csl-rs/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ pub fn serialize_tx_body(
)?;
MeshTxBuilderCore::add_all_metadata(&mut mesh_csl, mesh_tx_builder_body.metadata.clone())?;

mesh_csl.add_script_hash()?;
match mesh_tx_builder_body.network {
Some(current_network) => mesh_csl.add_script_hash(current_network)?,
None => mesh_csl.add_script_hash(Network::Mainnet)?,
};
// if self.mesh_tx_builder_body.change_address != "" {
// let collateral_inputs = self.mesh_tx_builder_body.collaterals.clone();
// let collateral_vec: Vec<u64> = collateral_inputs
Expand Down Expand Up @@ -162,6 +165,7 @@ impl MeshTxBuilderCore {
invalid_hereafter: None,
},
signing_key: vec![],
network: None,
},
tx_evaluation_multiplier_percentage: 110,
}
Expand Down
221 changes: 153 additions & 68 deletions packages/sidan-csl-rs/src/core/constants.rs
Original file line number Diff line number Diff line change
@@ -1,86 +1,171 @@
use cardano_serialization_lib as csl;

pub fn get_v1_cost_models() -> Vec<i64> {
use crate::model::Network;

pub fn get_mainnet_cost_models() -> Vec<Vec<i64>> {
vec![
205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4, 23000,
100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100, 23000, 100,
19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525, 14068, 4, 2, 196500,
453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1, 1060367, 12586, 1, 208512,
421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000, 32, 80556, 1, 57667, 4, 1000,
10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1, 208896, 511, 1, 52467, 32, 64832, 32,
65493, 32, 22558, 32, 16563, 32, 76511, 32, 196500, 453240, 220, 0, 1, 1, 69522, 11687, 0,
1, 60091, 32, 196500, 453240, 220, 0, 1, 1, 196500, 453240, 220, 0, 1, 1, 806990, 30482, 4,
1927926, 82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32,
31220, 32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 57996947, 18975, 10,
vec![
205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4,
23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100,
23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525,
14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1,
1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000,
32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1,
208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32,
196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1,
1, 196500, 453240, 220, 0, 1, 1, 806990, 30482, 4, 1927926, 82523, 4, 265318, 0, 4, 0,
85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220, 32, 32696, 32, 43357, 32,
32247, 32, 38314, 32, 57996947, 18975, 10,
],
vec![
205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4,
23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100,
23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525,
14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1,
1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000,
32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1,
208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32,
196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1,
1, 196500, 453240, 220, 0, 1, 1, 1159724, 392670, 0, 2, 806990, 30482, 4, 1927926,
82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220,
32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 35892428, 10, 57996947, 18975, 10,
38887044, 32947, 10,
],
]
}

pub fn get_v2_cost_models() -> Vec<i64> {
pub fn get_preprod_cost_models() -> Vec<Vec<i64>> {
vec![
205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4, 23000,
100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100, 23000, 100,
19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525, 14068, 4, 2, 196500,
453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1, 1060367, 12586, 1, 208512,
421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000, 32, 80556, 1, 57667, 4, 1000,
10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1, 208896, 511, 1, 52467, 32, 64832, 32,
65493, 32, 22558, 32, 16563, 32, 76511, 32, 196500, 453240, 220, 0, 1, 1, 69522, 11687, 0,
1, 60091, 32, 196500, 453240, 220, 0, 1, 1, 196500, 453240, 220, 0, 1, 1, 1159724, 392670,
0, 2, 806990, 30482, 4, 1927926, 82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1,
41182, 32, 212342, 32, 31220, 32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 35892428, 10,
57996947, 18975, 10, 38887044, 32947, 10,
vec![
205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4,
23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100,
23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525,
14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1,
1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000,
32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1,
208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32,
196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1,
1, 196500, 453240, 220, 0, 1, 1, 806990, 30482, 4, 1927926, 82523, 4, 265318, 0, 4, 0,
85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220, 32, 32696, 32, 43357, 32,
32247, 32, 38314, 32, 57996947, 18975, 10,
],
vec![
205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4,
23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100,
23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525,
14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1,
1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000,
32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1,
208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32,
196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1,
1, 196500, 453240, 220, 0, 1, 1, 1159724, 392670, 0, 2, 806990, 30482, 4, 1927926,
82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220,
32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 35892428, 10, 57996947, 18975, 10,
38887044, 32947, 10,
],
]
}

pub fn get_v3_cost_models() -> Vec<i64> {
pub fn get_preview_cost_models() -> Vec<Vec<i64>> {
vec![
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305, 8356, 4, 16000,
100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 100, 100, 16000, 100,
94375, 32, 132994, 32, 61462, 4, 72010, 178, 0, 1, 22151, 32, 91189, 769, 4, 2, 85848,
123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 1, 1000, 42921, 4, 2, 24548, 29498, 38, 1,
898148, 27279, 1, 51775, 558, 1, 39184, 1000, 60594, 1, 141895, 32, 83150, 32, 15299, 32,
76049, 1, 13169, 4, 22100, 10, 28999, 74, 1, 28999, 74, 1, 43285, 552, 1, 44749, 541, 1,
33852, 32, 68246, 32, 72362, 32, 7243, 32, 7391, 32, 11546, 32, 85848, 123203, 7305, -900,
1716, 549, 57, 85848, 0, 1, 90434, 519, 0, 1, 74433, 32, 85848, 123203, 7305, -900, 1716,
549, 57, 85848, 0, 1, 1, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 955506,
213312, 0, 2, 270652, 22588, 4, 1457325, 64566, 4, 20467, 1, 4, 0, 141992, 32, 100788, 420,
1, 1, 81663, 32, 59498, 32, 20142, 32, 24588, 32, 20744, 32, 25933, 32, 24623, 32,
43053543, 10, 53384111, 14333, 10, 43574283, 26308, 10, 16000, 100, 16000, 100, 962335, 18,
2780678, 6, 442008, 1, 52538055, 3756, 18, 267929, 18, 76433006, 8868, 18, 52948122, 18,
1995836, 36, 3227919, 12, 901022, 1, 166917843, 4307, 36, 284546, 36, 158221314, 26549, 36,
74698472, 36, 333849714, 1, 254006273, 72, 2174038, 72, 2261318, 64571, 4, 207616, 8310, 4,
1293828, 28716, 63, 0, 1, 1006041, 43623, 251, 0, 1,
vec![
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305, 8356, 4,
16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 100, 100,
16000, 100, 94375, 32, 132994, 32, 61462, 4, 72010, 178, 0, 1, 22151, 32, 91189, 769,
4, 2, 85848, 228465, 122, 0, 1, 1, 1000, 42921, 4, 2, 24548, 29498, 38, 1, 898148,
27279, 1, 51775, 558, 1, 39184, 1000, 60594, 1, 141895, 32, 83150, 32, 15299, 32,
76049, 1, 13169, 4, 22100, 10, 28999, 74, 1, 28999, 74, 1, 43285, 552, 1, 44749, 541,
1, 33852, 32, 68246, 32, 72362, 32, 7243, 32, 7391, 32, 11546, 32, 85848, 228465, 122,
0, 1, 1, 90434, 519, 0, 1, 74433, 32, 85848, 228465, 122, 0, 1, 1, 85848, 228465, 122,
0, 1, 1, 270652, 22588, 4, 1457325, 64566, 4, 20467, 1, 4, 0, 141992, 32, 100788, 420,
1, 1, 81663, 32, 59498, 32, 20142, 32, 24588, 32, 20744, 32, 25933, 32, 24623, 32,
53384111, 14333, 10,
],
vec![
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305, 8356, 4,
16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 100, 100,
16000, 100, 94375, 32, 132994, 32, 61462, 4, 72010, 178, 0, 1, 22151, 32, 91189, 769,
4, 2, 85848, 228465, 122, 0, 1, 1, 1000, 42921, 4, 2, 24548, 29498, 38, 1, 898148,
27279, 1, 51775, 558, 1, 39184, 1000, 60594, 1, 141895, 32, 83150, 32, 15299, 32,
76049, 1, 13169, 4, 22100, 10, 28999, 74, 1, 28999, 74, 1, 43285, 552, 1, 44749, 541,
1, 33852, 32, 68246, 32, 72362, 32, 7243, 32, 7391, 32, 11546, 32, 85848, 228465, 122,
0, 1, 1, 90434, 519, 0, 1, 74433, 32, 85848, 228465, 122, 0, 1, 1, 85848, 228465, 122,
0, 1, 1, 955506, 213312, 0, 2, 270652, 22588, 4, 1457325, 64566, 4, 20467, 1, 4, 0,
141992, 32, 100788, 420, 1, 1, 81663, 32, 59498, 32, 20142, 32, 24588, 32, 20744, 32,
25933, 32, 24623, 32, 43053543, 10, 53384111, 14333, 10, 43574283, 26308, 10,
],
vec![
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305, 8356, 4,
16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 100, 100,
16000, 100, 94375, 32, 132994, 32, 61462, 4, 72010, 178, 0, 1, 22151, 32, 91189, 769,
4, 2, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 1, 1000, 42921, 4, 2,
24548, 29498, 38, 1, 898148, 27279, 1, 51775, 558, 1, 39184, 1000, 60594, 1, 141895,
32, 83150, 32, 15299, 32, 76049, 1, 13169, 4, 22100, 10, 28999, 74, 1, 28999, 74, 1,
43285, 552, 1, 44749, 541, 1, 33852, 32, 68246, 32, 72362, 32, 7243, 32, 7391, 32,
11546, 32, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 90434, 519, 0, 1,
74433, 32, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 1, 85848, 123203,
7305, -900, 1716, 549, 57, 85848, 0, 1, 955506, 213312, 0, 2, 270652, 22588, 4,
1457325, 64566, 4, 20467, 1, 4, 0, 141992, 32, 100788, 420, 1, 1, 81663, 32, 59498, 32,
20142, 32, 24588, 32, 20744, 32, 25933, 32, 24623, 32, 43053543, 10, 53384111, 14333,
10, 43574283, 26308, 10, 16000, 100, 16000, 100, 962335, 18, 2780678, 6, 442008, 1,
52538055, 3756, 18, 267929, 18, 76433006, 8868, 18, 52948122, 18, 1995836, 36, 3227919,
12, 901022, 1, 166917843, 4307, 36, 284546, 36, 158221314, 26549, 36, 74698472, 36,
333849714, 1, 254006273, 72, 2174038, 72, 2261318, 64571, 4, 207616, 8310, 4, 1293828,
28716, 63, 0, 1, 1006041, 43623, 251, 0, 1,
],
]
}

pub fn build_csl_cost_models() -> csl::Costmdls {
pub fn get_cost_models_from_network(network: &Network) -> Vec<Vec<i64>> {
match network {
Network::Mainnet => get_mainnet_cost_models(),
Network::Preprod => get_preprod_cost_models(),
Network::Preview => get_preview_cost_models(),
Network::Custom(custom_cost_models) => custom_cost_models.to_vec(),
}
}

pub fn build_csl_cost_models(network: &Network) -> csl::Costmdls {
let mut csl_cost_mdls = csl::Costmdls::new();
let cost_model_list = get_cost_models_from_network(network);
for i in 0..cost_model_list.len() {
let current_cost_model = &cost_model_list[i];
if i == 0 {
csl_cost_mdls.insert(
&csl::Language::new_plutus_v1(),
&csl::CostModel::from(
current_cost_model
.iter()
.map(|&i| i as i128)
.collect::<Vec<i128>>(),
),
);
}

if i == 1 {
csl_cost_mdls.insert(
&csl::Language::new_plutus_v2(),
&csl::CostModel::from(
current_cost_model
.iter()
.map(|&i| i as i128)
.collect::<Vec<i128>>(),
),
);
}

if i == 2 {
csl_cost_mdls.insert(
&csl::Language::new_plutus_v3(),
&csl::CostModel::from(
current_cost_model
.iter()
.map(|&i| i as i128)
.collect::<Vec<i128>>(),
),
);
}
}

csl_cost_mdls.insert(
&csl::Language::new_plutus_v1(),
&csl::CostModel::from(
get_v1_cost_models()
.iter()
.map(|&i| i as i128)
.collect::<Vec<i128>>(),
),
);
csl_cost_mdls.insert(
&csl::Language::new_plutus_v2(),
&csl::CostModel::from(
get_v2_cost_models()
.iter()
.map(|&i| i as i128)
.collect::<Vec<i128>>(),
),
);
csl_cost_mdls.insert(
&csl::Language::new_plutus_v3(),
&csl::CostModel::from(
get_v3_cost_models()
.iter()
.map(|&i| i as i128)
.collect::<Vec<i128>>(),
),
);
csl_cost_mdls
}
4 changes: 2 additions & 2 deletions packages/sidan-csl-rs/src/core/core_csl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,9 @@ impl MeshCSL {
Ok(())
}

pub fn add_script_hash(&mut self) -> Result<(), JsError> {
pub fn add_script_hash(&mut self, network: Network) -> Result<(), JsError> {
self.tx_builder
.calc_script_data_hash(&build_csl_cost_models())?;
.calc_script_data_hash(&build_csl_cost_models(&network))?;
Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions packages/sidan-csl-rs/src/core/tx_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl MeshTxParser {
invalid_hereafter: None,
},
signing_key: vec![],
network: None,
};
let csl_tx = csl::Transaction::from_hex(s).expect("Invalid transaction");
let csl_tx_body = csl_tx.body();
Expand Down
2 changes: 2 additions & 0 deletions packages/sidan-csl-rs/src/model/tx_builder_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod certificate;
mod datum;
mod metadata;
mod mint;
mod network;
mod output;
mod redeemer;
mod script;
Expand All @@ -15,6 +16,7 @@ pub use certificate::*;
pub use datum::*;
pub use metadata::*;
pub use mint::*;
pub use network::*;
pub use output::*;
pub use redeemer::*;
pub use script::*;
Expand Down
10 changes: 10 additions & 0 deletions packages/sidan-csl-rs/src/model/tx_builder_types/network.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Network {
Mainnet,
Preprod,
Preview,
Custom(Vec<Vec<i64>>),
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize};

use super::{
Certificate, Datum, Metadata, MintItem, Output, PubKeyTxIn, RefTxIn, TxIn, ValidityRange,
Withdrawal,
Certificate, Datum, Metadata, MintItem, Network, Output, PubKeyTxIn, RefTxIn, TxIn,
ValidityRange, Withdrawal,
};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
Expand All @@ -21,4 +21,5 @@ pub struct MeshTxBuilderBody {
pub validity_range: ValidityRange,
pub certificates: Vec<Certificate>,
pub signing_key: Vec<String>,
pub network: Option<Network>,
}
11 changes: 9 additions & 2 deletions packages/whisky/src/builder/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,29 @@ impl MeshTxBuilder {
self.complete_sync(customized_tx)?;
match &self.evaluator {
Some(evaluator) => {
let network = match &self.core.mesh_tx_builder_body.network {
Some(builder_network) => builder_network,
None => &Network::Mainnet,
};
let inputs_for_evaluation: Vec<_> =
self.inputs_for_evaluation.values().cloned().collect();
let tx_evaluation_result = evaluator
.evaluate_tx(
&self.core.mesh_csl.tx_hex,
&inputs_for_evaluation,
&self.chained_txs.clone(),
&network,
)
.await;
match tx_evaluation_result {
Ok(actions) => self.update_redeemer(actions),
Err(err) => return Err(JsError::from_str(&format!(
Err(err) => {
return Err(JsError::from_str(&format!(
"Error evaluating transaction - tx_hex: [ {} ] ,Error message: [ {:?} ]",
self.tx_hex(),
err
))),
)))
}
}
}
None => self,
Expand Down
20 changes: 18 additions & 2 deletions packages/whisky/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ impl MeshTxBuilder {
/// * `Self` - A new MeshTxBuilder instance
pub fn new(param: MeshTxBuilderParam) -> Self {
MeshTxBuilder {
core: MeshTxBuilderCore::new_core(None),
protocol_params: param.params,
core: MeshTxBuilderCore::new_core(param.params.clone()),
protocol_params: param.params.clone(),
tx_in_item: None,
withdrawal_item: None,
mint_item: None,
Expand Down Expand Up @@ -325,6 +325,22 @@ impl MeshTxBuilder {
self
}

/// ## Transaction building method
///
/// Selects the network to use, primarily to decide which cost models to use for evaluation and calculating script integrity hash
///
/// ### Arguments
///
/// * `network` - The network the current Tx is being built for. Custom Network takes in a vec of cost models
///
/// ### Returns
///
/// * `Self` - The MeshTxBuilder instance
pub fn network(&mut self, network: Network) -> &mut Self {
self.core.mesh_tx_builder_body.network = Some(network);
self
}

/// ## Internal method
///
/// Queue an input in the MeshTxBuilder instance
Expand Down
Loading

0 comments on commit 38ac315

Please sign in to comment.