Changes for 1.1.0 -> 2.0.0 Deployment strategy decisions (#126)

* make slate v0 the default for regular sends

* add block_header_version to slate

* update doc tests for latest grin version

* rustfmt

* HACF if HF height detected

* rustfmt
This commit is contained in:
Yeastplume
2019-05-31 08:33:23 +01:00
committed by GitHub
parent af16dea6e1
commit b1738e33ed
13 changed files with 490 additions and 420 deletions
Generated
+326 -322
View File
File diff suppressed because it is too large Load Diff
+20 -15
View File
@@ -95,7 +95,7 @@ pub trait ForeignRpc {
"Ok": {
"kernel": {
"excess": "08dfe86d732f2dd24bac36aa7502685221369514197c26d33fac03041d47e4b490",
"excess_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f4f0471a33b6465cdb9e72b635f5611aa6c89ebd51aeee038f69b4cc598a02fe0",
"excess_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841be02fa098c54c9bf638e0ee1ad5eb896caa11565f632be7b9cd65643ba371044f",
"features": "Coinbase",
"fee": "0",
"lock_height": "0"
@@ -138,7 +138,7 @@ pub trait ForeignRpc {
{
"id": "0",
"message": "my message",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f756f655333250204644c1cb169e7a78f21b57437930db91e808f39be58134c1d",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b1d4c1358be398f801eb90d933774b5218fa7e769b11c4c640402253353656f75",
"part_sig": null,
"public_blind_excess": "034b4df2f0558b73ea72a1ca5c4ab20217c66bbe0829056fca7abe76888e9349ee",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
@@ -172,8 +172,9 @@ pub trait ForeignRpc {
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"orig_version": 2,
"version": 2
"orig_version": 2,
"version": 2,
"block_header_version": 1
}
}
]
@@ -210,7 +211,8 @@ pub trait ForeignRpc {
{
"version_info": {
"version": 2,
"orig_version": 2
"orig_version": 2,
"block_header_version": 1
},
"num_participants": 2,
"id": "0436430c-2b02-624c-2032-570501212b00",
@@ -290,8 +292,8 @@ pub trait ForeignRpc {
{
"id": "1",
"message": "Thanks, Yeastplume",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078ff97f43f2eda0f695161ba23dc48db7a1bcbd7f131f1e21bdb4e1ad1eb2f1a130",
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078ffc965b05962362aee43e5264bd3fd0f26dbd7092cfe070069e26d2df28bd352b",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b30a1f1b21eade1b4bd211e1f137fbdbca1b78dc43da21b1695f6a0edf2437ff9",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b2b35bd28dfd2269e0670e0cf9270bd6df2d03fbd64523ee4ae622396055b96fc",
"public_blind_excess": "038fe0443243dab173c068ef5fa891b242d2b5eb890ea09475e6e381170442ee16",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
}
@@ -333,8 +335,9 @@ pub trait ForeignRpc {
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"orig_version": 2,
"version": 2
"orig_version": 2,
"version": 2,
"block_header_version": 1
}
}
}
@@ -366,7 +369,8 @@ pub trait ForeignRpc {
"params": [{
"version_info": {
"version": 2,
"orig_version": 2
"orig_version": 2,
"block_header_version": 1
},
"num_participants": 2,
"id": "0436430c-2b02-624c-2032-570501212b00",
@@ -423,7 +427,7 @@ pub trait ForeignRpc {
"id": "0",
"public_blind_excess": "029f12f9f8c5489a18904de7cd46dc3384b79369d4cbc17cd74b299da8c2cf7445",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f",
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078fe3cccc5ff1d832edb7e3cb3b1414b9e9d3d1d503294224b4c93bf3d59ed64018",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b1840d69ed5f33bc9b424422903d5d1d3e9b914143bcbe3b7ed32d8f15fcccce3",
"message": null,
"message_sig": null
}
@@ -449,7 +453,7 @@ pub trait ForeignRpc {
"id": "1",
"message": null,
"message_sig": null,
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078fc0e6f263f91010a6fea7099029c70eabdf75b48aefd977e14d1ed659b221eac9",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841bc9ea21b259d61e4de177d9ef8ab475dfab0ec7299009a7fea61010f963f2e6c0",
"public_blind_excess": "033bbe2a419ea2e9d6810a8d66552e709d1783ca50759a44dbaf63fc79c0164c4c",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
},
@@ -457,7 +461,7 @@ pub trait ForeignRpc {
"id": "0",
"message": null,
"message_sig": null,
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078fe3cccc5ff1d832edb7e3cb3b1414b9e9d3d1d503294224b4c93bf3d59ed64018",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b1840d69ed5f33bc9b424422903d5d1d3e9b914143bcbe3b7ed32d8f15fcccce3",
"public_blind_excess": "029f12f9f8c5489a18904de7cd46dc3384b79369d4cbc17cd74b299da8c2cf7445",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
}
@@ -477,7 +481,7 @@ pub trait ForeignRpc {
"kernels": [
{
"excess": "09bac6083b05a32a9d9b37710c70dd0a1ef9329fde0848558976b6f1b81d80ceed",
"excess_sig": "4d4b6cd1361032ca9bd2aeb9d900aa4d45d9ead80ac9423374c451a7254d0766a4b3bec3eae84394b68ad4cb3ddbc896f898aca769d2fc5a56886ba280c1e9a0",
"excess_sig": "66074d25a751c4743342c90ad8ead9454daa00d9b9aed29bca321036d16c4b4da0e9c180a26b88565afcd269a7ac98f896c8db3dcbd48ab69443e8eac3beb3a4",
"features": "Plain",
"fee": "7000000",
"lock_height": "0"
@@ -500,7 +504,8 @@ pub trait ForeignRpc {
},
"version_info": {
"orig_version": 2,
"version": 2
"version": 2,
"block_header_version": 1
}
}
}
+61 -49
View File
@@ -355,7 +355,7 @@ pub trait OwnerRpc {
{
"id": "0",
"message": "my message",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f756f655333250204644c1cb169e7a78f21b57437930db91e808f39be58134c1d",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b1d4c1358be398f801eb90d933774b5218fa7e769b11c4c640402253353656f75",
"part_sig": null,
"public_blind_excess": "034b4df2f0558b73ea72a1ca5c4ab20217c66bbe0829056fca7abe76888e9349ee",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
@@ -389,8 +389,9 @@ pub trait OwnerRpc {
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"orig_version": 2,
"version": 2
"orig_version": 2,
"version": 2,
"block_header_version": 1
}
}
}
@@ -439,7 +440,7 @@ pub trait OwnerRpc {
{
"id": "1",
"message": "Please give me your grins",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078fd2599ab38942986602e943f684a85992893a6d34367dc7cc2b403a5dcfcdbcd9",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841bd9bccdcf5d3a402bccc77d36346d3a899259a884f643e90266984289b39a59d2",
"part_sig": null,
"public_blind_excess": "028e95921cc0d5be5922362265d352c9bdabe51a9e1502a3f0d4a10387f1893f40",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
@@ -469,7 +470,8 @@ pub trait OwnerRpc {
},
"version_info": {
"orig_version": 2,
"version": 2
"version": 2,
"block_header_version": 1
}
}
}
@@ -532,7 +534,8 @@ pub trait OwnerRpc {
},
"version_info": {
"orig_version": 2,
"version": 2
"version": 2,
"block_header_version": 1
}
},
{
@@ -575,8 +578,8 @@ pub trait OwnerRpc {
{
"id": "0",
"message": "Ok, here are your grins",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f463643727bf45004637269e9afb5f5fbd8cdcc1881a2ef9ec3ab0fb5f6e01ae9",
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f19d37c475bc5cc495b732dfddb0fb5a5e782b7ae2797ef4904b66f6afb409d61",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841be91ae0f6b50fabc39eefa28118cccdd8fbf5b5afe96972630450f47b72433646",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b619d40fb6a6fb60449ef9727aeb782e7a5b50fdbfd2d735b49ccc55b477cd319",
"public_blind_excess": "0309e22f2adaa9b81f51414b775b86acd096e17794eb8159bfcfef27caa4bf5c90",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
}
@@ -615,7 +618,8 @@ pub trait OwnerRpc {
},
"version_info": {
"orig_version": 2,
"version": 2
"version": 2,
"block_header_version": 1
}
}
}
@@ -648,7 +652,7 @@ pub trait OwnerRpc {
{
"id": "0",
"message": "my message",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f756f655333250204644c1cb169e7a78f21b57437930db91e808f39be58134c1d",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b1d4c1358be398f801eb90d933774b5218fa7e769b11c4c640402253353656f75",
"part_sig": null,
"public_blind_excess": "034b4df2f0558b73ea72a1ca5c4ab20217c66bbe0829056fca7abe76888e9349ee",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
@@ -682,8 +686,9 @@ pub trait OwnerRpc {
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"orig_version": 2,
"version": 2
"orig_version": 2,
"version": 2,
"block_header_version": 1
}
},
0
@@ -720,7 +725,8 @@ pub trait OwnerRpc {
{
"version_info": {
"version": 2,
"orig_version": 2
"orig_version": 2,
"block_header_version": 1
},
"num_participants": 2,
"id": "0436430c-2b02-624c-2032-570501212b00",
@@ -751,9 +757,9 @@ pub trait OwnerRpc {
],
"kernels": [
{
"features": "HeightLocked",
"features": "Plain",
"fee": "7000000",
"lock_height": "5",
"lock_height": "0",
"excess": "000000000000000000000000000000000000000000000000000000000000000000",
"excess_sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
@@ -763,7 +769,7 @@ pub trait OwnerRpc {
"amount": "60000000000",
"fee": "7000000",
"height": "5",
"lock_height": "5",
"lock_height": "0",
"participant_data": [
{
"id": "0",
@@ -776,8 +782,8 @@ pub trait OwnerRpc {
{
"id": "1",
"public_blind_excess": "024f9bc78c984c78d6e916d3a00746aa30fa1172124c8dbc0cbddcb7b486719bc7",
"public_nonce": "0292a0baa95464d44b2c7155c7e2c69213bd3737f6217e60273af159b7f49812e3",
"part_sig": "92a0baa95464d44b2c7155c7e2c69213bd3737f6217e60273af159b7f49812e30d5ef73628c7de327a40dbc943ca227ab809b8edf954b18b69a4f9b333e7278c",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841ba9c6dd6185c2b819799700fa1a69201f96cc6dfb9ca205a0ef7c35fb81d57dac",
"message": null,
"message_sig": null
}
@@ -797,14 +803,14 @@ pub trait OwnerRpc {
"fee": "7000000",
"height": "5",
"id": "0436430c-2b02-624c-2032-570501212b00",
"lock_height": "5",
"lock_height": "0",
"num_participants": 2,
"participant_data": [
{
"id": "0",
"message": null,
"message_sig": null,
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f3127d36e8cc35aa76091a491e94fcffdd2f25d70d23e698ece2d8db14334670a",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b38641aefa907a2fc1c051b1f73202794fffb6d422e328516a5c6b2ef41e935f8",
"public_blind_excess": "033ac2158fa0077f087de60c19d8e431753baa5b63b6e1477f05a2a6e7190d4592",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
},
@@ -812,9 +818,9 @@ pub trait OwnerRpc {
"id": "1",
"message": null,
"message_sig": null,
"part_sig": "92a0baa95464d44b2c7155c7e2c69213bd3737f6217e60273af159b7f49812e30d5ef73628c7de327a40dbc943ca227ab809b8edf954b18b69a4f9b333e7278c",
"part_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841ba9c6dd6185c2b819799700fa1a69201f96cc6dfb9ca205a0ef7c35fb81d57dac",
"public_blind_excess": "024f9bc78c984c78d6e916d3a00746aa30fa1172124c8dbc0cbddcb7b486719bc7",
"public_nonce": "0292a0baa95464d44b2c7155c7e2c69213bd3737f6217e60273af159b7f49812e3"
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
}
],
"tx": {
@@ -832,10 +838,10 @@ pub trait OwnerRpc {
"kernels": [
{
"excess": "09bac6083b05a32a9d9b37710c70dd0a1ef9329fde0848558976b6f1b81d80ceed",
"excess_sig": "4a1802e31b854d765bdd7e114cef33b852c3fed01436c50d70d7c662333272683e86caa4b58b38d9dad2805b2d19f2788afc165ecb931b1a37d28764771b8e96",
"features": "HeightLocked",
"excess_sig": "66074d25a751c4743342c90ad8ead9454daa00d9b9aed29bca321036d16c4b4da0e9c180a26b88565afcd269a7ac98f896c8db3dcbd48ab69443e8eac3beb3a4",
"features": "Plain",
"fee": "7000000",
"lock_height": "5"
"lock_height": "0"
}
],
"outputs": [
@@ -855,7 +861,8 @@ pub trait OwnerRpc {
},
"version_info": {
"orig_version": 2,
"version": 2
"version": 2,
"block_header_version": 1
}
}
}
@@ -878,40 +885,40 @@ pub trait OwnerRpc {
"method": "post_tx",
"params": [
{
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000",
"body": {
"inputs": [
{
"commit": "087df32304c5d4ae8b2af0bc31e700019d722910ef87dd4eec3197b80b207e3045",
"features": "Coinbase"
"features": "Coinbase",
"commit": "087df32304c5d4ae8b2af0bc31e700019d722910ef87dd4eec3197b80b207e3045"
},
{
"commit": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7",
"features": "Coinbase"
}
],
"kernels": [
{
"excess": "09bac6083b05a32a9d9b37710c70dd0a1ef9329fde0848558976b6f1b81d80ceed",
"excess_sig": "4a1802e31b854d765bdd7e114cef33b852c3fed01436c50d70d7c662333272683e86caa4b58b38d9dad2805b2d19f2788afc165ecb931b1a37d28764771b8e96",
"features": "HeightLocked",
"fee": "7000000",
"lock_height": "5"
"features": "Coinbase",
"commit": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7"
}
],
"outputs": [
{
"commit": "099b48cfb1f80a2347dc89818449e68e76a3c6817a532a8e9ef2b4a5ccf4363850",
"features": "Plain",
"commit": "099b48cfb1f80a2347dc89818449e68e76a3c6817a532a8e9ef2b4a5ccf4363850",
"proof": "7ebcd2ed9bf5fb29854033ba3d0e720613bdf7dfacc586d2f6084c1cde0a2b72e955d4ce625916701dc7c347132f40d0f102a34e801d745ee54b49b765d08aae0bb801c60403e57cafade3b4b174e795b633ab9e402b5b1b6e1243fd10bbcf9368a75cb6a6c375c7bdf02da9e03b7f210df45d942e6fba2729cd512a372e6ed91a1b5c9c22831febea843e3f85adcf198f39ac9f7b73b70c60bfb474aa69878ea8d1d32fef30166b59caacaec3fd024de29a90f1587e08d2c36b3d5c560cabf658e212e0a40a4129b3e5c35557058def5551f4eb395759597ba808b3c34eac3bfb9716e4480d7931c5789c538463ec75be0eb807c894047fda6cbcd22682d3c6d3823cb330f090a2099e3510a3706b57d46c95224394d7f1c0a20d99cc314b8f1d9d02668e2e435f62e1194de0be6a1f50f72ed777ed51c8819f527a94918d1aa8df6461e98ed4c2b18210de50fbcf8c3df210bfe326d41f1dc0ad748cb0320ae28401c85ab4f7dcb99d88a052e95dc85b76d22b36cabd60e06ab84bb7e4ddfdab9c9730c8a986583237ed1ecbb323ee8e79b8cadca4b438b7c09531670b471dda6a2eb3e747916c88ce7d9d8e1b7f61660eeb9e5a13c60e4dfe89d1177d81d6f6570fda85158e646a15f1e8b9e977494dc19a339aab2e0e478670d80092d6ba37646e60714ef64eb4a3d37fe15f8f38b59114af34b235489eed3f69b7781c5fe496eb43ffe245c14bd740f745844a38cf0d904347aaa2b64f51add18822dac009d8b63fa3e4c9b1fa72187f9a4acba1ab315daa1b04c9a41f3be846ac420b37990e6c947a16cc9d5c0671b292bf77d7d8b8974d2ad3afae95ba7772c37432840f53a007f31e0195f3abdf100c4477723cc6c6d5da14894a73dfac342833731036487488fdade7b9d556c06f26173b6b67598d3769447ce2828d71dd45ac5af436c6b0"
},
{
"commit": "0812276cc788e6870612296d926cba9f0e7b9810670710b5a6e6f1ba006d395774",
"features": "Plain",
"commit": "0812276cc788e6870612296d926cba9f0e7b9810670710b5a6e6f1ba006d395774",
"proof": "dcff6175390c602bfa92c2ffd1a9b2d84dcc9ea941f6f317bdd0f875244ef23e696fd17c71df79760ce5ce1a96aab1d15dd057358dc835e972febeb86d50ccec0dad7cfe0246d742eb753cf7b88c045d15bc7123f8cf7155647ccf663fca92a83c9a65d0ed756ea7ebffd2cac90c380a102ed9caaa355d175ed0bf58d3ac2f5e909d6c447dfc6b605e04925c2b17c33ebd1908c965a5541ea5d2ed45a0958e6402f89d7a56df1992e036d836e74017e73ccad5cb3a82b8e139e309792a31b15f3ffd72ed033253428c156c2b9799458a25c1da65b719780a22de7fe7f437ae2fccd22cf7ea357ab5aa66a5ef7d71fb0dc64aa0b5761f68278062bb39bb296c787e4cabc5e2a2933a416ce1c9a9696160386449c437e9120f7bb26e5b0e74d1f2e7d5bcd7aafb2a92b87d1548f1f911fb06af7bd6cc13cee29f7c9cb79021aed18186272af0e9d189ec107c81a8a3aeb4782b0d950e4881aa51b776bb6844b25bce97035b48a9bdb2aea3608687bcdd479d4fa998b5a839ff88558e4a29dff0ed13b55900abb5d439b70793d902ae9ad34587b18c919f6b875c91d14deeb1c373f5e76570d59a6549758f655f1128a54f162dfe8868e1587028e26ad91e528c5ae7ee9335fa58fb59022b5de29d80f0764a9917390d46db899acc6a5b416e25ecc9dccb7153646addcc81cadb5f0078febc7e05d7735aba494f39ef05697bbcc9b47b2ccc79595d75fc13c80678b5e237edce58d731f34c05b1ddcaa649acf2d865bbbc3ceda10508bcdd29d0496744644bf1c3516f6687dfeef5649c7dff90627d642739a59d91a8d1d0c4dc55d74a949e1074427664b467992c9e0f7d3af9d6ea79513e8946ddc0d356bac49878e64e6a95b0a30214214faf2ce317fa622ff3266b32a816e10a18e6d789a5da1f23e67b4f970a68a7bcd9e18825ee274b0483896a40"
}
],
"kernels": [
{
"features": "Plain",
"fee": "7000000",
"lock_height": "0",
"excess": "09bac6083b05a32a9d9b37710c70dd0a1ef9329fde0848558976b6f1b81d80ceed",
"excess_sig": "66074d25a751c4743342c90ad8ead9454daa00d9b9aed29bca321036d16c4b4da0e9c180a26b88565afcd269a7ac98f896c8db3dcbd48ab69443e8eac3beb3a4"
}
]
},
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
}
},
false
]
@@ -1078,7 +1085,7 @@ pub trait OwnerRpc {
{
"id": "0",
"message": "my message",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f756f655333250204644c1cb169e7a78f21b57437930db91e808f39be58134c1d",
"message_sig": "8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841b1d4c1358be398f801eb90d933774b5218fa7e769b11c4c640402253353656f75",
"part_sig": null,
"public_blind_excess": "034b4df2f0558b73ea72a1ca5c4ab20217c66bbe0829056fca7abe76888e9349ee",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
@@ -1112,8 +1119,9 @@ pub trait OwnerRpc {
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"orig_version": 2,
"version": 2
"orig_version": 2,
"version": 2,
"block_header_version": 1
}
}
]
@@ -1403,20 +1411,24 @@ pub fn run_doctest_owner(
..Default::default()
};
let mut slate = api_impl::owner::init_send_tx(&mut *w, args, true).unwrap();
println!("INITIAL SLATE");
println!("{}", serde_json::to_string_pretty(&slate).unwrap());
{
let mut w2 = wallet2.lock();
w2.open_with_credentials().unwrap();
slate = api_impl::foreign::receive_tx(&mut *w2, &slate, None, None, true).unwrap();
w2.close().unwrap();
}
println!("RECIPIENT SLATE");
// Spit out slate for input to finalize_tx
println!("{}", serde_json::to_string_pretty(&slate).unwrap());
if lock_tx {
api_impl::owner::tx_lock_outputs(&mut *w, &slate, 0).unwrap();
}
println!("RECEIPIENT SLATE");
println!("{}", serde_json::to_string_pretty(&slate).unwrap());
if finalize_tx {
api_impl::owner::finalize_tx(&mut *w, &slate).unwrap();
slate = api_impl::owner::finalize_tx(&mut *w, &slate).unwrap();
error!("FINALIZED TX SLATE");
println!("{}", serde_json::to_string_pretty(&slate).unwrap());
}
w.close().unwrap();
}
+1 -3
View File
@@ -359,7 +359,7 @@ pub fn receive(
let send_tx = format!("{}.response", args.input);
adapter.send_tx_async(&send_tx, &slate)?;
info!(
"Response file {}.response generated, sending it back to the transaction originator.",
"Response file {}.response generated, and can be sent back to the transaction originator.",
args.input
);
Ok(())
@@ -462,7 +462,6 @@ pub struct ProcessInvoiceArgs {
pub method: String,
pub dest: String,
pub max_outputs: usize,
pub target_slate_version: Option<u16>,
pub input: String,
pub estimate_selection_strategies: bool,
}
@@ -504,7 +503,6 @@ pub fn process_invoice(
num_change_outputs: 1u32,
selection_strategy_is_use_all: args.selection_strategy == "all",
message: args.message.clone(),
target_slate_version: args.target_slate_version,
send_args: None,
..Default::default()
};
+5
View File
@@ -40,6 +40,11 @@ impl HTTPNodeClient {
node_api_secret: node_api_secret,
}
}
/// Allow returning the chain height without needing a wallet instantiated
pub fn chain_height(&self) -> Result<u64, libwallet::Error> {
self.get_chain_height()
}
}
impl NodeClient for HTTPNodeClient {
+8
View File
@@ -259,6 +259,10 @@ where
batch.commit()?;
}
if let Some(v) = args.target_slate_version {
slate.version_info.orig_version = v;
}
Ok(slate)
}
@@ -333,6 +337,10 @@ where
batch.commit()?;
}
if let Some(v) = args.target_slate_version {
ret_slate.version_info.orig_version = v;
}
Ok(ret_slate)
}
+10 -1
View File
@@ -45,7 +45,7 @@ use crate::slate_versions::v2::{
InputV2, OutputV2, ParticipantDataV2, SlateV2, TransactionBodyV2, TransactionV2, TxKernelV2,
VersionCompatInfoV2,
};
use crate::slate_versions::CURRENT_SLATE_VERSION;
use crate::slate_versions::{CURRENT_SLATE_VERSION, GRIN_BLOCK_HEADER_VERSION};
/// Public data for each participant in the slate
#[derive(Serialize, Deserialize, Debug, Clone)]
@@ -185,6 +185,8 @@ pub struct VersionCompatInfo {
pub version: u16,
/// Original version this slate was converted from
pub orig_version: u16,
/// The grin block header version this slate is intended for
pub block_header_version: u16,
}
/// Helper just to facilitate serialization
@@ -238,6 +240,7 @@ impl Slate {
version_info: VersionCompatInfo {
version: CURRENT_SLATE_VERSION,
orig_version: CURRENT_SLATE_VERSION,
block_header_version: GRIN_BLOCK_HEADER_VERSION,
},
}
}
@@ -813,12 +816,15 @@ impl From<&VersionCompatInfo> for VersionCompatInfoV2 {
let VersionCompatInfo {
version,
orig_version,
block_header_version,
} = data;
let version = *version;
let orig_version = *orig_version;
let block_header_version = *block_header_version;
VersionCompatInfoV2 {
version,
orig_version,
block_header_version,
}
}
}
@@ -963,12 +969,15 @@ impl From<&VersionCompatInfoV2> for VersionCompatInfo {
let VersionCompatInfoV2 {
version,
orig_version,
block_header_version,
} = data;
let version = *version;
let orig_version = *orig_version;
let block_header_version = *block_header_version;
VersionCompatInfo {
version,
orig_version,
block_header_version,
}
}
}
+3
View File
@@ -29,6 +29,9 @@ pub mod v2;
/// The most recent version of the slate
pub const CURRENT_SLATE_VERSION: u16 = 2;
/// The grin block header this slate is intended to be compatible with
pub const GRIN_BLOCK_HEADER_VERSION: u16 = 1;
/// Existing versions of the slate
#[derive(EnumIter, Serialize, Deserialize, Clone, Debug, PartialEq, PartialOrd, Eq, Ord)]
pub enum SlateVersion {
+6 -1
View File
@@ -32,7 +32,8 @@
//! * version field removed
//! * VersionCompatInfo struct created with fields and added to beginning of struct
//! version: u16
//! orig_verion: u16,
//! orig_version: u16,
//! block_header_version: u16,
use crate::grin_core::core::transaction::{KernelFeatures, OutputFeatures};
use crate::grin_core::libtx::secp_ser;
@@ -83,6 +84,8 @@ pub struct VersionCompatInfoV2 {
pub version: u16,
/// Original version this slate was converted from
pub orig_version: u16,
/// Version of grin block header this slate is compatible with
pub block_header_version: u16,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
@@ -336,10 +339,12 @@ impl From<SlateV1> for SlateV2 {
let tx = TransactionV2::from(tx);
let version = 2;
let orig_version = orig_version as u16;
let block_header_version = 1;
let participant_data = map_vec!(participant_data, |data| ParticipantDataV2::from(data));
let version_info = VersionCompatInfoV2 {
version,
orig_version,
block_header_version,
};
SlateV2 {
num_participants,
+1 -1
View File
@@ -2,7 +2,7 @@
"version_info": {
"version": 2,
"orig_version": 2,
"min_compat_version": 0
"block_header_version": 1
},
"num_participants": 2,
"id": "e0c69803-db50-40d9-a968-496e86660cd4",
+23
View File
@@ -44,6 +44,29 @@ pub fn wallet_command(wallet_args: &ArgMatches<'_>, config: GlobalWalletConfig)
let wallet_config = config.members.unwrap().wallet;
let node_client = HTTPNodeClient::new(&wallet_config.check_node_api_http_addr, None);
// TODO: Very temporary code to obsolete grin wallet for the first hard fork
// All tx operations call get_chain_height as a first order of business,
// so this is the most non-intrusive place to put this
match node_client.clone().chain_height() {
Ok(h) => {
if h >= 262080 {
let err_str = "This version of grin-wallet is obsolete as of block 252080. Please download v2.0.0 from https://github.com/mimblewimble/grin-wallet/releases";
error!("{}", err_str);
println!();
println!("**************");
println!("{}", err_str);
println!("**************");
println!("(You can still view your balances by disconnecting from the grin node, however you will not be able to transact until you upgrade)");
println!();
return 1;
}
}
// just continue if can't connect to node, as user won't be able to do
// anything meaninful anyhow
Err(_) => {}
}
let res = wallet_args::wallet_command(wallet_args, wallet_config, node_client);
// we need to give log output a chance to catch up before exiting
+14 -16
View File
@@ -21,10 +21,9 @@ use failure::Fail;
use grin_wallet_config::WalletConfig;
use grin_wallet_controller::command;
use grin_wallet_controller::{Error, ErrorKind};
use grin_wallet_impls::{instantiate_wallet, FileWalletCommAdapter, WalletSeed};
use grin_wallet_libwallet::{IssueInvoiceTxArgs, NodeClient, Slate, WalletInst};
use grin_wallet_impls::{instantiate_wallet, WalletSeed};
use grin_wallet_libwallet::{IssueInvoiceTxArgs, NodeClient, WalletInst};
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_core::core::amount_to_hr_string;
use grin_wallet_util::grin_keychain as keychain;
use linefeed::terminal::Signal;
use linefeed::{Interface, ReadResult};
@@ -32,6 +31,14 @@ use rpassword;
use std::path::Path;
use std::sync::Arc;
// shut up test compilation warnings
#[cfg(not(test))]
use grin_wallet_impls::FileWalletCommAdapter;
#[cfg(not(test))]
use grin_wallet_libwallet::Slate;
#[cfg(not(test))]
use grin_wallet_util::grin_core::core::amount_to_hr_string;
// define what to do on argument error
macro_rules! arg_parse {
( $r:expr ) => {
@@ -141,6 +148,7 @@ fn prompt_recovery_phrase() -> Result<ZeroingString, ParseError> {
Ok(phrase)
}
#[cfg(not(test))]
fn prompt_pay_invoice(slate: &Slate, method: &str, dest: &str) -> Result<bool, ParseError> {
let interface = Arc::new(Interface::new("pay")?);
let amount = amount_to_hr_string(slate.amount, false);
@@ -459,7 +467,7 @@ pub fn parse_send_args(args: &ArgMatches) -> Result<command::SendArgs, ParseErro
let v = parse_required(args, "slate_version")?;
Some(parse_u64(v, "slate_version")? as u16)
}
false => None,
false => Some(0),
}
};
@@ -610,23 +618,14 @@ pub fn parse_process_invoice_args(
// max_outputs
let max_outputs = 500;
// target slate version to create/send
let target_slate_version = {
match args.is_present("slate_version") {
true => {
let v = parse_required(args, "slate_version")?;
Some(parse_u64(v, "slate_version")? as u16)
}
false => None,
}
};
// file input only
let tx_file = parse_required(args, "input")?;
// Now we need to prompt the user whether they want to do this,
// which requires reading the slate
#[cfg(not(test))]
let adapter = FileWalletCommAdapter::new();
#[cfg(not(test))]
let slate = match adapter.receive_tx_async(&tx_file) {
Ok(s) => s,
Err(e) => return Err(ParseError::ArgumentError(format!("{}", e))),
@@ -643,7 +642,6 @@ pub fn parse_process_invoice_args(
method: method.to_owned(),
dest: dest.to_owned(),
max_outputs: max_outputs,
target_slate_version: target_slate_version,
input: tx_file.to_owned(),
})
}
+12 -12
View File
@@ -25,20 +25,20 @@ dirs = "1.0.3"
#grin_store = "1.1.0-beta.1"
# For beta release
grin_core = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
grin_chain = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
grin_util = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
grin_api = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
grin_store = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# grin_core = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# grin_keychain = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# grin_chain = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# grin_util = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# grin_api = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# grin_store = { git = "https://github.com/mimblewimble/grin", tag = "v1.1.0-beta.2" }
# For bleeding edge
#grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" }
#grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" }
#grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" }
#grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" }
#grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" }
#grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" }
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" }
grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" }
# For local testing
#grin_core = { path = "../../grin/core", version= "1.1.0-beta.2"}