Skip to content

Commit

Permalink
from_json test added to tx_builder_constants
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman committed Dec 8, 2023
1 parent 5c58e5e commit 4a35ef1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions rust/src/tx_builder_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,13 @@ mod tests {
"a20198af1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a0223accc0a1a0374f693194a1f0a1a02515e841980b30a41005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a0374f693194a1f0aff",
);
}

#[test]
pub fn from_json() {
println!("{}", TxBuilderConstants::plutus_vasil_cost_models().to_json().unwrap());
assert_eq!(
TxBuilderConstants::plutus_vasil_cost_models().to_hex(),
Costmdls::from_json("{ \"PlutusV1\": [\"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\"], \"PlutusV2\": [\"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\"] }").unwrap().to_hex(),
);
}
}

0 comments on commit 4a35ef1

Please sign in to comment.