mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Merge branch 'master' of github.com:bisq-network/bisq into hotfix-for-v1.1.3
# Conflicts: # build.gradle # desktop/package/linux/Dockerfile # desktop/package/linux/package.sh # desktop/package/linux/release.sh # desktop/package/macosx/create_app.sh # desktop/package/macosx/finalize.sh # desktop/package/macosx/insert_snapshot_version.sh # desktop/package/windows/package.bat # desktop/package/windows/release.bat # relay/src/main/resources/version.txt
This commit is contained in:
commit
db25293d62
257 changed files with 1455 additions and 1326 deletions
36
assets/src/main/java/bisq/asset/coins/DarkPay.java
Normal file
36
assets/src/main/java/bisq/asset/coins/DarkPay.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class DarkPay extends Coin {
|
||||
public DarkPay() {
|
||||
super("DarkPay", "D4RK", new Base58BitcoinAddressValidator(new DarkPayMainNetParams()));
|
||||
}
|
||||
|
||||
public static class DarkPayMainNetParams extends NetworkParametersAdapter {
|
||||
public DarkPayMainNetParams() {
|
||||
this.addressHeader = 31;
|
||||
this.p2shHeader = 60;
|
||||
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
37
assets/src/main/java/bisq/asset/coins/Emercoin.java
Normal file
37
assets/src/main/java/bisq/asset/coins/Emercoin.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Emercoin extends Coin {
|
||||
|
||||
public Emercoin() {
|
||||
super("Emercoin", "EMC", new Base58BitcoinAddressValidator(new EmercoinMainNetParams()), Network.MAINNET);
|
||||
}
|
||||
|
||||
public static class EmercoinMainNetParams extends NetworkParametersAdapter {
|
||||
public EmercoinMainNetParams() {
|
||||
this.addressHeader = 33;
|
||||
this.p2shHeader = 92;
|
||||
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,7 +23,7 @@ import bisq.asset.NetworkParametersAdapter;
|
|||
|
||||
public class KnowYourDeveloper extends Coin {
|
||||
public KnowYourDeveloper() {
|
||||
super("Know Your Developer", "KYD", new Base58BitcoinAddressValidator(new KydMainNetParams()));
|
||||
super("Know Your Developer", "KYDC", new Base58BitcoinAddressValidator(new KydMainNetParams()));
|
||||
}
|
||||
|
||||
public static class KydMainNetParams extends NetworkParametersAdapter {
|
||||
|
|
36
assets/src/main/java/bisq/asset/coins/Kore.java
Normal file
36
assets/src/main/java/bisq/asset/coins/Kore.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Kore extends Coin {
|
||||
public Kore() {
|
||||
super("Kore", "KORE", new Base58BitcoinAddressValidator(new KoreMainNetParams()));
|
||||
}
|
||||
|
||||
public static class KoreMainNetParams extends NetworkParametersAdapter {
|
||||
public KoreMainNetParams() {
|
||||
this.addressHeader = 45;
|
||||
this.p2shHeader = 85;
|
||||
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,12 +17,20 @@
|
|||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Namecoin extends Coin {
|
||||
|
||||
public Namecoin() {
|
||||
super("Namecoin", "NMC", new DefaultAddressValidator());
|
||||
super("Namecoin", "NMC", new Base58BitcoinAddressValidator(new NamecoinChainParams()));
|
||||
}
|
||||
|
||||
public static class NamecoinChainParams extends NetworkParametersAdapter {
|
||||
public NamecoinChainParams() {
|
||||
addressHeader = 52;
|
||||
acceptableAddressCodes = new int[]{addressHeader};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
28
assets/src/main/java/bisq/asset/coins/PENG.java
Normal file
28
assets/src/main/java/bisq/asset/coins/PENG.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class PENG extends Coin {
|
||||
|
||||
public PENG() {
|
||||
super("PENG Coin", "PENG", new RegexAddressValidator("^[P][a-km-zA-HJ-NP-Z1-9]{33}$"));
|
||||
}
|
||||
}
|
53
assets/src/main/java/bisq/asset/coins/Particl.java
Normal file
53
assets/src/main/java/bisq/asset/coins/Particl.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
import bisq.asset.AddressValidationResult;
|
||||
|
||||
|
||||
public class Particl extends Coin {
|
||||
public Particl() {
|
||||
super("Particl", "PART", new ParticlMainNetAddressValidator());
|
||||
}
|
||||
|
||||
public static class ParticlMainNetParams extends NetworkParametersAdapter {
|
||||
public ParticlMainNetParams() {
|
||||
this.addressHeader = 56;
|
||||
this.p2shHeader = 60;
|
||||
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
|
||||
}
|
||||
}
|
||||
public static class ParticlMainNetAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public ParticlMainNetAddressValidator() {
|
||||
super(new ParticlMainNetParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[RP][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
36
assets/src/main/java/bisq/asset/coins/Vertcoin.java
Normal file
36
assets/src/main/java/bisq/asset/coins/Vertcoin.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Vertcoin extends Coin {
|
||||
public Vertcoin() {
|
||||
super("Vertcoin", "VTC", new Base58BitcoinAddressValidator(new VertcoinMainNetParams()));
|
||||
}
|
||||
|
||||
public static class VertcoinMainNetParams extends NetworkParametersAdapter {
|
||||
public VertcoinMainNetParams() {
|
||||
this.addressHeader = 71;
|
||||
this.p2shHeader = 5;
|
||||
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@ bisq.asset.coins.Counterparty
|
|||
bisq.asset.coins.Credits
|
||||
bisq.asset.coins.Croat
|
||||
bisq.asset.coins.CRowdCLassic
|
||||
bisq.asset.coins.DarkPay
|
||||
bisq.asset.coins.Dash
|
||||
bisq.asset.coins.Decred
|
||||
bisq.asset.coins.DeepOnion
|
||||
|
@ -38,6 +39,7 @@ bisq.asset.coins.Dogecoin
|
|||
bisq.asset.coins.Doichain
|
||||
bisq.asset.coins.Dragonglass
|
||||
bisq.asset.coins.DSTRA
|
||||
bisq.asset.coins.Emercoin
|
||||
bisq.asset.coins.Ether
|
||||
bisq.asset.coins.EtherClassic
|
||||
bisq.asset.coins.FourtyTwo
|
||||
|
@ -53,6 +55,7 @@ bisq.asset.coins.IdaPay
|
|||
bisq.asset.coins.Iridium
|
||||
bisq.asset.coins.Kekcoin
|
||||
bisq.asset.coins.KnowYourDeveloper
|
||||
bisq.asset.coins.Kore
|
||||
bisq.asset.coins.Litecoin
|
||||
bisq.asset.coins.LitecoinPlus
|
||||
bisq.asset.coins.LitecoinZ
|
||||
|
@ -70,6 +73,8 @@ bisq.asset.coins.Navcoin
|
|||
bisq.asset.coins.Neos
|
||||
bisq.asset.coins.Noir
|
||||
bisq.asset.coins.ParsiCoin
|
||||
bisq.asset.coins.Particl
|
||||
bisq.asset.coins.PENG
|
||||
bisq.asset.coins.Persona
|
||||
bisq.asset.coins.Pinkcoin
|
||||
bisq.asset.coins.PIVX
|
||||
|
@ -92,6 +97,7 @@ bisq.asset.coins.TurtleCoin
|
|||
bisq.asset.coins.UnitedCommunityCoin
|
||||
bisq.asset.coins.Unobtanium
|
||||
bisq.asset.coins.Veil
|
||||
bisq.asset.coins.Vertcoin
|
||||
bisq.asset.coins.Webchain
|
||||
bisq.asset.coins.WrkzCoin
|
||||
bisq.asset.coins.XDR
|
||||
|
|
45
assets/src/test/java/bisq/asset/coins/DarkPayTest.java
Normal file
45
assets/src/test/java/bisq/asset/coins/DarkPayTest.java
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class DarkPayTest extends AbstractAssetTest {
|
||||
|
||||
public DarkPayTest() {
|
||||
super(new DarkPay());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("DXSi43hpVRjy1yGF3Vh3nnCK6ydwyWxVAD");
|
||||
assertValidAddress("DmHHAyocykozeW8fwJxPbn1o83dT4fDtoR");
|
||||
assertValidAddress("RSBxWDDMNxCKtnHvqf8Dsif5sm52ik36rW");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("DXSi43hpVRjy1yGF3Vh3nnCK6ydwyWxVAd");
|
||||
assertInvalidAddress("DmHHAyocykozeW888888fwJxPbn1o83dT4fDtoR");
|
||||
assertInvalidAddress("RSBxWDDMNxCKtnHvqf8Dsif5sm52ik35rW#");
|
||||
assertInvalidAddress("3GyEtTwXhxbjBtmAR3CtzeayAyshtvd44P");
|
||||
assertInvalidAddress("1CnXYrivw7pJy3asKftp41wRPgBggF9fBw");
|
||||
}
|
||||
}
|
44
assets/src/test/java/bisq/asset/coins/EmercoinTest.java
Normal file
44
assets/src/test/java/bisq/asset/coins/EmercoinTest.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class EmercoinTest extends AbstractAssetTest {
|
||||
|
||||
public EmercoinTest() {
|
||||
super(new Emercoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("EedXjU95QcVHLEFAs5EKNT9UWqAWXTyuhD"); // Regular p2pkh address
|
||||
assertValidAddress("EHNiED27Un5yKHHsGFDsQipCH4TdsTo5xb"); // Regular p2pkh address
|
||||
assertValidAddress("eMERCoinFunera1AddressXXXXXXYDAYke"); // Dummy p2sh address
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("19rem1SSWTphjsFLmcNEAvnfHaBFuDMMae"); // Valid BTC
|
||||
assertInvalidAddress("EedXjU95QcVHLEFAs5EKNT9UWqAWXTyuhE"); // Invalid EMC address
|
||||
assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg"); // Valid DOGE
|
||||
|
||||
}
|
||||
}
|
43
assets/src/test/java/bisq/asset/coins/KoreTest.java
Normal file
43
assets/src/test/java/bisq/asset/coins/KoreTest.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class KoreTest extends AbstractAssetTest {
|
||||
|
||||
public KoreTest() {
|
||||
super(new Kore());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("KViqqCDcdZn3DKJWGvmdUtmoDsxuGswzwU");
|
||||
assertValidAddress("KNnThWKeyJ5ibYL3JhuBacyjJxKXs2cXgv");
|
||||
assertValidAddress("bGcebbVyKD4PEBHeKRGX7cTydu1xRm63r4");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("KmVwB5dxph84tb15XqRUtfX1MfmP8WpWWW");
|
||||
assertInvalidAddress("Kt85555555555555c1QcQYE318zXqZUnjUB6fwjTrf1Xkb");
|
||||
assertInvalidAddress("33ny4vAPJHFu5Nic7uMHQrvCACYTKPFJ6r#");
|
||||
}
|
||||
}
|
|
@ -17,11 +17,29 @@
|
|||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetWithDefaultValidatorTest;
|
||||
import org.junit.Test;
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
public class NamecoinTest extends AbstractAssetWithDefaultValidatorTest {
|
||||
public class NamecoinTest extends AbstractAssetTest {
|
||||
|
||||
public NamecoinTest() {
|
||||
super(new Namecoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("N7yhcPhzFduWXPc11AUK9zvtnsL6sgxmRs");
|
||||
assertValidAddress("N22FRU9f3fx7Hty641D5cg95kRK6S3sbf3");
|
||||
assertValidAddress("MxmFPEPzF19JFPU3VPrRXvUbPjMQXnQerY");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("N7yhcPhzFduWXPc11AUK9zvtnsL6sgxmRsx");
|
||||
assertInvalidAddress("MxmFPEPzF19JFPU3VPrRXvUbPjMQXnQer");
|
||||
assertInvalidAddress("bc1qus65zpte6qa2408qu3540lfcyj9cx7dphfcspn");
|
||||
assertInvalidAddress("3GyEtTwXhxbjBtmAR3CtzeayAyshtvd44P");
|
||||
assertInvalidAddress("1CnXYrivw7pJy3asKftp41wRPgBggF9fBw");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
45
assets/src/test/java/bisq/asset/coins/PENGTest.java
Normal file
45
assets/src/test/java/bisq/asset/coins/PENGTest.java
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class PENGTest extends AbstractAssetTest {
|
||||
|
||||
public PENGTest() {
|
||||
super(new PENG());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("P9KqnVS9UpcJmLtCF1j4SV3fcccMuGEbhs");
|
||||
assertValidAddress("PUTXyY73s3HDvEzNJQekXMnjNjTrzFBzE2");
|
||||
assertValidAddress("PEfabj5DzRj6WBpc3jtVDorsVM5nddDxie");
|
||||
assertValidAddress("PAvXbSUAdCyd9MEtDPYYSmezmeLGL1HcjG");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("Pp9KqnVS9UpcJmLtCF1j4SV3fcccMuGEbhs");
|
||||
assertInvalidAddress("PqUTXyY73s3HDvEzNJQekXMnjNjTrzFBzE2");
|
||||
assertInvalidAddress("P8Efabj5DzRj6WBpc3jtVDorsVM5nddDxie");
|
||||
assertInvalidAddress("P9AvXbSUAdCyd9MEtDPYYSmezmeLGL1HcjG");
|
||||
}
|
||||
}
|
44
assets/src/test/java/bisq/asset/coins/ParticlTest.java
Normal file
44
assets/src/test/java/bisq/asset/coins/ParticlTest.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ParticlTest extends AbstractAssetTest {
|
||||
|
||||
public ParticlTest() {
|
||||
super(new Particl());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("PZdYWHgyhuG7NHVCzEkkx3dcLKurTpvmo6");
|
||||
assertValidAddress("RJAPhgckEgRGVPZa9WoGSWW24spskSfLTQ");
|
||||
assertValidAddress("PaqMewoBY4vufTkKeSy91su3CNwviGg4EK");
|
||||
assertValidAddress("PpWHwrkUKRYvbZbTic57YZ1zjmsV9X9Wu7");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq");
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYheO");
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhek");
|
||||
}
|
||||
}
|
43
assets/src/test/java/bisq/asset/coins/VertcoinTest.java
Normal file
43
assets/src/test/java/bisq/asset/coins/VertcoinTest.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class VertcoinTest extends AbstractAssetTest {
|
||||
|
||||
public VertcoinTest() {
|
||||
super(new Vertcoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("VmVwB5dxph84tbi5XqRUtfX1MfmP8WpWWL");
|
||||
assertValidAddress("Vt85c1QcQYE318zXqZUnjUB6fwjTrf1Xkb");
|
||||
assertValidAddress("33ny4vAPJHFu5Nic7uMHQrvCACYTKPFJ5p");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("VmVwB5dxph84tb15XqRUtfX1MfmP8WpWWW");
|
||||
assertInvalidAddress("Vt85555555555555c1QcQYE318zXqZUnjUB6fwjTrf1Xkb");
|
||||
assertInvalidAddress("33ny4vAPJHFu5Nic7uMHQrvCACYTKPFJ6r#");
|
||||
}
|
||||
}
|
|
@ -1,3 +1,7 @@
|
|||
if(JavaVersion.current() != JavaVersion.VERSION_1_10){
|
||||
// feel free to delete this if you know what you are doing
|
||||
throw new GradleException("This build must be run with java 10. see docs/build.md")
|
||||
}
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
|
|
|
@ -24,9 +24,9 @@ import java.util.concurrent.TimeUnit;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
// Helps configure listener objects that are run by the `UserThread` each second
|
||||
// and can do per second, per minute and delayed second actions.
|
||||
// and can do per second, per minute and delayed second actions. Also detects when we were in standby, and logs it.
|
||||
@Slf4j
|
||||
public class Clock {
|
||||
public class ClockWatcher {
|
||||
public static final int IDLE_TOLERANCE_MS = 20000;
|
||||
|
||||
public interface Listener {
|
||||
|
@ -46,7 +46,7 @@ public class Clock {
|
|||
private long counter = 0;
|
||||
private long lastSecondTick;
|
||||
|
||||
public Clock() {
|
||||
public ClockWatcher() {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
|
@ -66,7 +66,7 @@ public class Clock {
|
|||
long missedMs = diff - 1000;
|
||||
listeners.forEach(listener -> listener.onMissedSecondTick(missedMs));
|
||||
|
||||
if (missedMs > Clock.IDLE_TOLERANCE_MS) {
|
||||
if (missedMs > ClockWatcher.IDLE_TOLERANCE_MS) {
|
||||
log.info("We have been in standby mode for {} sec", missedMs / 1000);
|
||||
listeners.forEach(listener -> listener.onAwakeFromStandby(missedMs));
|
||||
}
|
|
@ -21,8 +21,6 @@ import bisq.common.consensus.UsedForTradeContractJson;
|
|||
import bisq.common.proto.network.NetworkPayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
@ -83,15 +81,15 @@ public final class PubKeyRing implements NetworkPayload, UsedForTradeContractJso
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.PubKeyRing toProtoMessage() {
|
||||
return PB.PubKeyRing.newBuilder()
|
||||
public protobuf.PubKeyRing toProtoMessage() {
|
||||
return protobuf.PubKeyRing.newBuilder()
|
||||
.setSignaturePubKeyBytes(ByteString.copyFrom(signaturePubKeyBytes))
|
||||
.setEncryptionPubKeyBytes(ByteString.copyFrom(encryptionPubKeyBytes))
|
||||
.setPgpPubKeyAsPem(pgpPubKeyAsPem)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PubKeyRing fromProto(PB.PubKeyRing proto) {
|
||||
public static PubKeyRing fromProto(protobuf.PubKeyRing proto) {
|
||||
return new PubKeyRing(proto.getSignaturePubKeyBytes().toByteArray(),
|
||||
proto.getEncryptionPubKeyBytes().toByteArray(),
|
||||
proto.getPgpPubKeyAsPem());
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.common.crypto;
|
|||
|
||||
import bisq.common.proto.network.NetworkPayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
@ -64,8 +62,8 @@ public final class SealedAndSigned implements NetworkPayload {
|
|||
sigPublicKey = Sig.getPublicKeyFromBytes(sigPublicKeyBytes);
|
||||
}
|
||||
|
||||
public PB.SealedAndSigned toProtoMessage() {
|
||||
return PB.SealedAndSigned.newBuilder()
|
||||
public protobuf.SealedAndSigned toProtoMessage() {
|
||||
return protobuf.SealedAndSigned.newBuilder()
|
||||
.setEncryptedSecretKey(ByteString.copyFrom(encryptedSecretKey))
|
||||
.setEncryptedPayloadWithHmac(ByteString.copyFrom(encryptedPayloadWithHmac))
|
||||
.setSignature(ByteString.copyFrom(signature))
|
||||
|
@ -73,7 +71,7 @@ public final class SealedAndSigned implements NetworkPayload {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static SealedAndSigned fromProto(PB.SealedAndSigned proto) {
|
||||
public static SealedAndSigned fromProto(protobuf.SealedAndSigned proto) {
|
||||
return new SealedAndSigned(proto.getEncryptedSecretKey().toByteArray(),
|
||||
proto.getEncryptedPayloadWithHmac().toByteArray(),
|
||||
proto.getSignature().toByteArray(),
|
||||
|
|
|
@ -20,10 +20,9 @@ package bisq.common.proto;
|
|||
import bisq.common.Payload;
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
public interface ProtoResolver {
|
||||
Payload fromProto(PB.PaymentAccountPayload proto);
|
||||
Payload fromProto(protobuf.PaymentAccountPayload proto);
|
||||
|
||||
PersistableEnvelope fromProto(PB.PersistableNetworkPayload proto);
|
||||
PersistableEnvelope fromProto(protobuf.PersistableNetworkPayload proto);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.common.proto.network;
|
|||
|
||||
import bisq.common.Envelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -41,8 +39,8 @@ public abstract class NetworkEnvelope implements Envelope {
|
|||
this.messageVersion = messageVersion;
|
||||
}
|
||||
|
||||
public PB.NetworkEnvelope.Builder getNetworkEnvelopeBuilder() {
|
||||
return PB.NetworkEnvelope.newBuilder().setMessageVersion(messageVersion);
|
||||
public protobuf.NetworkEnvelope.Builder getNetworkEnvelopeBuilder() {
|
||||
return protobuf.NetworkEnvelope.newBuilder().setMessageVersion(messageVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +49,7 @@ public abstract class NetworkEnvelope implements Envelope {
|
|||
}
|
||||
|
||||
// todo remove
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder().build();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,12 +20,11 @@ package bisq.common.proto.network;
|
|||
import bisq.common.proto.ProtoResolver;
|
||||
import bisq.common.proto.ProtobufferException;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
public interface NetworkProtoResolver extends ProtoResolver {
|
||||
NetworkEnvelope fromProto(PB.NetworkEnvelope proto) throws ProtobufferException;
|
||||
NetworkEnvelope fromProto(protobuf.NetworkEnvelope proto) throws ProtobufferException;
|
||||
|
||||
NetworkPayload fromProto(PB.StoragePayload proto);
|
||||
NetworkPayload fromProto(protobuf.StoragePayload proto);
|
||||
|
||||
NetworkPayload fromProto(PB.StorageEntryWrapper proto);
|
||||
NetworkPayload fromProto(protobuf.StorageEntryWrapper proto);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package bisq.common.proto.persistable;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
|
@ -42,12 +41,12 @@ public class NavigationPath implements PersistableEnvelope {
|
|||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
final PB.NavigationPath.Builder builder = PB.NavigationPath.newBuilder();
|
||||
final protobuf.NavigationPath.Builder builder = protobuf.NavigationPath.newBuilder();
|
||||
if (!CollectionUtils.isEmpty(path)) builder.addAllPath(path);
|
||||
return PB.PersistableEnvelope.newBuilder().setNavigationPath(builder).build();
|
||||
return protobuf.PersistableEnvelope.newBuilder().setNavigationPath(builder).build();
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.NavigationPath proto) {
|
||||
public static PersistableEnvelope fromProto(protobuf.NavigationPath proto) {
|
||||
return new NavigationPath(new ArrayList<>(proto.getPathList()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,7 @@ package bisq.common.proto.persistable;
|
|||
|
||||
import bisq.common.proto.ProtoResolver;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
public interface PersistenceProtoResolver extends ProtoResolver {
|
||||
PersistableEnvelope fromProto(PB.PersistableEnvelope persistable);
|
||||
PersistableEnvelope fromProto(protobuf.PersistableEnvelope persistable);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.common.proto.persistable.PersistableEnvelope;
|
|||
import bisq.common.proto.persistable.PersistenceProtoResolver;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.util.concurrent.CycleDetectingLockFactory;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
@ -122,7 +120,7 @@ public class FileManager<T extends PersistableEnvelope> {
|
|||
log.debug("Read from disc: {}", file.getName());
|
||||
|
||||
try (final FileInputStream fileInputStream = new FileInputStream(file)) {
|
||||
PB.PersistableEnvelope persistable = PB.PersistableEnvelope.parseDelimitedFrom(fileInputStream);
|
||||
protobuf.PersistableEnvelope persistable = protobuf.PersistableEnvelope.parseDelimitedFrom(fileInputStream);
|
||||
return (T) persistenceProtoResolver.fromProto(persistable);
|
||||
} catch (Throwable t) {
|
||||
String errorMsg = "Exception at proto read: " + t.getMessage() + " file:" + file.getAbsolutePath();
|
||||
|
@ -198,9 +196,9 @@ public class FileManager<T extends PersistableEnvelope> {
|
|||
|
||||
try {
|
||||
log.debug("Write to disc: {}", storageFile.getName());
|
||||
PB.PersistableEnvelope protoPersistable;
|
||||
protobuf.PersistableEnvelope protoPersistable;
|
||||
try {
|
||||
protoPersistable = (PB.PersistableEnvelope) persistable.toProtoMessage();
|
||||
protoPersistable = (protobuf.PersistableEnvelope) persistable.toProtoMessage();
|
||||
if (protoPersistable.toByteArray().length == 0)
|
||||
log.error("protoPersistable is empty. persistable=" + persistable.getClass().getSimpleName());
|
||||
} catch (Throwable e) {
|
||||
|
|
|
@ -64,9 +64,8 @@ public abstract class Task<T extends Model> {
|
|||
}
|
||||
|
||||
protected void failed(Throwable t) {
|
||||
t.printStackTrace();
|
||||
appendExceptionToErrorMessage(t);
|
||||
failed();
|
||||
log.error(errorMessage, t);
|
||||
taskHandler.handleErrorMessage(errorMessage);
|
||||
}
|
||||
|
||||
protected void failed() {
|
||||
|
|
|
@ -5,9 +5,9 @@ package io.bisq.protobuffer;
|
|||
// Protobuffer v3 definitions of network messages and persisted objects.
|
||||
//
|
||||
|
||||
option java_package = "io.bisq.generated.protobuffer";
|
||||
option java_outer_classname = "PB";
|
||||
|
||||
option java_package = "protobuf";
|
||||
option java_multiple_files = true;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Network messages
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -53,7 +53,7 @@ import bisq.network.p2p.P2PModule;
|
|||
import bisq.network.p2p.network.BridgeAddressProvider;
|
||||
import bisq.network.p2p.seed.SeedNodeRepository;
|
||||
|
||||
import bisq.common.Clock;
|
||||
import bisq.common.ClockWatcher;
|
||||
import bisq.common.CommonOptionKeys;
|
||||
import bisq.common.app.AppModule;
|
||||
import bisq.common.crypto.KeyRing;
|
||||
|
@ -92,7 +92,7 @@ public class CoreModule extends AppModule {
|
|||
bind(KeyStorage.class).in(Singleton.class);
|
||||
bind(KeyRing.class).in(Singleton.class);
|
||||
bind(User.class).in(Singleton.class);
|
||||
bind(Clock.class).in(Singleton.class);
|
||||
bind(ClockWatcher.class).in(Singleton.class);
|
||||
bind(Preferences.class).in(Singleton.class);
|
||||
bind(BridgeAddressProvider.class).to(Preferences.class).in(Singleton.class);
|
||||
bind(CorruptedDatabaseFilesHandler.class).in(Singleton.class);
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.app.Version;
|
|||
import bisq.common.crypto.Sig;
|
||||
import bisq.common.util.ExtraDataMapValidator;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -98,20 +96,20 @@ public final class Alert implements ProtectedStoragePayload, ExpirablePayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.StoragePayload toProtoMessage() {
|
||||
public protobuf.StoragePayload toProtoMessage() {
|
||||
checkNotNull(ownerPubKeyBytes, "storagePublicKeyBytes must not be null");
|
||||
checkNotNull(signatureAsBase64, "signatureAsBase64 must not be null");
|
||||
final PB.Alert.Builder builder = PB.Alert.newBuilder()
|
||||
final protobuf.Alert.Builder builder = protobuf.Alert.newBuilder()
|
||||
.setMessage(message)
|
||||
.setIsUpdateInfo(isUpdateInfo)
|
||||
.setVersion(version)
|
||||
.setOwnerPubKeyBytes(ByteString.copyFrom(ownerPubKeyBytes))
|
||||
.setSignatureAsBase64(signatureAsBase64);
|
||||
Optional.ofNullable(getExtraDataMap()).ifPresent(builder::putAllExtraData);
|
||||
return PB.StoragePayload.newBuilder().setAlert(builder).build();
|
||||
return protobuf.StoragePayload.newBuilder().setAlert(builder).build();
|
||||
}
|
||||
|
||||
public static Alert fromProto(PB.Alert proto) {
|
||||
public static Alert fromProto(protobuf.Alert proto) {
|
||||
return new Alert(proto.getMessage(),
|
||||
proto.getIsUpdateInfo(),
|
||||
proto.getVersion(),
|
||||
|
|
|
@ -23,8 +23,6 @@ import bisq.network.p2p.NodeAddress;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
|
||||
|
@ -57,16 +55,16 @@ public class PrivateNotificationMessage extends NetworkEnvelope implements Mailb
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setPrivateNotificationMessage(PB.PrivateNotificationMessage.newBuilder()
|
||||
.setPrivateNotificationMessage(protobuf.PrivateNotificationMessage.newBuilder()
|
||||
.setPrivateNotificationPayload(privateNotificationPayload.toProtoMessage())
|
||||
.setSenderNodeAddress(senderNodeAddress.toProtoMessage())
|
||||
.setUid(uid))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PrivateNotificationMessage fromProto(PB.PrivateNotificationMessage proto, int messageVersion) {
|
||||
public static PrivateNotificationMessage fromProto(protobuf.PrivateNotificationMessage proto, int messageVersion) {
|
||||
return new PrivateNotificationMessage(PrivateNotificationPayload.fromProto(proto.getPrivateNotificationPayload()),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.common.crypto.Sig;
|
|||
import bisq.common.proto.network.NetworkPayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
@ -63,17 +61,17 @@ public final class PrivateNotificationPayload implements NetworkPayload {
|
|||
sigPublicKey = Sig.getPublicKeyFromBytes(sigPublicKeyBytes);
|
||||
}
|
||||
|
||||
public static PrivateNotificationPayload fromProto(PB.PrivateNotificationPayload proto) {
|
||||
public static PrivateNotificationPayload fromProto(protobuf.PrivateNotificationPayload proto) {
|
||||
return new PrivateNotificationPayload(proto.getMessage(),
|
||||
proto.getSignatureAsBase64(),
|
||||
proto.getSigPublicKeyBytes().toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PB.PrivateNotificationPayload toProtoMessage() {
|
||||
public protobuf.PrivateNotificationPayload toProtoMessage() {
|
||||
checkNotNull(sigPublicKeyBytes, "sigPublicKeyBytes must not be null");
|
||||
checkNotNull(signatureAsBase64, "signatureAsBase64 must not be null");
|
||||
return PB.PrivateNotificationPayload.newBuilder()
|
||||
return protobuf.PrivateNotificationPayload.newBuilder()
|
||||
.setMessage(message)
|
||||
.setSignatureAsBase64(signatureAsBase64)
|
||||
.setSigPublicKeyBytes(ByteString.copyFrom(sigPublicKeyBytes))
|
||||
|
|
|
@ -191,13 +191,12 @@ public class BisqEnvironment extends StandardEnvironment {
|
|||
@Getter
|
||||
protected List<String> bannedSeedNodes, bannedBtcNodes, bannedPriceRelayNodes;
|
||||
|
||||
protected final String btcNodes, seedNodes, ignoreDevMsg, useDevPrivilegeKeys, useDevMode, useTorForBtc, rpcUser,
|
||||
rpcPassword, rpcPort, rpcBlockNotificationPort, dumpBlockchainData, fullDaoNode,
|
||||
protected final String btcNodes, seedNodes, ignoreDevMsg, useDevPrivilegeKeys, useDevMode, useTorForBtc, rpcUser, rpcPassword,
|
||||
rpcHost, rpcPort, rpcBlockNotificationPort, dumpBlockchainData, fullDaoNode,
|
||||
banList, dumpStatistics, maxMemory, socks5ProxyBtcAddress,
|
||||
torRcFile, torRcOptions, externalTorControlPort, externalTorPassword, externalTorCookieFile,
|
||||
socks5ProxyHttpAddress, useAllProvidedNodes, numConnectionForBtc, genesisTxId, genesisBlockHeight,
|
||||
genesisTotalSupply, referralId, daoActivated, msgThrottlePerSec, msgThrottlePer10Sec, sendMsgThrottleTrigger,
|
||||
sendMsgThrottleSleep, ignoreLocalBtcNode;
|
||||
socks5ProxyHttpAddress, useAllProvidedNodes, numConnectionForBtc, genesisTxId, genesisBlockHeight, genesisTotalSupply,
|
||||
referralId, daoActivated, msgThrottlePerSec, msgThrottlePer10Sec, sendMsgThrottleTrigger, sendMsgThrottleSleep, ignoreLocalBtcNode;
|
||||
|
||||
protected final boolean externalTorUseSafeCookieAuthentication, torStreamIsolation;
|
||||
|
||||
|
@ -306,6 +305,9 @@ public class BisqEnvironment extends StandardEnvironment {
|
|||
rpcPassword = commandLineProperties.containsProperty(DaoOptionKeys.RPC_PASSWORD) ?
|
||||
(String) commandLineProperties.getProperty(DaoOptionKeys.RPC_PASSWORD) :
|
||||
"";
|
||||
rpcHost = commandLineProperties.containsProperty(DaoOptionKeys.RPC_HOST) ?
|
||||
(String) commandLineProperties.getProperty(DaoOptionKeys.RPC_HOST) :
|
||||
"";
|
||||
rpcPort = commandLineProperties.containsProperty(DaoOptionKeys.RPC_PORT) ?
|
||||
(String) commandLineProperties.getProperty(DaoOptionKeys.RPC_PORT) :
|
||||
"";
|
||||
|
@ -504,6 +506,7 @@ public class BisqEnvironment extends StandardEnvironment {
|
|||
|
||||
setProperty(DaoOptionKeys.RPC_USER, rpcUser);
|
||||
setProperty(DaoOptionKeys.RPC_PASSWORD, rpcPassword);
|
||||
setProperty(DaoOptionKeys.RPC_HOST, rpcHost);
|
||||
setProperty(DaoOptionKeys.RPC_PORT, rpcPort);
|
||||
setProperty(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT, rpcBlockNotificationPort);
|
||||
setProperty(DaoOptionKeys.DUMP_BLOCKCHAIN_DATA, dumpBlockchainData);
|
||||
|
|
|
@ -541,6 +541,10 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
|||
"Bitcoind rpc password")
|
||||
.withRequiredArg();
|
||||
|
||||
parser.accepts(DaoOptionKeys.RPC_HOST,
|
||||
"Bitcoind rpc host")
|
||||
.withRequiredArg();
|
||||
|
||||
parser.accepts(DaoOptionKeys.RPC_PORT,
|
||||
"Bitcoind rpc port")
|
||||
.withRequiredArg();
|
||||
|
|
|
@ -58,7 +58,7 @@ import bisq.network.crypto.EncryptionService;
|
|||
import bisq.network.p2p.P2PService;
|
||||
import bisq.network.p2p.peers.keepalive.messages.Ping;
|
||||
|
||||
import bisq.common.Clock;
|
||||
import bisq.common.ClockWatcher;
|
||||
import bisq.common.Timer;
|
||||
import bisq.common.UserThread;
|
||||
import bisq.common.app.DevEnv;
|
||||
|
@ -134,7 +134,7 @@ public class BisqSetup {
|
|||
private final PrivateNotificationManager privateNotificationManager;
|
||||
private final FilterManager filterManager;
|
||||
private final TradeStatisticsManager tradeStatisticsManager;
|
||||
private final Clock clock;
|
||||
private final ClockWatcher clockWatcher;
|
||||
private final FeeService feeService;
|
||||
private final DaoSetup daoSetup;
|
||||
private final EncryptionService encryptionService;
|
||||
|
@ -212,7 +212,7 @@ public class BisqSetup {
|
|||
PrivateNotificationManager privateNotificationManager,
|
||||
FilterManager filterManager,
|
||||
TradeStatisticsManager tradeStatisticsManager,
|
||||
Clock clock,
|
||||
ClockWatcher clockWatcher,
|
||||
FeeService feeService,
|
||||
DaoSetup daoSetup,
|
||||
EncryptionService encryptionService,
|
||||
|
@ -252,7 +252,7 @@ public class BisqSetup {
|
|||
this.privateNotificationManager = privateNotificationManager;
|
||||
this.filterManager = filterManager;
|
||||
this.tradeStatisticsManager = tradeStatisticsManager;
|
||||
this.clock = clock;
|
||||
this.clockWatcher = clockWatcher;
|
||||
this.feeService = feeService;
|
||||
this.daoSetup = daoSetup;
|
||||
this.encryptionService = encryptionService;
|
||||
|
@ -599,7 +599,7 @@ public class BisqSetup {
|
|||
private void initDomainServices() {
|
||||
log.info("initDomainServices");
|
||||
|
||||
clock.start();
|
||||
clockWatcher.start();
|
||||
|
||||
tradeLimits.onAllServicesInitialized();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import bisq.network.p2p.P2PModule;
|
|||
import bisq.network.p2p.network.BridgeAddressProvider;
|
||||
import bisq.network.p2p.seed.SeedNodeRepository;
|
||||
|
||||
import bisq.common.Clock;
|
||||
import bisq.common.ClockWatcher;
|
||||
import bisq.common.CommonOptionKeys;
|
||||
import bisq.common.app.AppModule;
|
||||
import bisq.common.crypto.KeyRing;
|
||||
|
@ -69,7 +69,7 @@ public class ModuleForAppWithP2p extends AppModule {
|
|||
bind(KeyStorage.class).in(Singleton.class);
|
||||
bind(KeyRing.class).in(Singleton.class);
|
||||
bind(User.class).in(Singleton.class);
|
||||
bind(Clock.class).in(Singleton.class);
|
||||
bind(ClockWatcher.class).in(Singleton.class);
|
||||
bind(NetworkProtoResolver.class).to(CoreNetworkProtoResolver.class).in(Singleton.class);
|
||||
bind(PersistenceProtoResolver.class).to(CorePersistenceProtoResolver.class).in(Singleton.class);
|
||||
bind(Preferences.class).in(Singleton.class);
|
||||
|
|
|
@ -26,8 +26,6 @@ import bisq.common.proto.ProtoUtil;
|
|||
import bisq.common.util.ExtraDataMapValidator;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -100,8 +98,8 @@ public final class Arbitrator implements ProtectedStoragePayload, ExpirablePaylo
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.StoragePayload toProtoMessage() {
|
||||
final PB.Arbitrator.Builder builder = PB.Arbitrator.newBuilder()
|
||||
public protobuf.StoragePayload toProtoMessage() {
|
||||
final protobuf.Arbitrator.Builder builder = protobuf.Arbitrator.newBuilder()
|
||||
.setNodeAddress(nodeAddress.toProtoMessage())
|
||||
.setBtcPubKey(ByteString.copyFrom(btcPubKey))
|
||||
.setBtcAddress(btcAddress)
|
||||
|
@ -113,10 +111,10 @@ public final class Arbitrator implements ProtectedStoragePayload, ExpirablePaylo
|
|||
Optional.ofNullable(emailAddress).ifPresent(builder::setEmailAddress);
|
||||
Optional.ofNullable(info).ifPresent(builder::setInfo);
|
||||
Optional.ofNullable(extraDataMap).ifPresent(builder::putAllExtraData);
|
||||
return PB.StoragePayload.newBuilder().setArbitrator(builder).build();
|
||||
return protobuf.StoragePayload.newBuilder().setArbitrator(builder).build();
|
||||
}
|
||||
|
||||
public static Arbitrator fromProto(PB.Arbitrator proto) {
|
||||
public static Arbitrator fromProto(protobuf.Arbitrator proto) {
|
||||
return new Arbitrator(NodeAddress.fromProto(proto.getNodeAddress()),
|
||||
proto.getBtcPubKey().toByteArray(),
|
||||
proto.getBtcAddress(),
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.arbitration;
|
|||
|
||||
import bisq.common.proto.network.NetworkPayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import lombok.Value;
|
||||
|
@ -36,14 +34,14 @@ public final class Attachment implements NetworkPayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.Attachment toProtoMessage() {
|
||||
return PB.Attachment.newBuilder()
|
||||
public protobuf.Attachment toProtoMessage() {
|
||||
return protobuf.Attachment.newBuilder()
|
||||
.setFileName(fileName)
|
||||
.setBytes(ByteString.copyFrom(bytes))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static Attachment fromProto(PB.Attachment proto) {
|
||||
public static Attachment fromProto(protobuf.Attachment proto) {
|
||||
return new Attachment(proto.getFileName(), proto.getBytes().toByteArray());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ import bisq.common.proto.network.NetworkPayload;
|
|||
import bisq.common.storage.Storage;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
|
@ -180,8 +178,8 @@ public final class Dispute implements NetworkPayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.Dispute toProtoMessage() {
|
||||
PB.Dispute.Builder builder = PB.Dispute.newBuilder()
|
||||
public protobuf.Dispute toProtoMessage() {
|
||||
protobuf.Dispute.Builder builder = protobuf.Dispute.newBuilder()
|
||||
.setTradeId(tradeId)
|
||||
.setTraderId(traderId)
|
||||
.setDisputeOpenerIsBuyer(disputeOpenerIsBuyer)
|
||||
|
@ -211,7 +209,7 @@ public final class Dispute implements NetworkPayload {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
public static Dispute fromProto(PB.Dispute proto, CoreProtoResolver coreProtoResolver) {
|
||||
public static Dispute fromProto(protobuf.Dispute proto, CoreProtoResolver coreProtoResolver) {
|
||||
final Dispute dispute = new Dispute(proto.getTradeId(),
|
||||
proto.getTraderId(),
|
||||
proto.getDisputeOpenerIsBuyer(),
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.proto.persistable.PersistableEnvelope;
|
|||
import bisq.common.proto.persistable.PersistedDataHost;
|
||||
import bisq.common.storage.Storage;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
|
@ -74,11 +72,11 @@ public final class DisputeList implements PersistableEnvelope, PersistedDataHost
|
|||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder().setDisputeList(PB.DisputeList.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder().setDisputeList(protobuf.DisputeList.newBuilder()
|
||||
.addAllDispute(ProtoUtil.collectionToProto(list))).build();
|
||||
}
|
||||
|
||||
public static DisputeList fromProto(PB.DisputeList proto,
|
||||
public static DisputeList fromProto(protobuf.DisputeList proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
Storage<DisputeList> storage) {
|
||||
log.debug("DisputeList fromProto of {} ", proto);
|
||||
|
|
|
@ -23,8 +23,6 @@ import bisq.common.proto.ProtoUtil;
|
|||
import bisq.common.proto.network.NetworkPayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
@ -131,7 +129,7 @@ public final class DisputeResult implements NetworkPayload {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static DisputeResult fromProto(PB.DisputeResult proto) {
|
||||
public static DisputeResult fromProto(protobuf.DisputeResult proto) {
|
||||
return new DisputeResult(proto.getTradeId(),
|
||||
proto.getTraderId(),
|
||||
ProtoUtil.enumFromProto(DisputeResult.Winner.class, proto.getWinner().name()),
|
||||
|
@ -150,8 +148,8 @@ public final class DisputeResult implements NetworkPayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.DisputeResult toProtoMessage() {
|
||||
final PB.DisputeResult.Builder builder = PB.DisputeResult.newBuilder()
|
||||
public protobuf.DisputeResult toProtoMessage() {
|
||||
final protobuf.DisputeResult.Builder builder = protobuf.DisputeResult.newBuilder()
|
||||
.setTradeId(tradeId)
|
||||
.setTraderId(traderId)
|
||||
.setReasonOrdinal(reasonOrdinal)
|
||||
|
@ -166,7 +164,7 @@ public final class DisputeResult implements NetworkPayload {
|
|||
|
||||
Optional.ofNullable(arbitratorSignature).ifPresent(arbitratorSignature -> builder.setArbitratorSignature(ByteString.copyFrom(arbitratorSignature)));
|
||||
Optional.ofNullable(arbitratorPubKey).ifPresent(arbitratorPubKey -> builder.setArbitratorPubKey(ByteString.copyFrom(arbitratorPubKey)));
|
||||
Optional.ofNullable(winner).ifPresent(result -> builder.setWinner(PB.DisputeResult.Winner.valueOf(winner.name())));
|
||||
Optional.ofNullable(winner).ifPresent(result -> builder.setWinner(protobuf.DisputeResult.Winner.valueOf(winner.name())));
|
||||
Optional.ofNullable(disputeCommunicationMessage).ifPresent(disputeCommunicationMessage ->
|
||||
builder.setDisputeCommunicationMessage(disputeCommunicationMessage.toProtoNetworkEnvelope().getDisputeCommunicationMessage()));
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ import bisq.common.crypto.PubKeyRing;
|
|||
import bisq.common.proto.ProtoUtil;
|
||||
import bisq.common.util.ExtraDataMapValidator;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -94,8 +92,8 @@ public final class Mediator implements ProtectedStoragePayload, ExpirablePayload
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.StoragePayload toProtoMessage() {
|
||||
final PB.Mediator.Builder builder = PB.Mediator.newBuilder()
|
||||
public protobuf.StoragePayload toProtoMessage() {
|
||||
final protobuf.Mediator.Builder builder = protobuf.Mediator.newBuilder()
|
||||
.setNodeAddress(nodeAddress.toProtoMessage())
|
||||
.setPubKeyRing(pubKeyRing.toProtoMessage())
|
||||
.addAllLanguageCodes(languageCodes)
|
||||
|
@ -105,10 +103,10 @@ public final class Mediator implements ProtectedStoragePayload, ExpirablePayload
|
|||
Optional.ofNullable(emailAddress).ifPresent(builder::setEmailAddress);
|
||||
Optional.ofNullable(info).ifPresent(builder::setInfo);
|
||||
Optional.ofNullable(extraDataMap).ifPresent(builder::putAllExtraData);
|
||||
return PB.StoragePayload.newBuilder().setMediator(builder).build();
|
||||
return protobuf.StoragePayload.newBuilder().setMediator(builder).build();
|
||||
}
|
||||
|
||||
public static Mediator fromProto(PB.Mediator proto) {
|
||||
public static Mediator fromProto(protobuf.Mediator proto) {
|
||||
return new Mediator(NodeAddress.fromProto(proto.getNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
proto.getLanguageCodesList().stream().collect(Collectors.toList()),
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.network.p2p.NodeAddress;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.ReadOnlyBooleanProperty;
|
||||
import javafx.beans.property.ReadOnlyStringProperty;
|
||||
|
@ -133,8 +131,8 @@ public final class DisputeCommunicationMessage extends DisputeMessage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
PB.DisputeCommunicationMessage.Builder builder = PB.DisputeCommunicationMessage.newBuilder()
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
protobuf.DisputeCommunicationMessage.Builder builder = protobuf.DisputeCommunicationMessage.newBuilder()
|
||||
.setTradeId(tradeId)
|
||||
.setTraderId(traderId)
|
||||
.setSenderIsTrader(senderIsTrader)
|
||||
|
@ -154,7 +152,7 @@ public final class DisputeCommunicationMessage extends DisputeMessage {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static DisputeCommunicationMessage fromProto(PB.DisputeCommunicationMessage proto, int messageVersion) {
|
||||
public static DisputeCommunicationMessage fromProto(protobuf.DisputeCommunicationMessage proto, int messageVersion) {
|
||||
final DisputeCommunicationMessage disputeCommunicationMessage = new DisputeCommunicationMessage(
|
||||
proto.getTradeId(),
|
||||
proto.getTraderId(),
|
||||
|
@ -174,7 +172,7 @@ public final class DisputeCommunicationMessage extends DisputeMessage {
|
|||
return disputeCommunicationMessage;
|
||||
}
|
||||
|
||||
public static DisputeCommunicationMessage fromPayloadProto(PB.DisputeCommunicationMessage proto) {
|
||||
public static DisputeCommunicationMessage fromPayloadProto(protobuf.DisputeCommunicationMessage proto) {
|
||||
// We have the case that an envelope got wrapped into a payload.
|
||||
// We don't check the message version here as it was checked in the carrier envelope already (in connection class)
|
||||
// Payloads don't have a message version and are also used for persistence
|
||||
|
|
|
@ -23,8 +23,6 @@ import bisq.network.p2p.NodeAddress;
|
|||
|
||||
import bisq.common.app.Version;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
|
||||
|
@ -60,16 +58,16 @@ public final class DisputeResultMessage extends DisputeMessage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setDisputeResultMessage(PB.DisputeResultMessage.newBuilder()
|
||||
.setDisputeResultMessage(protobuf.DisputeResultMessage.newBuilder()
|
||||
.setDisputeResult(disputeResult.toProtoMessage())
|
||||
.setSenderNodeAddress(senderNodeAddress.toProtoMessage())
|
||||
.setUid(uid))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static DisputeResultMessage fromProto(PB.DisputeResultMessage proto, int messageVersion) {
|
||||
public static DisputeResultMessage fromProto(protobuf.DisputeResultMessage proto, int messageVersion) {
|
||||
checkArgument(proto.hasDisputeResult(), "DisputeResult must be set");
|
||||
return new DisputeResultMessage(DisputeResult.fromProto(proto.getDisputeResult()),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.network.p2p.NodeAddress;
|
|||
|
||||
import bisq.common.app.Version;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
|
||||
|
@ -59,16 +57,16 @@ public final class OpenNewDisputeMessage extends DisputeMessage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setOpenNewDisputeMessage(PB.OpenNewDisputeMessage.newBuilder()
|
||||
.setOpenNewDisputeMessage(protobuf.OpenNewDisputeMessage.newBuilder()
|
||||
.setUid(uid)
|
||||
.setDispute(dispute.toProtoMessage())
|
||||
.setSenderNodeAddress(senderNodeAddress.toProtoMessage()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static OpenNewDisputeMessage fromProto(PB.OpenNewDisputeMessage proto,
|
||||
public static OpenNewDisputeMessage fromProto(protobuf.OpenNewDisputeMessage proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
return new OpenNewDisputeMessage(Dispute.fromProto(proto.getDispute(), coreProtoResolver),
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.network.p2p.NodeAddress;
|
|||
|
||||
import bisq.common.app.Version;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
|
||||
|
@ -59,16 +57,16 @@ public final class PeerOpenedDisputeMessage extends DisputeMessage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setPeerOpenedDisputeMessage(PB.PeerOpenedDisputeMessage.newBuilder()
|
||||
.setPeerOpenedDisputeMessage(protobuf.PeerOpenedDisputeMessage.newBuilder()
|
||||
.setUid(uid)
|
||||
.setDispute(dispute.toProtoMessage())
|
||||
.setSenderNodeAddress(senderNodeAddress.toProtoMessage()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PeerOpenedDisputeMessage fromProto(PB.PeerOpenedDisputeMessage proto, CoreProtoResolver coreProtoResolver, int messageVersion) {
|
||||
public static PeerOpenedDisputeMessage fromProto(protobuf.PeerOpenedDisputeMessage proto, CoreProtoResolver coreProtoResolver, int messageVersion) {
|
||||
return new PeerOpenedDisputeMessage(Dispute.fromProto(proto.getDispute(), coreProtoResolver),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.network.p2p.NodeAddress;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -64,9 +62,9 @@ public final class PeerPublishedDisputePayoutTxMessage extends DisputeMessage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setPeerPublishedDisputePayoutTxMessage(PB.PeerPublishedDisputePayoutTxMessage.newBuilder()
|
||||
.setPeerPublishedDisputePayoutTxMessage(protobuf.PeerPublishedDisputePayoutTxMessage.newBuilder()
|
||||
.setTransaction(ByteString.copyFrom(transaction))
|
||||
.setTradeId(tradeId)
|
||||
.setSenderNodeAddress(senderNodeAddress.toProtoMessage())
|
||||
|
@ -74,7 +72,7 @@ public final class PeerPublishedDisputePayoutTxMessage extends DisputeMessage {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static PeerPublishedDisputePayoutTxMessage fromProto(PB.PeerPublishedDisputePayoutTxMessage proto, int messageVersion) {
|
||||
public static PeerPublishedDisputePayoutTxMessage fromProto(protobuf.PeerPublishedDisputePayoutTxMessage proto, int messageVersion) {
|
||||
return new PeerPublishedDisputePayoutTxMessage(proto.getTransaction().toByteArray(),
|
||||
proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -23,8 +23,6 @@ import bisq.common.proto.ProtoUtil;
|
|||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
|
@ -119,7 +117,7 @@ public final class AddressEntry implements PersistablePayload {
|
|||
this.coinLockedInMultiSig = coinLockedInMultiSig.value;
|
||||
}
|
||||
|
||||
public static AddressEntry fromProto(PB.AddressEntry proto) {
|
||||
public static AddressEntry fromProto(protobuf.AddressEntry proto) {
|
||||
return new AddressEntry(proto.getPubKey().toByteArray(),
|
||||
proto.getPubKeyHash().toByteArray(),
|
||||
ProtoUtil.enumFromProto(AddressEntry.Context.class, proto.getContext().name()),
|
||||
|
@ -128,11 +126,11 @@ public final class AddressEntry implements PersistablePayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.AddressEntry toProtoMessage() {
|
||||
PB.AddressEntry.Builder builder = PB.AddressEntry.newBuilder()
|
||||
public protobuf.AddressEntry toProtoMessage() {
|
||||
protobuf.AddressEntry.Builder builder = protobuf.AddressEntry.newBuilder()
|
||||
.setPubKey(ByteString.copyFrom(pubKey))
|
||||
.setPubKeyHash(ByteString.copyFrom(pubKeyHash))
|
||||
.setContext(PB.AddressEntry.Context.valueOf(context.name()))
|
||||
.setContext(protobuf.AddressEntry.Context.valueOf(context.name()))
|
||||
.setCoinLockedInMultiSig(coinLockedInMultiSig);
|
||||
Optional.ofNullable(offerId).ifPresent(builder::setOfferId);
|
||||
return builder.build();
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.common.proto.persistable.PersistableEnvelope;
|
|||
import bisq.common.proto.persistable.PersistedDataHost;
|
||||
import bisq.common.storage.Storage;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import org.bitcoinj.core.Transaction;
|
||||
|
@ -73,7 +71,7 @@ public final class AddressEntryList implements PersistableEnvelope, PersistedDat
|
|||
this.list = list;
|
||||
}
|
||||
|
||||
public static AddressEntryList fromProto(PB.AddressEntryList proto) {
|
||||
public static AddressEntryList fromProto(protobuf.AddressEntryList proto) {
|
||||
return new AddressEntryList(new ArrayList<>(proto.getAddressEntryList().stream().map(AddressEntry::fromProto).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
|
@ -81,12 +79,12 @@ public final class AddressEntryList implements PersistableEnvelope, PersistedDat
|
|||
public Message toProtoMessage() {
|
||||
// We clone list as we got ConcurrentModificationExceptions
|
||||
List<AddressEntry> clone = new ArrayList<>(list);
|
||||
List<PB.AddressEntry> addressEntries = clone.stream()
|
||||
List<protobuf.AddressEntry> addressEntries = clone.stream()
|
||||
.map(AddressEntry::toProtoMessage)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
.setAddressEntryList(PB.AddressEntryList.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setAddressEntryList(protobuf.AddressEntryList.newBuilder()
|
||||
.addAllAddressEntry(addressEntries))
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.common.proto.network.NetworkPayload;
|
|||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -44,15 +42,15 @@ public final class RawTransactionInput implements NetworkPayload, PersistablePay
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.RawTransactionInput toProtoMessage() {
|
||||
return PB.RawTransactionInput.newBuilder()
|
||||
public protobuf.RawTransactionInput toProtoMessage() {
|
||||
return protobuf.RawTransactionInput.newBuilder()
|
||||
.setIndex(index)
|
||||
.setParentTransaction(ByteString.copyFrom(parentTransaction))
|
||||
.setValue(value)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static RawTransactionInput fromProto(PB.RawTransactionInput proto) {
|
||||
public static RawTransactionInput fromProto(protobuf.RawTransactionInput proto) {
|
||||
return new RawTransactionInput(proto.getIndex(), proto.getParentTransaction().toByteArray(), proto.getValue());
|
||||
}
|
||||
|
||||
|
|
|
@ -225,6 +225,7 @@ public class DaoModule extends AppModule {
|
|||
// Options
|
||||
bindConstant().annotatedWith(named(DaoOptionKeys.RPC_USER)).to(environment.getRequiredProperty(DaoOptionKeys.RPC_USER));
|
||||
bindConstant().annotatedWith(named(DaoOptionKeys.RPC_PASSWORD)).to(environment.getRequiredProperty(DaoOptionKeys.RPC_PASSWORD));
|
||||
bindConstant().annotatedWith(named(DaoOptionKeys.RPC_HOST)).to(environment.getRequiredProperty(DaoOptionKeys.RPC_HOST));
|
||||
bindConstant().annotatedWith(named(DaoOptionKeys.RPC_PORT)).to(environment.getRequiredProperty(DaoOptionKeys.RPC_PORT));
|
||||
bindConstant().annotatedWith(named(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT))
|
||||
.to(environment.getRequiredProperty(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT));
|
||||
|
|
|
@ -25,6 +25,7 @@ public class DaoOptionKeys {
|
|||
public static final String RPC_PASSWORD = "rpcPassword";
|
||||
public static final String RPC_PORT = "rpcPort";
|
||||
public static final String RPC_BLOCK_NOTIFICATION_PORT = "rpcBlockNotificationPort";
|
||||
public static final String RPC_HOST = "rpcHost";
|
||||
|
||||
public static final String DUMP_BLOCKCHAIN_DATA = "dumpBlockchainData";
|
||||
public static final String FULL_DAO_NODE = "fullDaoNode";
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.proto.persistable.PersistablePayload;
|
|||
import bisq.common.util.ExtraDataMapValidator;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -87,13 +85,13 @@ public final class BlindVote implements PersistablePayload, NetworkPayload, Cons
|
|||
|
||||
// Used for sending over the network
|
||||
@Override
|
||||
public PB.BlindVote toProtoMessage() {
|
||||
public protobuf.BlindVote toProtoMessage() {
|
||||
return getBuilder().build();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PB.BlindVote.Builder getBuilder() {
|
||||
PB.BlindVote.Builder builder = PB.BlindVote.newBuilder();
|
||||
public protobuf.BlindVote.Builder getBuilder() {
|
||||
protobuf.BlindVote.Builder builder = protobuf.BlindVote.newBuilder();
|
||||
builder.setEncryptedVotes(ByteString.copyFrom(encryptedVotes))
|
||||
.setTxId(txId)
|
||||
.setStake(stake)
|
||||
|
@ -103,7 +101,7 @@ public final class BlindVote implements PersistablePayload, NetworkPayload, Cons
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static BlindVote fromProto(PB.BlindVote proto) {
|
||||
public static BlindVote fromProto(protobuf.BlindVote proto) {
|
||||
return new BlindVote(proto.getEncryptedVotes().toByteArray(),
|
||||
proto.getTxId(),
|
||||
proto.getStake(),
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.governance.ConsensusCritical;
|
|||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
import bisq.common.proto.persistable.PersistableList;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -53,15 +51,15 @@ public class MyBlindVoteList extends PersistableList<BlindVote> implements Conse
|
|||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
.setMyBlindVoteList(PB.MyBlindVoteList.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setMyBlindVoteList(protobuf.MyBlindVoteList.newBuilder()
|
||||
.addAllBlindVote(getList().stream()
|
||||
.map(BlindVote::toProtoMessage)
|
||||
.collect(Collectors.toList())))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.MyBlindVoteList proto) {
|
||||
public static PersistableEnvelope fromProto(protobuf.MyBlindVoteList proto) {
|
||||
return new MyBlindVoteList(new ArrayList<>(proto.getBlindVoteList().stream()
|
||||
.map(BlindVote::fromProto)
|
||||
.collect(Collectors.toList())));
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.core.dao.state.model.governance.Vote;
|
|||
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.Value;
|
||||
|
@ -50,19 +48,19 @@ public class VoteWithProposalTxId implements PersistablePayload {
|
|||
|
||||
// Used for sending over the network
|
||||
@Override
|
||||
public PB.VoteWithProposalTxId toProtoMessage() {
|
||||
public protobuf.VoteWithProposalTxId toProtoMessage() {
|
||||
return getBuilder().build();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private PB.VoteWithProposalTxId.Builder getBuilder() {
|
||||
final PB.VoteWithProposalTxId.Builder builder = PB.VoteWithProposalTxId.newBuilder()
|
||||
private protobuf.VoteWithProposalTxId.Builder getBuilder() {
|
||||
final protobuf.VoteWithProposalTxId.Builder builder = protobuf.VoteWithProposalTxId.newBuilder()
|
||||
.setProposalTxId(proposalTxId);
|
||||
Optional.ofNullable(vote).ifPresent(e -> builder.setVote((PB.Vote) e.toProtoMessage()));
|
||||
Optional.ofNullable(vote).ifPresent(e -> builder.setVote((protobuf.Vote) e.toProtoMessage()));
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static VoteWithProposalTxId fromProto(PB.VoteWithProposalTxId proto) {
|
||||
public static VoteWithProposalTxId fromProto(protobuf.VoteWithProposalTxId proto) {
|
||||
return new VoteWithProposalTxId(proto.getProposalTxId(),
|
||||
proto.hasVote() ? Vote.fromProto(proto.getVote()) : null);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.core.dao.governance.ConsensusCritical;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableList;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -52,22 +50,22 @@ public class VoteWithProposalTxIdList extends PersistableList<VoteWithProposalTx
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static VoteWithProposalTxIdList getVoteWithProposalTxIdListFromBytes(byte[] bytes) throws InvalidProtocolBufferException {
|
||||
return VoteWithProposalTxIdList.fromProto(PB.VoteWithProposalTxIdList.parseFrom(bytes));
|
||||
return VoteWithProposalTxIdList.fromProto(protobuf.VoteWithProposalTxIdList.parseFrom(bytes));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PB.VoteWithProposalTxIdList toProtoMessage() {
|
||||
public protobuf.VoteWithProposalTxIdList toProtoMessage() {
|
||||
return getBuilder().build();
|
||||
}
|
||||
|
||||
private PB.VoteWithProposalTxIdList.Builder getBuilder() {
|
||||
return PB.VoteWithProposalTxIdList.newBuilder()
|
||||
private protobuf.VoteWithProposalTxIdList.Builder getBuilder() {
|
||||
return protobuf.VoteWithProposalTxIdList.newBuilder()
|
||||
.addAllItem(getList().stream()
|
||||
.map(VoteWithProposalTxId::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private static VoteWithProposalTxIdList fromProto(PB.VoteWithProposalTxIdList proto) {
|
||||
private static VoteWithProposalTxIdList fromProto(protobuf.VoteWithProposalTxIdList proto) {
|
||||
final ArrayList<VoteWithProposalTxId> list = proto.getItemList().stream()
|
||||
.map(VoteWithProposalTxId::fromProto).collect(Collectors.toCollection(ArrayList::new));
|
||||
return new VoteWithProposalTxIdList(list);
|
||||
|
|
|
@ -25,8 +25,6 @@ import bisq.common.app.Capability;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -48,13 +46,13 @@ public final class RepublishGovernanceDataRequest extends NetworkEnvelope implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setRepublishGovernanceDataRequest(PB.RepublishGovernanceDataRequest.newBuilder())
|
||||
.setRepublishGovernanceDataRequest(protobuf.RepublishGovernanceDataRequest.newBuilder())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.RepublishGovernanceDataRequest proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.RepublishGovernanceDataRequest proto, int messageVersion) {
|
||||
return new RepublishGovernanceDataRequest(messageVersion);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,12 +29,8 @@ import bisq.common.crypto.Hash;
|
|||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -69,23 +65,23 @@ public final class BlindVotePayload implements PersistableNetworkPayload, Persis
|
|||
this.hash = hash;
|
||||
}
|
||||
|
||||
private PB.BlindVotePayload.Builder getBlindVoteBuilder() {
|
||||
return PB.BlindVotePayload.newBuilder()
|
||||
private protobuf.BlindVotePayload.Builder getBlindVoteBuilder() {
|
||||
return protobuf.BlindVotePayload.newBuilder()
|
||||
.setBlindVote(blindVote.toProtoMessage())
|
||||
.setHash(ByteString.copyFrom(hash));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PB.PersistableNetworkPayload toProtoMessage() {
|
||||
return PB.PersistableNetworkPayload.newBuilder().setBlindVotePayload(getBlindVoteBuilder()).build();
|
||||
public protobuf.PersistableNetworkPayload toProtoMessage() {
|
||||
return protobuf.PersistableNetworkPayload.newBuilder().setBlindVotePayload(getBlindVoteBuilder()).build();
|
||||
}
|
||||
|
||||
public PB.BlindVotePayload toProtoBlindVotePayload() {
|
||||
public protobuf.BlindVotePayload toProtoBlindVotePayload() {
|
||||
return getBlindVoteBuilder().build();
|
||||
}
|
||||
|
||||
|
||||
public static BlindVotePayload fromProto(PB.BlindVotePayload proto) {
|
||||
public static BlindVotePayload fromProto(protobuf.BlindVotePayload proto) {
|
||||
return new BlindVotePayload(BlindVote.fromProto(proto.getBlindVote()),
|
||||
proto.getHash().toByteArray());
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.network.p2p.storage.payload.PersistableNetworkPayload;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -58,20 +56,20 @@ public class BlindVoteStore implements PersistableEnvelope {
|
|||
}
|
||||
|
||||
public Message toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setBlindVoteStore(getBuilder())
|
||||
.build();
|
||||
}
|
||||
|
||||
private PB.BlindVoteStore.Builder getBuilder() {
|
||||
final List<PB.BlindVotePayload> protoList = map.values().stream()
|
||||
private protobuf.BlindVoteStore.Builder getBuilder() {
|
||||
final List<protobuf.BlindVotePayload> protoList = map.values().stream()
|
||||
.map(payload -> (BlindVotePayload) payload)
|
||||
.map(BlindVotePayload::toProtoBlindVotePayload)
|
||||
.collect(Collectors.toList());
|
||||
return PB.BlindVoteStore.newBuilder().addAllItems(protoList);
|
||||
return protobuf.BlindVoteStore.newBuilder().addAllItems(protoList);
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.BlindVoteStore proto) {
|
||||
public static PersistableEnvelope fromProto(protobuf.BlindVoteStore proto) {
|
||||
List<BlindVotePayload> list = proto.getItemsList().stream()
|
||||
.map(BlindVotePayload::fromProto).collect(Collectors.toList());
|
||||
return new BlindVoteStore(list);
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.proto.network.NetworkPayload;
|
|||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -69,14 +67,14 @@ public final class MyReputation implements PersistablePayload, NetworkPayload, B
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.MyReputation toProtoMessage() {
|
||||
return PB.MyReputation.newBuilder()
|
||||
public protobuf.MyReputation toProtoMessage() {
|
||||
return protobuf.MyReputation.newBuilder()
|
||||
.setUid(uid)
|
||||
.setSalt(ByteString.copyFrom(salt))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static MyReputation fromProto(PB.MyReputation proto) {
|
||||
public static MyReputation fromProto(protobuf.MyReputation proto) {
|
||||
return new MyReputation(proto.getUid(), proto.getSalt().toByteArray());
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.dao.governance.bond.reputation;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableList;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -47,18 +45,18 @@ public class MyReputationList extends PersistableList<MyReputation> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.PersistableEnvelope toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder().setMyReputationList(getBuilder()).build();
|
||||
public protobuf.PersistableEnvelope toProtoMessage() {
|
||||
return protobuf.PersistableEnvelope.newBuilder().setMyReputationList(getBuilder()).build();
|
||||
}
|
||||
|
||||
private PB.MyReputationList.Builder getBuilder() {
|
||||
return PB.MyReputationList.newBuilder()
|
||||
private protobuf.MyReputationList.Builder getBuilder() {
|
||||
return protobuf.MyReputationList.newBuilder()
|
||||
.addAllMyReputation(getList().stream()
|
||||
.map(MyReputation::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public static MyReputationList fromProto(PB.MyReputationList proto) {
|
||||
public static MyReputationList fromProto(protobuf.MyReputationList proto) {
|
||||
return new MyReputationList(new ArrayList<>(proto.getMyReputationList().stream()
|
||||
.map(MyReputation::fromProto)
|
||||
.collect(Collectors.toList())));
|
||||
|
|
|
@ -29,8 +29,6 @@ import bisq.common.proto.persistable.PersistablePayload;
|
|||
import bisq.common.util.JsonExclude;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
|
@ -101,8 +99,8 @@ public class MyVote implements PersistablePayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.MyVote toProtoMessage() {
|
||||
final PB.MyVote.Builder builder = PB.MyVote.newBuilder()
|
||||
public protobuf.MyVote toProtoMessage() {
|
||||
final protobuf.MyVote.Builder builder = protobuf.MyVote.newBuilder()
|
||||
.setHeight(height)
|
||||
.setBlindVote(blindVote.getBuilder())
|
||||
.setBallotList(ballotList.getBuilder())
|
||||
|
@ -112,7 +110,7 @@ public class MyVote implements PersistablePayload {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
public static MyVote fromProto(PB.MyVote proto) {
|
||||
public static MyVote fromProto(protobuf.MyVote proto) {
|
||||
return new MyVote(proto.getHeight(),
|
||||
BallotList.fromProto(proto.getBallotList()),
|
||||
proto.getSecretKeyEncoded().toByteArray(),
|
||||
|
|
|
@ -20,8 +20,6 @@ package bisq.core.dao.governance.myvote;
|
|||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
import bisq.common.proto.persistable.PersistableList;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -47,15 +45,15 @@ public class MyVoteList extends PersistableList<MyVote> {
|
|||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
.setMyVoteList(PB.MyVoteList.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setMyVoteList(protobuf.MyVoteList.newBuilder()
|
||||
.addAllMyVote(getList().stream()
|
||||
.map(MyVote::toProtoMessage)
|
||||
.collect(Collectors.toList())))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.MyVoteList proto) {
|
||||
public static PersistableEnvelope fromProto(protobuf.MyVoteList proto) {
|
||||
return new MyVoteList(new ArrayList<>(proto.getMyVoteList().stream()
|
||||
.map(MyVote::fromProto)
|
||||
.collect(Collectors.toList())));
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.locale.Res;
|
|||
|
||||
import bisq.common.proto.ProtoUtil;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
@ -239,7 +237,7 @@ public enum Param {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static Param fromProto(PB.ChangeParamProposal proposalProto) {
|
||||
public static Param fromProto(protobuf.ChangeParamProposal proposalProto) {
|
||||
Param param;
|
||||
try {
|
||||
param = ProtoUtil.enumFromProto(Param.class, proposalProto.getParam());
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.common.proto.network.NetworkPayload;
|
|||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -56,14 +54,14 @@ public final class MyProofOfBurn implements PersistablePayload, NetworkPayload {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.MyProofOfBurn toProtoMessage() {
|
||||
return PB.MyProofOfBurn.newBuilder()
|
||||
public protobuf.MyProofOfBurn toProtoMessage() {
|
||||
return protobuf.MyProofOfBurn.newBuilder()
|
||||
.setTxId(txId)
|
||||
.setPreImage(preImage)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static MyProofOfBurn fromProto(PB.MyProofOfBurn proto) {
|
||||
public static MyProofOfBurn fromProto(protobuf.MyProofOfBurn proto) {
|
||||
return new MyProofOfBurn(proto.getTxId(), proto.getPreImage());
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.dao.governance.proofofburn;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableList;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -47,18 +45,18 @@ public class MyProofOfBurnList extends PersistableList<MyProofOfBurn> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.PersistableEnvelope toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder().setMyProofOfBurnList(getBuilder()).build();
|
||||
public protobuf.PersistableEnvelope toProtoMessage() {
|
||||
return protobuf.PersistableEnvelope.newBuilder().setMyProofOfBurnList(getBuilder()).build();
|
||||
}
|
||||
|
||||
private PB.MyProofOfBurnList.Builder getBuilder() {
|
||||
return PB.MyProofOfBurnList.newBuilder()
|
||||
private protobuf.MyProofOfBurnList.Builder getBuilder() {
|
||||
return protobuf.MyProofOfBurnList.newBuilder()
|
||||
.addAllMyProofOfBurn(getList().stream()
|
||||
.map(MyProofOfBurn::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public static MyProofOfBurnList fromProto(PB.MyProofOfBurnList proto) {
|
||||
public static MyProofOfBurnList fromProto(protobuf.MyProofOfBurnList proto) {
|
||||
return new MyProofOfBurnList(new ArrayList<>(proto.getMyProofOfBurnList().stream()
|
||||
.map(MyProofOfBurn::fromProto)
|
||||
.collect(Collectors.toList())));
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.state.model.governance.Proposal;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableList;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -50,18 +48,18 @@ public class MyProposalList extends PersistableList<Proposal> implements Consens
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.PersistableEnvelope toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder().setMyProposalList(getBuilder()).build();
|
||||
public protobuf.PersistableEnvelope toProtoMessage() {
|
||||
return protobuf.PersistableEnvelope.newBuilder().setMyProposalList(getBuilder()).build();
|
||||
}
|
||||
|
||||
private PB.MyProposalList.Builder getBuilder() {
|
||||
return PB.MyProposalList.newBuilder()
|
||||
private protobuf.MyProposalList.Builder getBuilder() {
|
||||
return protobuf.MyProposalList.newBuilder()
|
||||
.addAllProposal(getList().stream()
|
||||
.map(Proposal::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public static MyProposalList fromProto(PB.MyProposalList proto) {
|
||||
public static MyProposalList fromProto(protobuf.MyProposalList proto) {
|
||||
return new MyProposalList(new ArrayList<>(proto.getProposalList().stream()
|
||||
.map(Proposal::fromProto)
|
||||
.collect(Collectors.toList())));
|
||||
|
|
|
@ -29,8 +29,6 @@ import bisq.common.crypto.Hash;
|
|||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import lombok.Value;
|
||||
|
@ -64,25 +62,25 @@ public class ProposalPayload implements PersistableNetworkPayload, PersistableEn
|
|||
this.hash = hash;
|
||||
}
|
||||
|
||||
private PB.ProposalPayload.Builder getProposalBuilder() {
|
||||
return PB.ProposalPayload.newBuilder()
|
||||
private protobuf.ProposalPayload.Builder getProposalBuilder() {
|
||||
return protobuf.ProposalPayload.newBuilder()
|
||||
.setProposal(proposal.toProtoMessage())
|
||||
.setHash(ByteString.copyFrom(hash));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PB.PersistableNetworkPayload toProtoMessage() {
|
||||
return PB.PersistableNetworkPayload.newBuilder()
|
||||
public protobuf.PersistableNetworkPayload toProtoMessage() {
|
||||
return protobuf.PersistableNetworkPayload.newBuilder()
|
||||
.setProposalPayload(getProposalBuilder())
|
||||
.build();
|
||||
}
|
||||
|
||||
public PB.ProposalPayload toProtoProposalPayload() {
|
||||
public protobuf.ProposalPayload toProtoProposalPayload() {
|
||||
return getProposalBuilder().build();
|
||||
}
|
||||
|
||||
|
||||
public static ProposalPayload fromProto(PB.ProposalPayload proto) {
|
||||
public static ProposalPayload fromProto(protobuf.ProposalPayload proto) {
|
||||
return new ProposalPayload(Proposal.fromProto(proto.getProposal()),
|
||||
proto.getHash().toByteArray());
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.network.p2p.storage.payload.PersistableNetworkPayload;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -58,20 +56,20 @@ public class ProposalStore implements PersistableEnvelope {
|
|||
}
|
||||
|
||||
public Message toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setProposalStore(getBuilder())
|
||||
.build();
|
||||
}
|
||||
|
||||
private PB.ProposalStore.Builder getBuilder() {
|
||||
final List<PB.ProposalPayload> protoList = map.values().stream()
|
||||
private protobuf.ProposalStore.Builder getBuilder() {
|
||||
final List<protobuf.ProposalPayload> protoList = map.values().stream()
|
||||
.map(payload -> (ProposalPayload) payload)
|
||||
.map(ProposalPayload::toProtoProposalPayload)
|
||||
.collect(Collectors.toList());
|
||||
return PB.ProposalStore.newBuilder().addAllItems(protoList);
|
||||
return protobuf.ProposalStore.newBuilder().addAllItems(protoList);
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.ProposalStore proto) {
|
||||
public static PersistableEnvelope fromProto(protobuf.ProposalStore proto) {
|
||||
List<ProposalPayload> list = proto.getItemsList().stream()
|
||||
.map(ProposalPayload::fromProto).collect(Collectors.toList());
|
||||
return new ProposalStore(list);
|
||||
|
|
|
@ -30,8 +30,6 @@ import bisq.common.crypto.Sig;
|
|||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
import bisq.common.util.ExtraDataMapValidator;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -94,8 +92,8 @@ public class TempProposalPayload implements LazyProcessedPayload, ProtectedStora
|
|||
ownerPubKey = Sig.getPublicKeyFromBytes(ownerPubKeyEncoded);
|
||||
}
|
||||
|
||||
private PB.TempProposalPayload.Builder getTempProposalPayloadBuilder() {
|
||||
final PB.TempProposalPayload.Builder builder = PB.TempProposalPayload.newBuilder()
|
||||
private protobuf.TempProposalPayload.Builder getTempProposalPayloadBuilder() {
|
||||
final protobuf.TempProposalPayload.Builder builder = protobuf.TempProposalPayload.newBuilder()
|
||||
.setProposal(proposal.getProposalBuilder())
|
||||
.setOwnerPubKeyEncoded(ByteString.copyFrom(ownerPubKeyEncoded));
|
||||
Optional.ofNullable(extraDataMap).ifPresent(builder::putAllExtraData);
|
||||
|
@ -103,11 +101,11 @@ public class TempProposalPayload implements LazyProcessedPayload, ProtectedStora
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.StoragePayload toProtoMessage() {
|
||||
return PB.StoragePayload.newBuilder().setTempProposalPayload(getTempProposalPayloadBuilder()).build();
|
||||
public protobuf.StoragePayload toProtoMessage() {
|
||||
return protobuf.StoragePayload.newBuilder().setTempProposalPayload(getTempProposalPayloadBuilder()).build();
|
||||
}
|
||||
|
||||
public static TempProposalPayload fromProto(PB.TempProposalPayload proto) {
|
||||
public static TempProposalPayload fromProto(protobuf.TempProposalPayload proto) {
|
||||
return new TempProposalPayload(Proposal.fromProto(proto.getProposal()),
|
||||
proto.getOwnerPubKeyEncoded().toByteArray(),
|
||||
CollectionUtils.isEmpty(proto.getExtraDataMap()) ? null : proto.getExtraDataMap());
|
||||
|
|
|
@ -23,8 +23,6 @@ import bisq.network.p2p.storage.payload.ProtectedStorageEntry;
|
|||
import bisq.common.proto.network.NetworkProtoResolver;
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -62,19 +60,19 @@ public class TempProposalStore implements PersistableEnvelope {
|
|||
}
|
||||
|
||||
public Message toProtoMessage() {
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setTempProposalStore(getBuilder())
|
||||
.build();
|
||||
}
|
||||
|
||||
private PB.TempProposalStore.Builder getBuilder() {
|
||||
final List<PB.ProtectedStorageEntry> protoList = map.values().stream()
|
||||
private protobuf.TempProposalStore.Builder getBuilder() {
|
||||
final List<protobuf.ProtectedStorageEntry> protoList = map.values().stream()
|
||||
.map(ProtectedStorageEntry::toProtectedStorageEntry)
|
||||
.collect(Collectors.toList());
|
||||
return PB.TempProposalStore.newBuilder().addAllItems(protoList);
|
||||
return protobuf.TempProposalStore.newBuilder().addAllItems(protoList);
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.TempProposalStore proto, NetworkProtoResolver networkProtoResolver) {
|
||||
public static PersistableEnvelope fromProto(protobuf.TempProposalStore proto, NetworkProtoResolver networkProtoResolver) {
|
||||
List<ProtectedStorageEntry> list = proto.getItemsList().stream()
|
||||
.map(entry -> ProtectedStorageEntry.fromProto(entry, networkProtoResolver))
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
package bisq.core.dao.monitoring.model;
|
||||
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -41,15 +39,15 @@ public final class BlindVoteStateHash extends StateHash {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.BlindVoteStateHash toProtoMessage() {
|
||||
return PB.BlindVoteStateHash.newBuilder()
|
||||
public protobuf.BlindVoteStateHash toProtoMessage() {
|
||||
return protobuf.BlindVoteStateHash.newBuilder()
|
||||
.setHeight(height)
|
||||
.setHash(ByteString.copyFrom(hash))
|
||||
.setPrevHash(ByteString.copyFrom(prevHash))
|
||||
.setNumBlindVotes(numBlindVotes).build();
|
||||
}
|
||||
|
||||
public static BlindVoteStateHash fromProto(PB.BlindVoteStateHash proto) {
|
||||
public static BlindVoteStateHash fromProto(protobuf.BlindVoteStateHash proto) {
|
||||
return new BlindVoteStateHash(proto.getHeight(),
|
||||
proto.getHash().toByteArray(),
|
||||
proto.getPrevHash().toByteArray(),
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package bisq.core.dao.monitoring.model;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
|
@ -35,14 +34,14 @@ public final class DaoStateHash extends StateHash {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.DaoStateHash toProtoMessage() {
|
||||
return PB.DaoStateHash.newBuilder()
|
||||
public protobuf.DaoStateHash toProtoMessage() {
|
||||
return protobuf.DaoStateHash.newBuilder()
|
||||
.setHeight(height)
|
||||
.setHash(ByteString.copyFrom(hash))
|
||||
.setPrevHash(ByteString.copyFrom(prevHash)).build();
|
||||
}
|
||||
|
||||
public static DaoStateHash fromProto(PB.DaoStateHash proto) {
|
||||
public static DaoStateHash fromProto(protobuf.DaoStateHash proto) {
|
||||
return new DaoStateHash(proto.getHeight(),
|
||||
proto.getHash().toByteArray(),
|
||||
proto.getPrevHash().toByteArray());
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
package bisq.core.dao.monitoring.model;
|
||||
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -41,15 +39,15 @@ public final class ProposalStateHash extends StateHash {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.ProposalStateHash toProtoMessage() {
|
||||
return PB.ProposalStateHash.newBuilder()
|
||||
public protobuf.ProposalStateHash toProtoMessage() {
|
||||
return protobuf.ProposalStateHash.newBuilder()
|
||||
.setHeight(height)
|
||||
.setHash(ByteString.copyFrom(hash))
|
||||
.setPrevHash(ByteString.copyFrom(prevHash))
|
||||
.setNumProposals(numProposals).build();
|
||||
}
|
||||
|
||||
public static ProposalStateHash fromProto(PB.ProposalStateHash proto) {
|
||||
public static ProposalStateHash fromProto(protobuf.ProposalStateHash proto) {
|
||||
return new ProposalStateHash(proto.getHeight(),
|
||||
proto.getHash().toByteArray(),
|
||||
proto.getPrevHash().toByteArray(),
|
||||
|
|
|
@ -20,8 +20,6 @@ package bisq.core.dao.monitoring.network.messages;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -42,15 +40,15 @@ public final class GetBlindVoteStateHashesRequest extends GetStateHashesRequest
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetBlindVoteStateHashesRequest(PB.GetBlindVoteStateHashesRequest.newBuilder()
|
||||
.setGetBlindVoteStateHashesRequest(protobuf.GetBlindVoteStateHashesRequest.newBuilder()
|
||||
.setHeight(height)
|
||||
.setNonce(nonce))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetBlindVoteStateHashesRequest proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetBlindVoteStateHashesRequest proto, int messageVersion) {
|
||||
return new GetBlindVoteStateHashesRequest(proto.getHeight(), proto.getNonce(), messageVersion);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.monitoring.model.BlindVoteStateHash;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -50,9 +48,9 @@ public final class GetBlindVoteStateHashesResponse extends GetStateHashesRespons
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetBlindVoteStateHashesResponse(PB.GetBlindVoteStateHashesResponse.newBuilder()
|
||||
.setGetBlindVoteStateHashesResponse(protobuf.GetBlindVoteStateHashesResponse.newBuilder()
|
||||
.addAllStateHashes(stateHashes.stream()
|
||||
.map(BlindVoteStateHash::toProtoMessage)
|
||||
.collect(Collectors.toList()))
|
||||
|
@ -60,7 +58,7 @@ public final class GetBlindVoteStateHashesResponse extends GetStateHashesRespons
|
|||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetBlindVoteStateHashesResponse proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetBlindVoteStateHashesResponse proto, int messageVersion) {
|
||||
return new GetBlindVoteStateHashesResponse(proto.getStateHashesList().isEmpty() ?
|
||||
new ArrayList<>() :
|
||||
proto.getStateHashesList().stream()
|
||||
|
|
|
@ -20,8 +20,6 @@ package bisq.core.dao.monitoring.network.messages;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -42,15 +40,15 @@ public final class GetDaoStateHashesRequest extends GetStateHashesRequest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetDaoStateHashesRequest(PB.GetDaoStateHashesRequest.newBuilder()
|
||||
.setGetDaoStateHashesRequest(protobuf.GetDaoStateHashesRequest.newBuilder()
|
||||
.setHeight(height)
|
||||
.setNonce(nonce))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetDaoStateHashesRequest proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetDaoStateHashesRequest proto, int messageVersion) {
|
||||
return new GetDaoStateHashesRequest(proto.getHeight(), proto.getNonce(), messageVersion);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.monitoring.model.DaoStateHash;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -50,9 +48,9 @@ public final class GetDaoStateHashesResponse extends GetStateHashesResponse<DaoS
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetDaoStateHashesResponse(PB.GetDaoStateHashesResponse.newBuilder()
|
||||
.setGetDaoStateHashesResponse(protobuf.GetDaoStateHashesResponse.newBuilder()
|
||||
.addAllStateHashes(stateHashes.stream()
|
||||
.map(DaoStateHash::toProtoMessage)
|
||||
.collect(Collectors.toList()))
|
||||
|
@ -60,7 +58,7 @@ public final class GetDaoStateHashesResponse extends GetStateHashesResponse<DaoS
|
|||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetDaoStateHashesResponse proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetDaoStateHashesResponse proto, int messageVersion) {
|
||||
return new GetDaoStateHashesResponse(proto.getStateHashesList().isEmpty() ?
|
||||
new ArrayList<>() :
|
||||
proto.getStateHashesList().stream()
|
||||
|
|
|
@ -20,8 +20,6 @@ package bisq.core.dao.monitoring.network.messages;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -42,15 +40,15 @@ public final class GetProposalStateHashesRequest extends GetStateHashesRequest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetProposalStateHashesRequest(PB.GetProposalStateHashesRequest.newBuilder()
|
||||
.setGetProposalStateHashesRequest(protobuf.GetProposalStateHashesRequest.newBuilder()
|
||||
.setHeight(height)
|
||||
.setNonce(nonce))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetProposalStateHashesRequest proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetProposalStateHashesRequest proto, int messageVersion) {
|
||||
return new GetProposalStateHashesRequest(proto.getHeight(), proto.getNonce(), messageVersion);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.monitoring.model.ProposalStateHash;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -50,9 +48,9 @@ public final class GetProposalStateHashesResponse extends GetStateHashesResponse
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetProposalStateHashesResponse(PB.GetProposalStateHashesResponse.newBuilder()
|
||||
.setGetProposalStateHashesResponse(protobuf.GetProposalStateHashesResponse.newBuilder()
|
||||
.addAllStateHashes(stateHashes.stream()
|
||||
.map(ProposalStateHash::toProtoMessage)
|
||||
.collect(Collectors.toList()))
|
||||
|
@ -60,7 +58,7 @@ public final class GetProposalStateHashesResponse extends GetStateHashesResponse
|
|||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetProposalStateHashesResponse proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetProposalStateHashesResponse proto, int messageVersion) {
|
||||
return new GetProposalStateHashesResponse(proto.getStateHashesList().isEmpty() ?
|
||||
new ArrayList<>() :
|
||||
proto.getStateHashesList().stream()
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.app.Capability;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -46,14 +44,14 @@ public final class NewBlindVoteStateHashMessage extends NewStateHashMessage<Blin
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setNewBlindVoteStateHashMessage(PB.NewBlindVoteStateHashMessage.newBuilder()
|
||||
.setNewBlindVoteStateHashMessage(protobuf.NewBlindVoteStateHashMessage.newBuilder()
|
||||
.setStateHash(stateHash.toProtoMessage()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.NewBlindVoteStateHashMessage proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.NewBlindVoteStateHashMessage proto, int messageVersion) {
|
||||
return new NewBlindVoteStateHashMessage(BlindVoteStateHash.fromProto(proto.getStateHash()), messageVersion);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.app.Capability;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -46,14 +44,14 @@ public final class NewDaoStateHashMessage extends NewStateHashMessage<DaoStateHa
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setNewDaoStateHashMessage(PB.NewDaoStateHashMessage.newBuilder()
|
||||
.setNewDaoStateHashMessage(protobuf.NewDaoStateHashMessage.newBuilder()
|
||||
.setStateHash(stateHash.toProtoMessage()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.NewDaoStateHashMessage proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.NewDaoStateHashMessage proto, int messageVersion) {
|
||||
return new NewDaoStateHashMessage(DaoStateHash.fromProto(proto.getStateHash()), messageVersion);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.common.app.Capability;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -46,14 +44,14 @@ public final class NewProposalStateHashMessage extends NewStateHashMessage<Propo
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setNewProposalStateHashMessage(PB.NewProposalStateHashMessage.newBuilder()
|
||||
.setNewProposalStateHashMessage(protobuf.NewProposalStateHashMessage.newBuilder()
|
||||
.setStateHash(stateHash.toProtoMessage()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.NewProposalStateHashMessage proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.NewProposalStateHashMessage proto, int messageVersion) {
|
||||
return new NewProposalStateHashMessage(ProposalStateHash.fromProto(proto.getStateHash()), messageVersion);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.state.model.blockchain.Block;
|
|||
|
||||
import bisq.common.proto.network.NetworkPayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -75,16 +73,16 @@ public final class RawBlock extends BaseBlock implements NetworkPayload {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.BaseBlock toProtoMessage() {
|
||||
PB.RawBlock.Builder builder = PB.RawBlock.newBuilder()
|
||||
public protobuf.BaseBlock toProtoMessage() {
|
||||
protobuf.RawBlock.Builder builder = protobuf.RawBlock.newBuilder()
|
||||
.addAllRawTxs(rawTxs.stream()
|
||||
.map(RawTx::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
return getBaseBlockBuilder().setRawBlock(builder).build();
|
||||
}
|
||||
|
||||
public static RawBlock fromProto(PB.BaseBlock proto) {
|
||||
PB.RawBlock rawBlockProto = proto.getRawBlock();
|
||||
public static RawBlock fromProto(protobuf.BaseBlock proto) {
|
||||
protobuf.RawBlock rawBlockProto = proto.getRawBlock();
|
||||
ImmutableList<RawTx> rawTxs = rawBlockProto.getRawTxsList().isEmpty() ?
|
||||
ImmutableList.copyOf(new ArrayList<>()) :
|
||||
ImmutableList.copyOf(rawBlockProto.getRawTxsList().stream()
|
||||
|
|
|
@ -24,8 +24,6 @@ import bisq.core.dao.state.model.blockchain.TxInput;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkPayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -102,21 +100,21 @@ public final class RawTx extends BaseTx implements NetworkPayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.BaseTx toProtoMessage() {
|
||||
final PB.RawTx.Builder builder = PB.RawTx.newBuilder()
|
||||
public protobuf.BaseTx toProtoMessage() {
|
||||
final protobuf.RawTx.Builder builder = protobuf.RawTx.newBuilder()
|
||||
.addAllRawTxOutputs(rawTxOutputs.stream()
|
||||
.map(RawTxOutput::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
return getBaseTxBuilder().setRawTx(builder).build();
|
||||
}
|
||||
|
||||
public static RawTx fromProto(PB.BaseTx protoBaseTx) {
|
||||
public static RawTx fromProto(protobuf.BaseTx protoBaseTx) {
|
||||
ImmutableList<TxInput> txInputs = protoBaseTx.getTxInputsList().isEmpty() ?
|
||||
ImmutableList.copyOf(new ArrayList<>()) :
|
||||
ImmutableList.copyOf(protoBaseTx.getTxInputsList().stream()
|
||||
.map(TxInput::fromProto)
|
||||
.collect(Collectors.toList()));
|
||||
PB.RawTx protoRawTx = protoBaseTx.getRawTx();
|
||||
protobuf.RawTx protoRawTx = protoBaseTx.getRawTx();
|
||||
ImmutableList<RawTxOutput> outputs = protoRawTx.getRawTxOutputsList().isEmpty() ?
|
||||
ImmutableList.copyOf(new ArrayList<>()) :
|
||||
ImmutableList.copyOf(protoRawTx.getRawTxOutputsList().stream()
|
||||
|
|
|
@ -23,8 +23,6 @@ import bisq.core.dao.state.model.blockchain.TxOutput;
|
|||
|
||||
import bisq.common.proto.network.NetworkPayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -73,11 +71,11 @@ public final class RawTxOutput extends BaseTxOutput implements NetworkPayload {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public PB.BaseTxOutput toProtoMessage() {
|
||||
return getRawTxOutputBuilder().setRawTxOutput(PB.RawTxOutput.newBuilder()).build();
|
||||
public protobuf.BaseTxOutput toProtoMessage() {
|
||||
return getRawTxOutputBuilder().setRawTxOutput(protobuf.RawTxOutput.newBuilder()).build();
|
||||
}
|
||||
|
||||
public static RawTxOutput fromProto(PB.BaseTxOutput proto) {
|
||||
public static RawTxOutput fromProto(protobuf.BaseTxOutput proto) {
|
||||
return new RawTxOutput(proto.getIndex(),
|
||||
proto.getValue(),
|
||||
proto.getTxId(),
|
||||
|
|
|
@ -72,8 +72,9 @@ import org.jetbrains.annotations.NotNull;
|
|||
public class RpcService {
|
||||
private final String rpcUser;
|
||||
private final String rpcPassword;
|
||||
private final String rpcHost;
|
||||
private final String rpcPort;
|
||||
private final int blockNotifyPort;
|
||||
private final String rpcBlockPort;
|
||||
|
||||
private BtcdClient client;
|
||||
private BtcdDaemon daemon;
|
||||
|
@ -90,22 +91,28 @@ public class RpcService {
|
|||
@SuppressWarnings("WeakerAccess")
|
||||
@Inject
|
||||
public RpcService(Preferences preferences,
|
||||
@Named(DaoOptionKeys.RPC_PORT) String rpcPort) {
|
||||
@Named(DaoOptionKeys.RPC_HOST) String rpcHost,
|
||||
@Named(DaoOptionKeys.RPC_PORT) String rpcPort,
|
||||
@Named(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT) String rpcBlockPort) {
|
||||
this.rpcUser = preferences.getRpcUser();
|
||||
this.rpcPassword = preferences.getRpcPw();
|
||||
this.blockNotifyPort = preferences.getBlockNotifyPort();
|
||||
|
||||
// mainnet is 8332, testnet 18332, regtest 18443
|
||||
boolean isHostSet = rpcHost != null && !rpcHost.isEmpty();
|
||||
boolean isPortSet = rpcPort != null && !rpcPort.isEmpty();
|
||||
boolean isMainnet = BisqEnvironment.getBaseCurrencyNetwork().isMainnet();
|
||||
boolean isTestnet = BisqEnvironment.getBaseCurrencyNetwork().isTestnet();
|
||||
boolean isDaoBetaNet = BisqEnvironment.getBaseCurrencyNetwork().isDaoBetaNet();
|
||||
log.info("The value of rpchost is {}", rpcHost);
|
||||
this.rpcHost = isHostSet ? rpcHost : "127.0.0.1";
|
||||
this.rpcPort = isPortSet ? rpcPort :
|
||||
isMainnet || isDaoBetaNet ? "8332" :
|
||||
isTestnet ? "18332" :
|
||||
"18443"; // regtest
|
||||
this.rpcBlockPort = rpcBlockPort != null && !rpcBlockPort.isEmpty() ? rpcBlockPort : "5125";
|
||||
|
||||
log.info("Version of btcd-cli4j library: {}", BtcdCli4jVersion.VERSION);
|
||||
log.info("Starting RPCService with btcd-cli4j version {} on {}:{} with user {}", BtcdCli4jVersion.VERSION,
|
||||
this.rpcHost, this.rpcPort, this.rpcUser);
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,12 +128,12 @@ public class RpcService {
|
|||
CloseableHttpClient httpProvider = HttpClients.custom().setConnectionManager(cm).build();
|
||||
Properties nodeConfig = new Properties();
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.protocol", "http");
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.host", "127.0.0.1");
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.host", rpcHost);
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.auth_scheme", "Basic");
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.user", rpcUser);
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.password", rpcPassword);
|
||||
nodeConfig.setProperty("node.bitcoind.rpc.port", rpcPort);
|
||||
nodeConfig.setProperty("node.bitcoind.notification.block.port", String.valueOf(blockNotifyPort));
|
||||
nodeConfig.setProperty("node.bitcoind.notification.block.port", rpcBlockPort);
|
||||
nodeConfig.setProperty("node.bitcoind.notification.alert.port", String.valueOf(bisq.network.p2p.Utils.findFreeSystemPort()));
|
||||
nodeConfig.setProperty("node.bitcoind.notification.wallet.port", String.valueOf(bisq.network.p2p.Utils.findFreeSystemPort()));
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@ import bisq.common.app.Capability;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -82,8 +80,8 @@ public final class GetBlocksRequest extends NetworkEnvelope implements DirectMes
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
PB.GetBlocksRequest.Builder builder = PB.GetBlocksRequest.newBuilder()
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
protobuf.GetBlocksRequest.Builder builder = protobuf.GetBlocksRequest.newBuilder()
|
||||
.setFromBlockHeight(fromBlockHeight)
|
||||
.setNonce(nonce);
|
||||
Optional.ofNullable(senderNodeAddress).ifPresent(e -> builder.setSenderNodeAddress(e.toProtoMessage()));
|
||||
|
@ -91,8 +89,8 @@ public final class GetBlocksRequest extends NetworkEnvelope implements DirectMes
|
|||
return getNetworkEnvelopeBuilder().setGetBlocksRequest(builder).build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetBlocksRequest proto, int messageVersion) {
|
||||
PB.NodeAddress protoNodeAddress = proto.getSenderNodeAddress();
|
||||
public static NetworkEnvelope fromProto(protobuf.GetBlocksRequest proto, int messageVersion) {
|
||||
protobuf.NodeAddress protoNodeAddress = proto.getSenderNodeAddress();
|
||||
NodeAddress senderNodeAddress = protoNodeAddress.getHostName().isEmpty() ?
|
||||
null :
|
||||
NodeAddress.fromProto(protoNodeAddress);
|
||||
|
|
|
@ -25,8 +25,6 @@ import bisq.network.p2p.ExtendedDataSizePermission;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -58,9 +56,9 @@ public final class GetBlocksResponse extends NetworkEnvelope implements DirectMe
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setGetBlocksResponse(PB.GetBlocksResponse.newBuilder()
|
||||
.setGetBlocksResponse(protobuf.GetBlocksResponse.newBuilder()
|
||||
.addAllRawBlocks(blocks.stream()
|
||||
.map(RawBlock::toProtoMessage)
|
||||
.collect(Collectors.toList()))
|
||||
|
@ -68,7 +66,7 @@ public final class GetBlocksResponse extends NetworkEnvelope implements DirectMe
|
|||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.GetBlocksResponse proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.GetBlocksResponse proto, int messageVersion) {
|
||||
List<RawBlock> list = proto.getRawBlocksList().stream()
|
||||
.map(RawBlock::fromProto)
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -27,8 +27,6 @@ import bisq.common.app.Capability;
|
|||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -52,14 +50,14 @@ public final class NewBlockBroadcastMessage extends BroadcastMessage implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
|
||||
return getNetworkEnvelopeBuilder()
|
||||
.setNewBlockBroadcastMessage(PB.NewBlockBroadcastMessage.newBuilder()
|
||||
.setNewBlockBroadcastMessage(protobuf.NewBlockBroadcastMessage.newBuilder()
|
||||
.setRawBlock(block.toProtoMessage()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(PB.NewBlockBroadcastMessage proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.NewBlockBroadcastMessage proto, int messageVersion) {
|
||||
return new NewBlockBroadcastMessage(RawBlock.fromProto(proto.getRawBlock()),
|
||||
messageVersion);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.state.model.DaoState;
|
|||
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
@ -59,17 +57,17 @@ public class DaoStateStore implements PersistableEnvelope {
|
|||
|
||||
public Message toProtoMessage() {
|
||||
checkNotNull(daoState, "daoState must not be null when toProtoMessage is invoked");
|
||||
PB.DaoStateStore.Builder builder = PB.DaoStateStore.newBuilder()
|
||||
protobuf.DaoStateStore.Builder builder = protobuf.DaoStateStore.newBuilder()
|
||||
.setDaoState(daoState.getBsqStateBuilder())
|
||||
.addAllDaoStateHash(daoStateHashChain.stream()
|
||||
.map(DaoStateHash::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
return PB.PersistableEnvelope.newBuilder()
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setDaoStateStore(builder)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PersistableEnvelope fromProto(PB.DaoStateStore proto) {
|
||||
public static PersistableEnvelope fromProto(protobuf.DaoStateStore proto) {
|
||||
LinkedList<DaoStateHash> daoStateHashList = proto.getDaoStateHashList().isEmpty() ?
|
||||
new LinkedList<>() :
|
||||
new LinkedList<>(proto.getDaoStateHashList().stream()
|
||||
|
|
|
@ -29,8 +29,6 @@ import bisq.core.dao.state.model.governance.ParamChange;
|
|||
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -154,14 +152,14 @@ public class DaoState implements PersistablePayload {
|
|||
return getBsqStateBuilder().build();
|
||||
}
|
||||
|
||||
public PB.DaoState.Builder getBsqStateBuilder() {
|
||||
public protobuf.DaoState.Builder getBsqStateBuilder() {
|
||||
return getBsqStateBuilderExcludingBlocks().addAllBlocks(blocks.stream()
|
||||
.map(Block::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private PB.DaoState.Builder getBsqStateBuilderExcludingBlocks() {
|
||||
PB.DaoState.Builder builder = PB.DaoState.newBuilder();
|
||||
private protobuf.DaoState.Builder getBsqStateBuilderExcludingBlocks() {
|
||||
protobuf.DaoState.Builder builder = protobuf.DaoState.newBuilder();
|
||||
builder.setChainHeight(chainHeight)
|
||||
.addAllCycles(cycles.stream().map(Cycle::toProtoMessage).collect(Collectors.toList()))
|
||||
.putAllUnspentTxOutputMap(unspentTxOutputMap.entrySet().stream()
|
||||
|
@ -177,7 +175,7 @@ public class DaoState implements PersistablePayload {
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static DaoState fromProto(PB.DaoState proto) {
|
||||
public static DaoState fromProto(protobuf.DaoState proto) {
|
||||
LinkedList<Block> blocks = proto.getBlocksList().stream()
|
||||
.map(Block::fromProto)
|
||||
.collect(Collectors.toCollection(LinkedList::new));
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.dao.state.model.blockchain;
|
|||
|
||||
import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -53,8 +51,8 @@ public abstract class BaseBlock implements ImmutableDaoStateModel {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
protected PB.BaseBlock.Builder getBaseBlockBuilder() {
|
||||
PB.BaseBlock.Builder builder = PB.BaseBlock.newBuilder()
|
||||
protected protobuf.BaseBlock.Builder getBaseBlockBuilder() {
|
||||
protobuf.BaseBlock.Builder builder = protobuf.BaseBlock.newBuilder()
|
||||
.setHeight(height)
|
||||
.setTime(time)
|
||||
.setHash(hash);
|
||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.dao.state.model.blockchain;
|
|||
|
||||
import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -69,8 +67,8 @@ public abstract class BaseTx implements ImmutableDaoStateModel {
|
|||
this.txInputs = txInputs;
|
||||
}
|
||||
|
||||
protected PB.BaseTx.Builder getBaseTxBuilder() {
|
||||
return PB.BaseTx.newBuilder()
|
||||
protected protobuf.BaseTx.Builder getBaseTxBuilder() {
|
||||
return protobuf.BaseTx.newBuilder()
|
||||
.setTxVersion(txVersion)
|
||||
.setId(id)
|
||||
.setBlockHeight(blockHeight)
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
|||
import bisq.common.util.JsonExclude;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import java.util.Optional;
|
||||
|
@ -77,8 +75,8 @@ public abstract class BaseTxOutput implements ImmutableDaoStateModel {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
protected PB.BaseTxOutput.Builder getRawTxOutputBuilder() {
|
||||
final PB.BaseTxOutput.Builder builder = PB.BaseTxOutput.newBuilder()
|
||||
protected protobuf.BaseTxOutput.Builder getRawTxOutputBuilder() {
|
||||
final protobuf.BaseTxOutput.Builder builder = protobuf.BaseTxOutput.newBuilder()
|
||||
.setIndex(index)
|
||||
.setValue(value)
|
||||
.setTxId(txId)
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
|||
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -73,16 +71,16 @@ public final class Block extends BaseBlock implements PersistablePayload, Immuta
|
|||
|
||||
|
||||
@Override
|
||||
public PB.BaseBlock toProtoMessage() {
|
||||
PB.Block.Builder builder = PB.Block.newBuilder()
|
||||
public protobuf.BaseBlock toProtoMessage() {
|
||||
protobuf.Block.Builder builder = protobuf.Block.newBuilder()
|
||||
.addAllTxs(txs.stream()
|
||||
.map(Tx::toProtoMessage)
|
||||
.collect(Collectors.toList()));
|
||||
return getBaseBlockBuilder().setBlock(builder).build();
|
||||
}
|
||||
|
||||
public static Block fromProto(PB.BaseBlock proto) {
|
||||
PB.Block blockProto = proto.getBlock();
|
||||
public static Block fromProto(protobuf.BaseBlock proto) {
|
||||
protobuf.Block blockProto = proto.getBlock();
|
||||
ImmutableList<Tx> txs = blockProto.getTxsList().isEmpty() ?
|
||||
ImmutableList.copyOf(new ArrayList<>()) :
|
||||
ImmutableList.copyOf(blockProto.getTxsList().stream()
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
|||
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -58,8 +56,8 @@ public class PubKeyScript implements PersistablePayload, ImmutableDaoStateModel
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public PB.PubKeyScript toProtoMessage() {
|
||||
final PB.PubKeyScript.Builder builder = PB.PubKeyScript.newBuilder()
|
||||
public protobuf.PubKeyScript toProtoMessage() {
|
||||
final protobuf.PubKeyScript.Builder builder = protobuf.PubKeyScript.newBuilder()
|
||||
.setReqSigs(reqSigs)
|
||||
.setScriptType(scriptType.toProtoMessage())
|
||||
.setAsm(asm)
|
||||
|
@ -68,7 +66,7 @@ public class PubKeyScript implements PersistablePayload, ImmutableDaoStateModel
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
public static PubKeyScript fromProto(PB.PubKeyScript proto) {
|
||||
public static PubKeyScript fromProto(protobuf.PubKeyScript proto) {
|
||||
return new PubKeyScript(proto.getReqSigs(),
|
||||
ScriptType.fromProto(proto.getScriptType()),
|
||||
proto.getAddressesList().isEmpty() ? null : ImmutableList.copyOf(proto.getAddressesList()),
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
|||
|
||||
import bisq.common.proto.ProtoUtil;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
@ -77,11 +75,11 @@ public enum ScriptType implements ImmutableDaoStateModel {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static ScriptType fromProto(PB.ScriptType scriptType) {
|
||||
public static ScriptType fromProto(protobuf.ScriptType scriptType) {
|
||||
return ProtoUtil.enumFromProto(ScriptType.class, scriptType.name());
|
||||
}
|
||||
|
||||
public PB.ScriptType toProtoMessage() {
|
||||
return PB.ScriptType.valueOf(name());
|
||||
public protobuf.ScriptType toProtoMessage() {
|
||||
return protobuf.ScriptType.valueOf(name());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
|||
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
@ -40,14 +38,14 @@ public final class SpentInfo implements PersistablePayload, ImmutableDaoStateMod
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static SpentInfo fromProto(PB.SpentInfo proto) {
|
||||
public static SpentInfo fromProto(protobuf.SpentInfo proto) {
|
||||
return new SpentInfo(proto.getBlockHeight(),
|
||||
proto.getTxId(),
|
||||
proto.getInputIndex());
|
||||
}
|
||||
|
||||
public PB.SpentInfo toProtoMessage() {
|
||||
return PB.SpentInfo.newBuilder()
|
||||
public protobuf.SpentInfo toProtoMessage() {
|
||||
return protobuf.SpentInfo.newBuilder()
|
||||
.setBlockHeight(blockHeight)
|
||||
.setTxId(txId)
|
||||
.setInputIndex(inputIndex)
|
||||
|
|
|
@ -22,8 +22,6 @@ import bisq.core.dao.state.model.ImmutableDaoStateModel;
|
|||
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
|
||||
import io.bisq.generated.protobuffer.PB;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -93,8 +91,8 @@ public final class Tx extends BaseTx implements PersistablePayload, ImmutableDao
|
|||
}
|
||||
|
||||
@Override
|
||||
public PB.BaseTx toProtoMessage() {
|
||||
final PB.Tx.Builder builder = PB.Tx.newBuilder()
|
||||
public protobuf.BaseTx toProtoMessage() {
|
||||
final protobuf.Tx.Builder builder = protobuf.Tx.newBuilder()
|
||||
.addAllTxOutputs(txOutputs.stream()
|
||||
.map(TxOutput::toProtoMessage)
|
||||
.collect(Collectors.toList()))
|
||||
|
@ -103,13 +101,13 @@ public final class Tx extends BaseTx implements PersistablePayload, ImmutableDao
|
|||
return getBaseTxBuilder().setTx(builder).build();
|
||||
}
|
||||
|
||||
public static Tx fromProto(PB.BaseTx protoBaseTx) {
|
||||
public static Tx fromProto(protobuf.BaseTx protoBaseTx) {
|
||||
ImmutableList<TxInput> txInputs = protoBaseTx.getTxInputsList().isEmpty() ?
|
||||
ImmutableList.copyOf(new ArrayList<>()) :
|
||||
ImmutableList.copyOf(protoBaseTx.getTxInputsList().stream()
|
||||
.map(TxInput::fromProto)
|
||||
.collect(Collectors.toList()));
|
||||
PB.Tx protoTx = protoBaseTx.getTx();
|
||||
protobuf.Tx protoTx = protoBaseTx.getTx();
|
||||
ImmutableList<TxOutput> outputs = protoTx.getTxOutputsList().isEmpty() ?
|
||||
ImmutableList.copyOf(new ArrayList<>()) :
|
||||
ImmutableList.copyOf(protoTx.getTxOutputsList().stream()
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue