Skip to content

Commit

Permalink
Post Hardfork 3 Cleanup (mimblewimble#490)
Browse files Browse the repository at this point in the history
* Change versioning on master to 4.1.x development

* Remove SlateV3, V3 References from command-line code

* continue to remove pre HF3 functionality, remove participant_id from slate, remove is_compact, derive slate state based on slate state field

* slate no longer needs explicit compact step

* version/build coinbase doctest cleanup

* don't attempt to store transaction during tx lock if it doesn't exist

* repair incorrectly removed logic

* last test fixes (hopefully)
  • Loading branch information
yeastplume authored Jul 31, 2020
1 parent adfdfbb commit e66d47e
Show file tree
Hide file tree
Showing 24 changed files with 113 additions and 1,201 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_wallet"
version = "4.0.1-alpha.1"
version = "4.1.0-alpha.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format."
license = "Apache-2.0"
Expand Down Expand Up @@ -31,13 +31,13 @@ semver = "0.10"
rustyline = "6"
lazy_static = "1"

grin_wallet_api = { path = "./api", version = "4.0.1-alpha.1" }
grin_wallet_impls = { path = "./impls", version = "4.0.1-alpha.1" }
grin_wallet_libwallet = { path = "./libwallet", version = "4.0.1-alpha.1" }
grin_wallet_controller = { path = "./controller", version = "4.0.1-alpha.1" }
grin_wallet_config = { path = "./config", version = "4.0.1-alpha.1" }
grin_wallet_api = { path = "./api", version = "4.1.0-alpha.1" }
grin_wallet_impls = { path = "./impls", version = "4.1.0-alpha.1" }
grin_wallet_libwallet = { path = "./libwallet", version = "4.1.0-alpha.1" }
grin_wallet_controller = { path = "./controller", version = "4.1.0-alpha.1" }
grin_wallet_config = { path = "./config", version = "4.1.0-alpha.1" }

grin_wallet_util = { path = "./util", version = "4.0.1-alpha.1" }
grin_wallet_util = { path = "./util", version = "4.1.0-alpha.1" }

[build-dependencies]
built = { version = "0.4", features = ["git2"]}
Expand Down
10 changes: 5 additions & 5 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_wallet_api"
version = "4.0.1-alpha.1"
version = "4.1.0-alpha.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Grin Wallet API"
license = "Apache-2.0"
Expand All @@ -24,10 +24,10 @@ ring = "0.16"
base64 = "0.12"
ed25519-dalek = "1.0.0-pre.3"

grin_wallet_libwallet = { path = "../libwallet", version = "4.0.1-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.0.1-alpha.1" }
grin_wallet_impls = { path = "../impls", version = "4.0.1-alpha.1" }
grin_wallet_util = { path = "../util", version = "4.0.1-alpha.1" }
grin_wallet_libwallet = { path = "../libwallet", version = "4.1.0-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }
grin_wallet_impls = { path = "../impls", version = "4.1.0-alpha.1" }
grin_wallet_util = { path = "../util", version = "4.1.0-alpha.1" }

[dev-dependencies]
serde_json = "1"
Expand Down
9 changes: 0 additions & 9 deletions api/src/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ pub enum ForeignCheckMiddlewareFn {
VerifySlateMessages,
/// receive_tx
ReceiveTx,
/// finalize_invoice_tx (delete HF3)
FinalizeInvoiceTx,
/// finalize_tx
FinalizeTx,
}
Expand Down Expand Up @@ -441,13 +439,6 @@ where
pub fn finalize_tx(&self, slate: &Slate, post_automatically: bool) -> Result<Slate, Error> {
let mut w_lock = self.wallet_inst.lock();
let w = w_lock.lc_provider()?.wallet_inst()?;
if let Some(m) = self.middleware.as_ref() {
m(
ForeignCheckMiddlewareFn::FinalizeInvoiceTx,
w.w2n_client().get_version_info(),
Some(slate),
)?;
}
let post_automatically = match self.doctest_mode {
true => false,
false => post_automatically,
Expand Down
26 changes: 6 additions & 20 deletions api/src/foreign_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ pub trait ForeignRpc {
"Ok": {
"foreign_api_version": 2,
"supported_slate_versions": [
"V4",
"V3"
"V4"
]
}
}
Expand Down Expand Up @@ -96,15 +95,13 @@ pub trait ForeignRpc {
"kernel": {
"excess": "08dfe86d732f2dd24bac36aa7502685221369514197c26d33fac03041d47e4b490",
"excess_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841be02fa098c54c9bf638e0ee1ad5eb896caa11565f632be7b9cd65643ba371044f",
"features": "Coinbase",
"fee": "0",
"lock_height": "0"
"features": "Coinbase"
},
"key_id": "0300000000000000000000000400000000",
"output": {
"commit": "08fe198e525a5937d0c5d01fa354394d2679be6df5d42064a0f7550c332fce3d9d",
"features": "Coinbase",
"proof": "9d8488fcb43c9c0f683b9ce62f3c8e047b71f2b4cd94b99a3c9a36aef3bb8361ee17b4489eb5f6d6507250532911acb76f18664604c2ca4215347a5d5d8e417d00ca2d59ec29371286986428b0ec1177fc2e416339ea8542eff8186550ad0d65ffac35d761c38819601d331fd427576e2fff823bbc3faa04f49f5332bd4de46cd4f83d0fd46cdb1dfb87069e95974e4a45e0235db71f5efe5cec83bbb30e152ac50a010ef4e57e33aabbeb894b9114f90bb5c3bb03b009014e358aa3914b1a208eb9d8806fbb679c256d4c1a47b0fce3f1235d58192cb7f615bd7c5dab48486db8962c2a594e69ff70029784a810b4eb76b0516805f3417308cda8acb38b9a3ea061568f0c97f5b46a3beff556dc7ebb58c774f08be472b4b6f603e5f8309c2d1f8d6f52667cb86816b330eca5374148aa898f5bbaf3f23a3ebcdc359ee1e14d73a65596c0ddf51f123234969ac8b557ba9dc53255dd6f5c0d3dd2c035a6d1a1185102612fdca474d018b9f9e81acfa3965d42769f5a303bbaabb78d17e0c026b8be0039c55ad1378c8316101b5206359f89fd1ee239115dde458749a040997be43c039055594cab76f602a0a1ee4f5322f3ab1157342404239adbf8b6786544cd67d9891c2689530e65f2a4b8e52d8551b92ffefb812ffa4a472a10701884151d1fb77d8cdc0b1868cb31b564e98e4c035e0eaa26203b882552c7b69deb0d8ec67cf28d5ec044554f8a91a6cae87eb377d6d906bba6ec94dda24ebfd372727f68334af798b11256d88e17cef7c4fed092128215f992e712ed128db2a9da2f5e8fadea9395bddd294a524dce47f818794c56b03e1253bf0fb9cb8beebc5742e4acf19c24824aa1d41996e839906e24be120a0bdf6800da599ec9ec3d1c4c11571c9f143eadbb554fa3c8c9777994a3f3421d454e4ec54c11b97eea3e4e6ede2d97a2bc"
"com": "08fe198e525a5937d0c5d01fa354394d2679be6df5d42064a0f7550c332fce3d9d",
"features": 1,
"prf": "9d8488fcb43c9c0f683b9ce62f3c8e047b71f2b4cd94b99a3c9a36aef3bb8361ee17b4489eb5f6d6507250532911acb76f18664604c2ca4215347a5d5d8e417d00ca2d59ec29371286986428b0ec1177fc2e416339ea8542eff8186550ad0d65ffac35d761c38819601d331fd427576e2fff823bbc3faa04f49f5332bd4de46cd4f83d0fd46cdb1dfb87069e95974e4a45e0235db71f5efe5cec83bbb30e152ac50a010ef4e57e33aabbeb894b9114f90bb5c3bb03b009014e358aa3914b1a208eb9d8806fbb679c256d4c1a47b0fce3f1235d58192cb7f615bd7c5dab48486db8962c2a594e69ff70029784a810b4eb76b0516805f3417308cda8acb38b9a3ea061568f0c97f5b46a3beff556dc7ebb58c774f08be472b4b6f603e5f8309c2d1f8d6f52667cb86816b330eca5374148aa898f5bbaf3f23a3ebcdc359ee1e14d73a65596c0ddf51f123234969ac8b557ba9dc53255dd6f5c0d3dd2c035a6d1a1185102612fdca474d018b9f9e81acfa3965d42769f5a303bbaabb78d17e0c026b8be0039c55ad1378c8316101b5206359f89fd1ee239115dde458749a040997be43c039055594cab76f602a0a1ee4f5322f3ab1157342404239adbf8b6786544cd67d9891c2689530e65f2a4b8e52d8551b92ffefb812ffa4a472a10701884151d1fb77d8cdc0b1868cb31b564e98e4c035e0eaa26203b882552c7b69deb0d8ec67cf28d5ec044554f8a91a6cae87eb377d6d906bba6ec94dda24ebfd372727f68334af798b11256d88e17cef7c4fed092128215f992e712ed128db2a9da2f5e8fadea9395bddd294a524dce47f818794c56b03e1253bf0fb9cb8beebc5742e4acf19c24824aa1d41996e839906e24be120a0bdf6800da599ec9ec3d1c4c11571c9f143eadbb554fa3c8c9777994a3f3421d454e4ec54c11b97eea3e4e6ede2d97a2bc"
}
}
}
Expand Down Expand Up @@ -288,9 +285,6 @@ pub trait ForeignRpc {
```
*/
fn finalize_tx(&self, slate: VersionedSlate) -> Result<VersionedSlate, ErrorKind>;

/// For backwards-compatibility. Remove HF3
fn finalize_invoice_tx(&self, slate: VersionedSlate) -> Result<VersionedSlate, ErrorKind>;
}

impl<'a, L, C, K> ForeignRpc for Foreign<'a, L, C, K>
Expand All @@ -305,7 +299,7 @@ where

fn build_coinbase(&self, block_fees: &BlockFees) -> Result<VersionedCoinbase, ErrorKind> {
let cb: CbData = Foreign::build_coinbase(self, block_fees).map_err(|e| e.kind())?;
Ok(VersionedCoinbase::into_version(cb, SlateVersion::V3))
Ok(VersionedCoinbase::into_version(cb, SlateVersion::V4))
}

fn receive_tx(
Expand All @@ -332,14 +326,6 @@ where
Foreign::finalize_tx(self, &Slate::from(in_slate), true).map_err(|e| e.kind())?;
Ok(VersionedSlate::into_version(out_slate, version).map_err(|e| e.kind())?)
}

//TODO: Delete HF3
fn finalize_invoice_tx(&self, in_slate: VersionedSlate) -> Result<VersionedSlate, ErrorKind> {
let version = in_slate.version();
let out_slate =
Foreign::finalize_tx(self, &Slate::from(in_slate), false).map_err(|e| e.kind())?;
Ok(VersionedSlate::into_version(out_slate, version).map_err(|e| e.kind())?)
}
}

fn test_check_middleware(
Expand Down
11 changes: 0 additions & 11 deletions api/src/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2320,17 +2320,6 @@ where
) -> Result<(bool, bool), Error> {
owner::verify_payment_proof(self.wallet_inst.clone(), keychain_mask, proof)
}

/// Return whether this transaction is marked as invoice in the context
// TODO: Remove post HF3
// This will be removed once state is added to slate
pub fn context_is_invoice(
&self,
keychain_mask: Option<&SecretKey>,
slate: &Slate,
) -> Result<bool, Error> {
owner::context_is_invoice(self.wallet_inst.clone(), keychain_mask, slate)
}
}

/// attempt to send slate synchronously, starting with TOR and downgrading to HTTP
Expand Down
4 changes: 2 additions & 2 deletions config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_wallet_config"
version = "4.0.1-alpha.1"
version = "4.1.0-alpha.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Configuration for grin wallet , a simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format."
license = "Apache-2.0"
Expand All @@ -16,7 +16,7 @@ serde_derive = "1"
toml = "0.5"
dirs = "2.0"

grin_wallet_util = { path = "../util", version = "4.0.1-alpha.1" }
grin_wallet_util = { path = "../util", version = "4.1.0-alpha.1" }

[dev-dependencies]
pretty_assertions = "0.6"
12 changes: 6 additions & 6 deletions controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_wallet_controller"
version = "4.0.1-alpha.1"
version = "4.1.0-alpha.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Controllers for grin wallet instantiation"
license = "Apache-2.0"
Expand Down Expand Up @@ -30,12 +30,12 @@ chrono = { version = "0.4.11", features = ["serde"] }
easy-jsonrpc-mw = "0.5.4"
lazy_static = "1"

grin_wallet_util = { path = "../util", version = "4.0.1-alpha.1" }
grin_wallet_util = { path = "../util", version = "4.1.0-alpha.1" }

grin_wallet_api = { path = "../api", version = "4.0.1-alpha.1" }
grin_wallet_impls = { path = "../impls", version = "4.0.1-alpha.1" }
grin_wallet_libwallet = { path = "../libwallet", version = "4.0.1-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.0.1-alpha.1" }
grin_wallet_api = { path = "../api", version = "4.1.0-alpha.1" }
grin_wallet_impls = { path = "../impls", version = "4.1.0-alpha.1" }
grin_wallet_libwallet = { path = "../libwallet", version = "4.1.0-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }

[dev-dependencies]
ed25519-dalek = "1.0.0-pre.3"
Loading

0 comments on commit e66d47e

Please sign in to comment.