Repository: ergoplatform/sigma-rust (language: rust)

Issue:
Fix to_js_eip12 format 
Regarding the tx.to_js_eip12() There are 2 issues
- id is called tx_id
- dataInputs is called data_inputs


Discussion / hints:

Fix patch:
diff --git a/bindings/ergo-lib-wasm/src/json.rs b/bindings/ergo-lib-wasm/src/json.rs
index fceae18c5..c94f43c00 100644
--- a/bindings/ergo-lib-wasm/src/json.rs
+++ b/bindings/ergo-lib-wasm/src/json.rs
@@ -21,17 +21,17 @@ use serde::Serialize;
 
 #[derive(Serialize, PartialEq, Debug, Clone)]
 pub(crate) struct TransactionJsonEip12 {
-    #[cfg_attr(feature = "json", serde(rename = "id"))]
+    #[serde(rename = "id")]
     pub tx_id: TxId,
     /// inputs, that will be spent by this transaction.
-    #[cfg_attr(feature = "json", serde(rename = "inputs"))]
+    #[serde(rename = "inputs")]
     pub inputs: Vec<Input>,
     /// inputs, that are not going to be spent by transaction, but will be reachable from inputs
     /// scripts. `dataInputs` scripts will not be executed, thus their scripts costs are not
     /// included in transaction cost and they do not contain spending proofs.
-    #[cfg_attr(feature = "json", serde(rename = "dataInputs"))]
+    #[serde(rename = "dataInputs")]
     pub data_inputs: Vec<DataInput>,
-    #[cfg_attr(feature = "json", serde(rename = "outputs"))]
+    #[serde(rename = "outputs")]
     pub outputs: Vec<ErgoBoxJsonEip12>,
 }
 
@@ -52,15 +52,15 @@ impl From<Transaction> for TransactionJsonEip12 {
 #[derive(Serialize, PartialEq, Debug, Clone)]
 pub(crate) struct UnsignedTransactionJsonEip12 {
     /// unsigned inputs, that will be spent by this transaction.
-    #[cfg_attr(feature = "json", serde(rename = "inputs"))]
+    #[serde(rename = "inputs")]
     pub inputs: Vec<UnsignedInput>,
     /// inputs, that are not going to be spent by transaction, but will be reachable from inputs
     /// scripts. `dataInputs` scripts will not be executed, thus their scripts costs are not
     /// included in transaction cost and they do not contain spending proofs.
-    #[cfg_attr(feature = "json", serde(rename = "dataInputs"))]
+    #[serde(rename = "dataInputs")]
     pub data_inputs: Vec<DataInput>,
     /// box candidates to be created by this transaction
-    #[cfg_attr(feature = "json", serde(rename = "outputs"))]
+    #[serde(rename = "outputs")]
     pub outputs: Vec<ErgoBoxCandidateJsonEip12>,
 }
 
diff --git a/bindings/ergo-lib-wasm/src/utils.rs b/bindings/ergo-lib-wasm/src/utils.rs
index 92d155180..87112791f 100644
--- a/bindings/ergo-lib-wasm/src/utils.rs
+++ b/bindings/ergo-lib-wasm/src/utils.rs
@@ -21,7 +21,7 @@ impl MinerAddress {
 }
 
 /// Wrapper for i64 for JS/TS because JS Number can only represent 53 bits
-/// see https://stackoverflow.com/questions/17320706/javascript-long-integer
+/// see <https://stackoverflow.com/questions/17320706/javascript-long-integer>
 #[wasm_bindgen]
 #[derive(PartialEq, Eq, Debug, Clone)]
 pub struct I64(i64);


Test patch: