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

Issue:
Check conformance to https://rust-lang.github.io/api-guidelines/



Discussion / hints:

Fix patch:
diff --git a/bindings/ergo-lib-android/Cargo.toml b/bindings/ergo-lib-android/Cargo.toml
index e48ce3293..a693c09e7 100644
--- a/bindings/ergo-lib-android/Cargo.toml
+++ b/bindings/ergo-lib-android/Cargo.toml
@@ -5,6 +5,7 @@ license = "CC0-1.0"
 authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
 edition = "2018"
 description = "JNI bindings for ergo-lib"
+repository = "https://github.com/ergoplatform/sigma-rust"
 
 [lib]
 name = "ergowalletlibjni"
diff --git a/bindings/ergo-lib-c-core/Cargo.toml b/bindings/ergo-lib-c-core/Cargo.toml
index 9d1a1e72f..4c5013762 100644
--- a/bindings/ergo-lib-c-core/Cargo.toml
+++ b/bindings/ergo-lib-c-core/Cargo.toml
@@ -5,6 +5,7 @@ license = "CC0-1.0"
 authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
 edition = "2018"
 description = "Common code for ergo-lib C and JNI bindings"
+repository = "https://github.com/ergoplatform/sigma-rust"
 
 [lib]
 crate-type = ["lib"]
diff --git a/bindings/ergo-lib-c/Cargo.toml b/bindings/ergo-lib-c/Cargo.toml
index 63e13ac53..2746d42c2 100644
--- a/bindings/ergo-lib-c/Cargo.toml
+++ b/bindings/ergo-lib-c/Cargo.toml
@@ -5,6 +5,7 @@ license = "CC0-1.0"
 authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
 edition = "2018"
 description = "C bindings for ergo-lib"
+repository = "https://github.com/ergoplatform/sigma-rust"
 build = "build.rs"
 
 [lib]
diff --git a/bindings/ergo-lib-wasm/Cargo.toml b/bindings/ergo-lib-wasm/Cargo.toml
index 6d16867b9..d570f3b97 100644
--- a/bindings/ergo-lib-wasm/Cargo.toml
+++ b/bindings/ergo-lib-wasm/Cargo.toml
@@ -5,6 +5,7 @@ license = "CC0-1.0"
 authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
 edition = "2018"
 description = "WASM bindings for ergo-lib"
+repository = "https://github.com/ergoplatform/sigma-rust"
 
 [lib]
 crate-type = ["cdylib", "rlib"]
diff --git a/bindings/ergo-lib-wasm/src/ast.rs b/bindings/ergo-lib-wasm/src/ast.rs
index f288c3c6c..f84ed7bfc 100644
--- a/bindings/ergo-lib-wasm/src/ast.rs
+++ b/bindings/ergo-lib-wasm/src/ast.rs
@@ -39,7 +39,7 @@ impl Constant {
     }
 
     /// Extract i32 value, returning error if wrong type
-    pub fn as_i32(&self) -> Result<i32, JsValue> {
+    pub fn to_i32(&self) -> Result<i32, JsValue> {
         match self.0.v {
             ergo_lib::ast::ConstantVal::Int(v) => Ok(v),
             _ => Err(JsValue::from_str(&format!(
@@ -55,7 +55,7 @@ impl Constant {
     }
 
     /// Extract i64 value, returning error if wrong type
-    pub fn as_i64(&self) -> Result<I64, JsValue> {
+    pub fn to_i64(&self) -> Result<I64, JsValue> {
         match self.0.v {
             ergo_lib::ast::ConstantVal::Long(v) => Ok(v.into()),
             _ => Err(JsValue::from_str(&format!(
@@ -71,7 +71,7 @@ impl Constant {
     }
 
     /// Extract byte array, returning error if wrong type
-    pub fn as_byte_array(&self) -> Result<Uint8Array, JsValue> {
+    pub fn to_byte_array(&self) -> Result<Uint8Array, JsValue> {
         match self.0.v.clone() {
             ergo_lib::ast::ConstantVal::Coll(ergo_lib::ast::ConstantColl::Primitive(
                 ergo_lib::ast::CollPrim::CollByte(coll_bytes),
diff --git a/bindings/ergo-lib-wasm/src/ergo_box.rs b/bindings/ergo-lib-wasm/src/ergo_box.rs
index 549d82589..fd57c1f3f 100644
--- a/bindings/ergo-lib-wasm/src/ergo_box.rs
+++ b/bindings/ergo-lib-wasm/src/ergo_box.rs
@@ -66,7 +66,7 @@ impl ErgoBox {
         let chain_contract: chain::contract::Contract = contract.clone().into();
         let b = chain::ergo_box::ErgoBox::new(
             value.0,
-            chain_contract.get_ergo_tree(),
+            chain_contract.ergo_tree(),
             vec![],
             NonMandatoryRegisters::empty(),
             creation_height,
diff --git a/bindings/ergo-lib-wasm/src/ergo_box/box_builder.rs b/bindings/ergo-lib-wasm/src/ergo_box/box_builder.rs
index d8c6f5908..d93f0f71e 100644
--- a/bindings/ergo-lib-wasm/src/ergo_box/box_builder.rs
+++ b/bindings/ergo-lib-wasm/src/ergo_box/box_builder.rs
@@ -23,7 +23,7 @@ impl ErgoBoxCandidateBuilder {
     pub fn new(value: &BoxValue, contract: &Contract, creation_height: u32) -> Self {
         ErgoBoxCandidateBuilder(chain::ergo_box::box_builder::ErgoBoxCandidateBuilder::new(
             value.clone().into(),
-            chain::contract::Contract::from(contract.clone()).get_ergo_tree(),
+            chain::contract::Contract::from(contract.clone()).ergo_tree(),
             creation_height,
         ))
     }
diff --git a/ergo-lib/Cargo.toml b/ergo-lib/Cargo.toml
index b3c8caf93..328eee782 100644
--- a/ergo-lib/Cargo.toml
+++ b/ergo-lib/Cargo.toml
@@ -5,6 +5,7 @@ license = "CC0-1.0"
 authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
 edition = "2018"
 description = "ErgoTree interpreter and wallet-like features for Ergo"
+repository = "https://github.com/ergoplatform/sigma-rust"
 
 [lib]
 crate-type = ["cdylib", "rlib"]
@@ -24,8 +25,8 @@ num-bigint = "0.3.0"
 rand = "0.7"
 
 [features]
-default = ["with-serde"]
-with-serde = ["serde"]
+default = ["json"]
+json = ["serde"]
 
 [dev-dependencies]
 wasm-bindgen-test = "0.3.10"
diff --git a/ergo-lib/README.md b/ergo-lib/README.md
index c8e016ee3..9a11144f9 100644
--- a/ergo-lib/README.md
+++ b/ergo-lib/README.md
@@ -6,7 +6,7 @@ Features:
 
 # Usage
 ## Crate features
-### `with-serde`
+### `json`
 JSON serialization for chain types using `serde`.
 
 
diff --git a/ergo-lib/src/ast/constant.rs b/ergo-lib/src/ast/constant.rs
index 1e1714f73..9874eafb0 100644
--- a/ergo-lib/src/ast/constant.rs
+++ b/ergo-lib/src/ast/constant.rs
@@ -5,7 +5,7 @@ use crate::{
     sigma_protocol::{dlog_group::EcPoint, sigma_boolean::SigmaProp},
     types::{LiftIntoSType, SType},
 };
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 use std::convert::TryFrom;
 
@@ -86,9 +86,9 @@ impl ConstantVal {
 }
 
 #[derive(PartialEq, Eq, Debug, Clone)]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 #[cfg_attr(
-    feature = "with-serde",
+    feature = "json",
     serde(into = "Base16EncodedBytes", try_from = "Base16DecodedBytes")
 )]
 /// Constant
diff --git a/ergo-lib/src/chain.rs b/ergo-lib/src/chain.rs
index 369e78254..bf43f07ac 100644
--- a/ergo-lib/src/chain.rs
+++ b/ergo-lib/src/chain.rs
@@ -1,6 +1,6 @@
 //! Ergo chain types
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 mod json;
 
 mod base16_bytes;
diff --git a/ergo-lib/src/chain/base16_bytes.rs b/ergo-lib/src/chain/base16_bytes.rs
index f99b7371e..ca1a26741 100644
--- a/ergo-lib/src/chain/base16_bytes.rs
+++ b/ergo-lib/src/chain/base16_bytes.rs
@@ -1,12 +1,12 @@
 //! Transitioning type for Base16 encoded bytes in JSON serialization
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 use std::convert::TryFrom;
 
 /// Transitioning type for Base16 encoded bytes
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
-#[cfg_attr(feature = "with-serde", serde(into = "String"))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", serde(into = "String"))]
 #[derive(PartialEq, Eq, Debug, Clone)]
 pub struct Base16EncodedBytes(String);
 
@@ -24,8 +24,8 @@ impl Into<String> for Base16EncodedBytes {
 }
 
 /// Transitioning type for Base16 decoded bytes
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
-#[cfg_attr(feature = "with-serde", serde(try_from = "String"))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", serde(try_from = "String"))]
 #[derive(PartialEq, Eq, Debug, Clone)]
 pub struct Base16DecodedBytes(pub Vec<u8>);
 
diff --git a/ergo-lib/src/chain/context_extension.rs b/ergo-lib/src/chain/context_extension.rs
index b741523f2..7fcf3768b 100644
--- a/ergo-lib/src/chain/context_extension.rs
+++ b/ergo-lib/src/chain/context_extension.rs
@@ -7,7 +7,7 @@ use crate::{
     },
 };
 use indexmap::IndexMap;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 use std::collections::HashMap;
 use std::{convert::TryFrom, io, num::ParseIntError};
@@ -15,7 +15,7 @@ use std::{convert::TryFrom, io, num::ParseIntError};
 /// User-defined variables to be put into context
 #[derive(Debug, PartialEq, Eq, Clone)]
 #[cfg_attr(
-    feature = "with-serde",
+    feature = "json",
     derive(Serialize, Deserialize),
     serde(
         into = "HashMap<String, Constant>",
diff --git a/ergo-lib/src/chain/contract.rs b/ergo-lib/src/chain/contract.rs
index e0f02c9ff..231b5fd11 100644
--- a/ergo-lib/src/chain/contract.rs
+++ b/ergo-lib/src/chain/contract.rs
@@ -21,7 +21,7 @@ impl Contract {
     }
 
     /// get ErgoTree for this contract
-    pub fn get_ergo_tree(&self) -> ErgoTree {
+    pub fn ergo_tree(&self) -> ErgoTree {
         self.ergo_tree.clone()
     }
 }
diff --git a/ergo-lib/src/chain/data_input.rs b/ergo-lib/src/chain/data_input.rs
index 2a3c36135..32cee91c6 100644
--- a/ergo-lib/src/chain/data_input.rs
+++ b/ergo-lib/src/chain/data_input.rs
@@ -11,16 +11,16 @@ use crate::serialization::{
 use proptest::prelude::*;
 #[cfg(test)]
 use proptest_derive::Arbitrary;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 
 /// Inputs, that are used to enrich script context, but won't be spent by the transaction
 #[derive(PartialEq, Debug, Clone)]
 #[cfg_attr(test, derive(Arbitrary))]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct DataInput {
     /// id of the box to add into context (should be in UTXO)
-    #[cfg_attr(feature = "with-serde", serde(rename = "boxId"))]
+    #[cfg_attr(feature = "json", serde(rename = "boxId"))]
     pub box_id: BoxId,
 }
 
diff --git a/ergo-lib/src/chain/digest32.rs b/ergo-lib/src/chain/digest32.rs
index 820fd0773..8dc28596d 100644
--- a/ergo-lib/src/chain/digest32.rs
+++ b/ergo-lib/src/chain/digest32.rs
@@ -6,7 +6,7 @@ use blake2::digest::{Update, VariableOutput};
 use blake2::VarBlake2b;
 #[cfg(test)]
 use proptest_derive::Arbitrary;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 use sigma_ser::vlq_encode;
 use std::convert::TryFrom;
@@ -15,9 +15,9 @@ use std::io;
 use thiserror::Error;
 
 /// 32 byte array used in box, transaction ids (hash)
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 #[cfg_attr(
-    feature = "with-serde",
+    feature = "json",
     serde(into = "Base16EncodedBytes", try_from = "Base16DecodedBytes")
 )]
 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
diff --git a/ergo-lib/src/chain/ergo_box.rs b/ergo-lib/src/chain/ergo_box.rs
index 0e427f69c..11820d3cd 100644
--- a/ergo-lib/src/chain/ergo_box.rs
+++ b/ergo-lib/src/chain/ergo_box.rs
@@ -5,7 +5,7 @@ pub mod box_id;
 pub mod box_value;
 pub mod register;
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use super::json;
 use super::{
     digest32::blake2b256_hash,
@@ -25,12 +25,12 @@ use box_id::BoxId;
 use box_value::BoxValue;
 use indexmap::IndexSet;
 use register::NonMandatoryRegisters;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use std::convert::TryFrom;
 use std::io;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use thiserror::Error;
 
 /// Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency.
@@ -50,40 +50,34 @@ use thiserror::Error;
 ///
 /// A transaction is unsealing a box. As a box can not be open twice, any further valid transaction
 /// can not be linked to the same box.
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
-#[cfg_attr(
-    feature = "with-serde",
-    serde(try_from = "json::ergo_box::ErgoBoxFromJson")
-)]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", serde(try_from = "json::ergo_box::ErgoBoxFromJson"))]
 #[derive(PartialEq, Eq, Debug, Clone)]
 pub struct ErgoBox {
-    #[cfg_attr(feature = "with-serde", serde(rename = "boxId"))]
+    #[cfg_attr(feature = "json", serde(rename = "boxId"))]
     box_id: BoxId,
     /// amount of money associated with the box
-    #[cfg_attr(feature = "with-serde", serde(rename = "value"))]
+    #[cfg_attr(feature = "json", serde(rename = "value"))]
     pub value: BoxValue,
     /// guarding script, which should be evaluated to true in order to open this box
-    #[cfg_attr(
-        feature = "with-serde",
-        serde(rename = "ergoTree", with = "json::ergo_tree")
-    )]
+    #[cfg_attr(feature = "json", serde(rename = "ergoTree", with = "json::ergo_tree"))]
     pub ergo_tree: ErgoTree,
     /// secondary tokens the box contains
-    #[cfg_attr(feature = "with-serde", serde(rename = "assets"))]
+    #[cfg_attr(feature = "json", serde(rename = "assets"))]
     pub tokens: Vec<TokenAmount>,
     ///  additional registers the box can carry over
-    #[cfg_attr(feature = "with-serde", serde(rename = "additionalRegisters"))]
+    #[cfg_attr(feature = "json", serde(rename = "additionalRegisters"))]
     pub additional_registers: NonMandatoryRegisters,
     /// height when a transaction containing the box was created.
     /// This height is declared by user and should not exceed height of the block,
     /// containing the transaction with this box.
-    #[cfg_attr(feature = "with-serde", serde(rename = "creationHeight"))]
+    #[cfg_attr(feature = "json", serde(rename = "creationHeight"))]
     pub creation_height: u32,
     /// id of transaction which created the box
-    #[cfg_attr(feature = "with-serde", serde(rename = "transactionId"))]
+    #[cfg_attr(feature = "json", serde(rename = "transactionId"))]
     pub transaction_id: TxId,
     /// number of box (from 0 to total number of boxes the transaction with transactionId created - 1)
-    #[cfg_attr(feature = "with-serde", serde(rename = "index"))]
+    #[cfg_attr(feature = "json", serde(rename = "index"))]
     pub index: u16,
 }
 
@@ -210,7 +204,7 @@ impl ErgoBoxId for ErgoBox {
 }
 
 /// Errors on parsing ErgoBox from JSON
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 #[derive(Error, PartialEq, Eq, Debug, Clone)]
 pub enum ErgoBoxFromJsonError {
     /// Box id parsed from JSON differs from calculated from box serialized bytes
@@ -218,7 +212,7 @@ pub enum ErgoBoxFromJsonError {
     InvalidBoxId,
 }
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 impl TryFrom<json::ergo_box::ErgoBoxFromJson> for ErgoBox {
     type Error = ErgoBoxFromJsonError;
     fn try_from(box_json: json::ergo_box::ErgoBoxFromJson) -> Result<Self, Self::Error> {
diff --git a/ergo-lib/src/chain/ergo_box/box_id.rs b/ergo-lib/src/chain/ergo_box/box_id.rs
index c19ca5299..7737bb8c8 100644
--- a/ergo-lib/src/chain/ergo_box/box_id.rs
+++ b/ergo-lib/src/chain/ergo_box/box_id.rs
@@ -1,7 +1,7 @@
 //! Box id type
 use std::io;
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 
 use super::super::digest32::Digest32;
@@ -14,7 +14,7 @@ use proptest_derive::Arbitrary;
 
 /// newtype for box ids
 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 #[cfg_attr(test, derive(Arbitrary))]
 pub struct BoxId(pub Digest32);
 
@@ -34,7 +34,7 @@ impl From<Digest32> for BoxId {
     }
 }
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 impl Into<String> for BoxId {
     fn into(self) -> String {
         self.0.into()
diff --git a/ergo-lib/src/chain/ergo_box/box_value.rs b/ergo-lib/src/chain/ergo_box/box_value.rs
index 563e24fbf..e4f5ae262 100644
--- a/ergo-lib/src/chain/ergo_box/box_value.rs
+++ b/ergo-lib/src/chain/ergo_box/box_value.rs
@@ -3,7 +3,7 @@
 use crate::serialization::{
     sigma_byte_reader::SigmaByteRead, SerializationError, SigmaSerializable,
 };
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 use sigma_ser::vlq_encode;
 use std::{convert::TryFrom, io};
@@ -11,7 +11,7 @@ use thiserror::Error;
 
 /// Box value with with bound checks
 #[derive(PartialEq, Eq, Hash, Debug, Clone, Copy)]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct BoxValue(i64);
 
 impl BoxValue {
diff --git a/ergo-lib/src/chain/ergo_box/register.rs b/ergo-lib/src/chain/ergo_box/register.rs
index c47834d1b..b100c4c6b 100644
--- a/ergo-lib/src/chain/ergo_box/register.rs
+++ b/ergo-lib/src/chain/ergo_box/register.rs
@@ -1,15 +1,15 @@
 //! Box registers
 
 use crate::{ast::Constant, serialization::SerializationError};
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 use std::{collections::HashMap, convert::TryFrom};
 use thiserror::Error;
 
 /// newtype for additional registers R4 - R9
 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
-#[cfg_attr(feature = "with-serde", serde(into = "String", try_from = "String"))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", serde(into = "String", try_from = "String"))]
 pub struct NonMandatoryRegisterId(u8);
 
 impl NonMandatoryRegisterId {
@@ -87,9 +87,9 @@ pub struct NonMandatoryRegisterIdParsingError();
 
 /// Stores non-mandatory registers for the box
 #[derive(PartialEq, Eq, Debug, Clone)]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 #[cfg_attr(
-    feature = "with-serde",
+    feature = "json",
     serde(
         into = "HashMap<NonMandatoryRegisterId, Constant>",
         try_from = "HashMap<NonMandatoryRegisterId, Constant>"
diff --git a/ergo-lib/src/chain/input.rs b/ergo-lib/src/chain/input.rs
index fbc38b496..42807dd24 100644
--- a/ergo-lib/src/chain/input.rs
+++ b/ergo-lib/src/chain/input.rs
@@ -11,7 +11,7 @@ use crate::serialization::{
     sigma_byte_reader::SigmaByteRead, sigma_byte_writer::SigmaByteWrite, SerializationError,
     SigmaSerializable,
 };
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 
 /// Unsigned (without proofs) transaction input
@@ -36,13 +36,13 @@ impl<T: ErgoBoxId> From<T> for UnsignedInput {
 /// Fully signed transaction input
 #[derive(PartialEq, Debug, Clone)]
 #[cfg_attr(test, derive(proptest_derive::Arbitrary))]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct Input {
     /// id of the box to spent
-    #[cfg_attr(feature = "with-serde", serde(rename = "boxId"))]
+    #[cfg_attr(feature = "json", serde(rename = "boxId"))]
     pub box_id: BoxId,
     /// proof of spending correctness
-    #[cfg_attr(feature = "with-serde", serde(rename = "spendingProof"))]
+    #[cfg_attr(feature = "json", serde(rename = "spendingProof"))]
     pub spending_proof: ProverResult,
 }
 
diff --git a/ergo-lib/src/chain/json.rs b/ergo-lib/src/chain/json.rs
index 3c724036b..2372a6abf 100644
--- a/ergo-lib/src/chain/json.rs
+++ b/ergo-lib/src/chain/json.rs
@@ -84,17 +84,17 @@ pub mod transaction {
 
     #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
     pub struct TransactionJson {
-        #[cfg_attr(feature = "with-serde", serde(rename = "id"))]
+        #[cfg_attr(feature = "json", serde(rename = "id"))]
         pub tx_id: TxId,
         /// inputs, that will be spent by this transaction.
-        #[cfg_attr(feature = "with-serde", serde(rename = "inputs"))]
+        #[cfg_attr(feature = "json", 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 = "with-serde", serde(rename = "dataInputs"))]
+        #[cfg_attr(feature = "json", serde(rename = "dataInputs"))]
         pub data_inputs: Vec<DataInput>,
-        #[cfg_attr(feature = "with-serde", serde(rename = "outputs"))]
+        #[cfg_attr(feature = "json", serde(rename = "outputs"))]
         pub outputs: Vec<ErgoBox>,
     }
 }
diff --git a/ergo-lib/src/chain/prover_result.rs b/ergo-lib/src/chain/prover_result.rs
index 006632858..93ae1d7f2 100644
--- a/ergo-lib/src/chain/prover_result.rs
+++ b/ergo-lib/src/chain/prover_result.rs
@@ -7,13 +7,13 @@ use crate::serialization::{
     sigma_byte_reader::SigmaByteRead, sigma_byte_writer::SigmaByteWrite, SerializationError,
     SigmaSerializable,
 };
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 
 /// Serialized proof generated by ['Prover']
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 #[cfg_attr(
-    feature = "with-serde",
+    feature = "json",
     serde(into = "Base16EncodedBytes", try_from = "Base16DecodedBytes")
 )]
 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
@@ -69,13 +69,13 @@ impl SigmaSerializable for ProofBytes {
 
 /// Proof of correctness of tx spending
 #[derive(Debug, PartialEq, Eq, Clone)]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct ProverResult {
     /// proof that satisfies final sigma proposition
-    #[cfg_attr(feature = "with-serde", serde(rename = "proofBytes"))]
+    #[cfg_attr(feature = "json", serde(rename = "proofBytes"))]
     pub proof: ProofBytes,
     /// user-defined variables to be put into context
-    #[cfg_attr(feature = "with-serde", serde(rename = "extension"))]
+    #[cfg_attr(feature = "json", serde(rename = "extension"))]
     pub extension: ContextExtension,
 }
 
diff --git a/ergo-lib/src/chain/token.rs b/ergo-lib/src/chain/token.rs
index 62bf2b820..ae3c3b041 100644
--- a/ergo-lib/src/chain/token.rs
+++ b/ergo-lib/src/chain/token.rs
@@ -9,13 +9,13 @@ use std::io;
 use super::digest32::Digest32;
 #[cfg(test)]
 use proptest_derive::Arbitrary;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 
 /// newtype for token id
 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
 #[cfg_attr(test, derive(Arbitrary))]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct TokenId(pub Digest32);
 
 impl TokenId {
@@ -36,13 +36,13 @@ impl SigmaSerializable for TokenId {
 /// Token amount represented with token id paired with it's amount
 #[derive(PartialEq, Eq, Debug, Clone)]
 #[cfg_attr(test, derive(Arbitrary))]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct TokenAmount {
     /// token id
-    #[cfg_attr(feature = "with-serde", serde(rename = "tokenId"))]
+    #[cfg_attr(feature = "json", serde(rename = "tokenId"))]
     pub token_id: TokenId,
     /// token amount
-    #[cfg_attr(feature = "with-serde", serde(rename = "amount"))]
+    #[cfg_attr(feature = "json", serde(rename = "amount"))]
     pub amount: u64,
 }
 
diff --git a/ergo-lib/src/chain/transaction.rs b/ergo-lib/src/chain/transaction.rs
index 909981a15..3ea390411 100644
--- a/ergo-lib/src/chain/transaction.rs
+++ b/ergo-lib/src/chain/transaction.rs
@@ -2,7 +2,7 @@
 
 pub mod unsigned;
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use super::json;
 use super::{
     data_input::DataInput,
@@ -19,19 +19,19 @@ use crate::serialization::{
 use indexmap::IndexSet;
 #[cfg(test)]
 use proptest_derive::Arbitrary;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use serde::{Deserialize, Serialize};
 
 use std::convert::TryFrom;
 use std::io;
 use std::iter::FromIterator;
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 use thiserror::Error;
 
 /// Transaction id (ModifierId in sigmastate)
 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
 #[cfg_attr(test, derive(Arbitrary))]
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 pub struct TxId(pub Digest32);
 
 impl TxId {
@@ -51,7 +51,7 @@ impl SigmaSerializable for TxId {
     }
 }
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 impl Into<String> for TxId {
     fn into(self) -> String {
         self.0.into()
@@ -68,9 +68,9 @@ impl Into<String> for TxId {
  * Transactions are not encrypted, so it is possible to browse and view every transaction ever
  * collected into a block.
  */
-#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
 #[cfg_attr(
-    feature = "with-serde",
+    feature = "json",
     serde(
         try_from = "json::transaction::TransactionJson",
         into = "json::transaction::TransactionJson"
@@ -211,7 +211,7 @@ impl SigmaSerializable for Transaction {
     }
 }
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 impl Into<json::transaction::TransactionJson> for Transaction {
     fn into(self) -> json::transaction::TransactionJson {
         json::transaction::TransactionJson {
@@ -224,7 +224,7 @@ impl Into<json::transaction::TransactionJson> for Transaction {
 }
 
 /// Errors on parsing Transaction from JSON
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 #[derive(Error, PartialEq, Eq, Debug, Clone)]
 pub enum TransactionFromJsonError {
     /// Tx id parsed from JSON differs from calculated from serialized bytes
@@ -232,7 +232,7 @@ pub enum TransactionFromJsonError {
     InvalidTxId,
 }
 
-#[cfg(feature = "with-serde")]
+#[cfg(feature = "json")]
 impl TryFrom<json::transaction::TransactionJson> for Transaction {
     type Error = TransactionFromJsonError;
     fn try_from(tx_json: json::transaction::TransactionJson) -> Result<Self, Self::Error> {
@@ -296,7 +296,7 @@ pub mod tests {
     }
 
     #[test]
-    #[cfg(feature = "with-serde")]
+    #[cfg(feature = "json")]
     fn test_tx_id_calc() {
         let json = r#"
         {
diff --git a/ergo-lib/src/ergo_tree.rs b/ergo-lib/src/ergo_tree.rs
index 515c363c9..7aec13f7a 100644
--- a/ergo-lib/src/ergo_tree.rs
+++ b/ergo-lib/src/ergo_tree.rs
@@ -308,7 +308,7 @@ mod tests {
             .unwrap();
 
         let contract = chain::contract::Contract::pay_to_address(&address).unwrap();
-        let bytes = &contract.get_ergo_tree().sigma_serialise_bytes();
+        let bytes = &contract.ergo_tree().sigma_serialise_bytes();
         assert_eq!(&bytes[..2], vec![0u8, 8u8].as_slice());
     }
 
diff --git a/ergo-lib/src/sigma_protocol/verifier.rs b/ergo-lib/src/sigma_protocol/verifier.rs
index 0bf36247f..f10713d34 100644
--- a/ergo-lib/src/sigma_protocol/verifier.rs
+++ b/ergo-lib/src/sigma_protocol/verifier.rs
@@ -153,7 +153,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg(feature = "with-serde")]
+    #[cfg(feature = "json")]
     fn test_proof_from_mainnet() {
         use crate::chain::address::{AddressEncoder, NetworkPrefix};
         use crate::chain::transaction::Transaction;
diff --git a/ergo-lib/src/wallet/tx_builder.rs b/ergo-lib/src/wallet/tx_builder.rs
index 555ea9b6b..59017983a 100644
--- a/ergo-lib/src/wallet/tx_builder.rs
+++ b/ergo-lib/src/wallet/tx_builder.rs
@@ -85,8 +85,7 @@ impl<S: ErgoBoxAssets + ErgoBoxId + Clone> TxBuilder<S> {
         )?;
         let mut output_candidates = self.output_candidates.clone();
 
-        let change_address_ergo_tree =
-            Contract::pay_to_address(&self.change_address)?.get_ergo_tree();
+        let change_address_ergo_tree = Contract::pay_to_address(&self.change_address)?.ergo_tree();
         let change_boxes: Result<Vec<ErgoBoxCandidate>, ErgoBoxCandidateBuilderError> = selection
             .change_boxes
             .iter()
diff --git a/sigma-ser/Cargo.toml b/sigma-ser/Cargo.toml
index 11dded138..8411a6035 100644
--- a/sigma-ser/Cargo.toml
+++ b/sigma-ser/Cargo.toml
@@ -5,6 +5,7 @@ license = "CC0-1.0"
 authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
 edition = "2018"
 description = "Ergo binary serialization primitives"
+repository = "https://github.com/ergoplatform/sigma-rust"
 
 [lib]
 crate-type = ["cdylib", "rlib"]


Test patch:
diff --git a/bindings/ergo-lib-wasm/tests/test_constant.js b/bindings/ergo-lib-wasm/tests/test_constant.js
index a819d6aeb..ccb6d1ee0 100644
--- a/bindings/ergo-lib-wasm/tests/test_constant.js
+++ b/bindings/ergo-lib-wasm/tests/test_constant.js
@@ -7,7 +7,7 @@ import {
 it('decode Constant i32', async () => {
   let enc_v = '048ce5d4e505';
   let c = Constant.decode_from_base16(enc_v);
-  let c_value = c.as_i32();
+  let c_value = c.to_i32();
   expect(c_value).equal(777689414);
 });
 
@@ -16,7 +16,7 @@ it('roundtrip Constant i32', async () => {
   let c = Constant.from_i32(value);
   let encoded = c.encode_to_base16();
   let decoded_c = Constant.decode_from_base16(encoded);
-  let decoded_c_value = decoded_c.as_i32();
+  let decoded_c_value = decoded_c.to_i32();
   expect(decoded_c_value).equal(value);
 });
 
@@ -25,7 +25,7 @@ it('roundtrip Constant i64', async () => {
   let c = Constant.from_i64(I64.from_str(value_str));
   let encoded = c.encode_to_base16();
   let decoded_c = Constant.decode_from_base16(encoded);
-  let decoded_c_value = decoded_c.as_i64();
+  let decoded_c_value = decoded_c.to_i64();
   let decoded_c_value_str = decoded_c_value.to_str();
   expect(decoded_c_value_str).equal(value_str);
 });
@@ -35,7 +35,7 @@ it('roundtrip Constant byte array', async () => {
   let c = Constant.from_byte_array(value);
   let encoded = c.encode_to_base16();
   let decoded_c = Constant.decode_from_base16(encoded);
-  let decoded_c_value = decoded_c.as_byte_array();
+  let decoded_c_value = decoded_c.to_byte_array();
   expect(decoded_c_value.toString()).equal(value.toString());
 });