mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Rename PaymentAccountAgeWitness to AccountAgeWitness
This commit is contained in:
parent
ea1666a665
commit
fb5b8ecc0f
4 changed files with 15 additions and 15 deletions
|
@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit;
|
|||
@Slf4j
|
||||
@EqualsAndHashCode(exclude = {"signaturePubKey"})
|
||||
@Value
|
||||
public class PaymentAccountAgeWitness implements LazyProcessedStoragePayload, PersistedStoragePayload {
|
||||
public class AccountAgeWitness implements LazyProcessedStoragePayload, PersistedStoragePayload {
|
||||
|
||||
private final byte[] hash; // 32 bytes
|
||||
private final byte[] hashOfPubKey; // 32 bytes
|
||||
|
@ -52,10 +52,10 @@ public class PaymentAccountAgeWitness implements LazyProcessedStoragePayload, Pe
|
|||
@Nullable
|
||||
private Map<String, String> extraDataMap;
|
||||
|
||||
public PaymentAccountAgeWitness(byte[] hash,
|
||||
byte[] hashOfPubKey,
|
||||
byte[] signature,
|
||||
long tradeDate) {
|
||||
public AccountAgeWitness(byte[] hash,
|
||||
byte[] hashOfPubKey,
|
||||
byte[] signature,
|
||||
long tradeDate) {
|
||||
|
||||
this(hash,
|
||||
hashOfPubKey,
|
||||
|
@ -68,11 +68,11 @@ public class PaymentAccountAgeWitness implements LazyProcessedStoragePayload, Pe
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
PaymentAccountAgeWitness(byte[] hash,
|
||||
byte[] hashOfPubKey,
|
||||
byte[] signature,
|
||||
long tradeDate,
|
||||
@Nullable Map<String, String> extraDataMap) {
|
||||
AccountAgeWitness(byte[] hash,
|
||||
byte[] hashOfPubKey,
|
||||
byte[] signature,
|
||||
long tradeDate,
|
||||
@Nullable Map<String, String> extraDataMap) {
|
||||
this.hash = hash;
|
||||
this.hashOfPubKey = hashOfPubKey;
|
||||
this.signature = signature;
|
|
@ -62,7 +62,7 @@ public abstract class PaymentAccount implements PersistablePayload {
|
|||
|
||||
@Setter
|
||||
@Nullable
|
||||
protected PaymentAccountAgeWitness paymentPaymentAccountAgeWitness;
|
||||
protected AccountAgeWitness paymentAccountAgeWitness;
|
||||
|
||||
// TODO add to PB!
|
||||
@Setter
|
||||
|
|
|
@ -46,12 +46,12 @@ public class PaymentAccountAgeWitnessService {
|
|||
this.keyRing = keyRing;
|
||||
}
|
||||
|
||||
public PaymentAccountAgeWitness getPaymentAccountWitness(PaymentAccount paymentAccount, Trade trade) throws CryptoException {
|
||||
public AccountAgeWitness getPaymentAccountWitness(PaymentAccount paymentAccount, Trade trade) throws CryptoException {
|
||||
byte[] hash = getWitnessHash(paymentAccount);
|
||||
byte[] signature = Sig.sign(keyRing.getSignatureKeyPair().getPrivate(), hash);
|
||||
long tradeDate = trade.getTakeOfferDate().getTime();
|
||||
byte[] hashOfPubKey = Sha256Hash.hash(keyRing.getPubKeyRing().getSignaturePubKeyBytes());
|
||||
return new PaymentAccountAgeWitness(hash,
|
||||
return new AccountAgeWitness(hash,
|
||||
hashOfPubKey,
|
||||
signature,
|
||||
tradeDate);
|
||||
|
@ -68,7 +68,7 @@ public class PaymentAccountAgeWitnessService {
|
|||
}
|
||||
|
||||
boolean verifyAgeWitness(byte[] peersAgeWitnessInputData,
|
||||
PaymentAccountAgeWitness witness,
|
||||
AccountAgeWitness witness,
|
||||
byte[] peersSalt,
|
||||
PublicKey peersPublicKey,
|
||||
int nonce,
|
||||
|
|
|
@ -41,7 +41,7 @@ import static org.junit.Assert.assertTrue;
|
|||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@Slf4j
|
||||
public class PaymentPaymentAccountAgeWitnessServiceTest {
|
||||
public class PaymentAccountAgeWitnessServiceTest {
|
||||
|
||||
private PublicKey publicKey;
|
||||
private KeyPair keypair;
|
Loading…
Add table
Reference in a new issue