Merge pull request #42 from ChainSafe/clean-methods
Clean methods not in the interface
This commit is contained in:
commit
46b317b528
|
@ -1,7 +1,6 @@
|
|||
import * as blst from "@chainsafe/blst";
|
||||
import {bytesToHex, hexToBytes} from "../helpers";
|
||||
import {IPublicKey} from "../interface";
|
||||
import {Signature} from "./signature";
|
||||
|
||||
export class PublicKey implements IPublicKey {
|
||||
readonly affine: blst.PublicKey;
|
||||
|
@ -28,10 +27,6 @@ export class PublicKey implements IPublicKey {
|
|||
return new PublicKey(affine, jacobian);
|
||||
}
|
||||
|
||||
verifyMessage(signature: Signature, message: Uint8Array): boolean {
|
||||
return signature.verify(this, message);
|
||||
}
|
||||
|
||||
toBytes(): Uint8Array {
|
||||
return this.affine.toBytes();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {PublicKeyType} from "bls-eth-wasm";
|
||||
import {getContext} from "./context";
|
||||
import {EMPTY_PUBLIC_KEY, PUBLIC_KEY_LENGTH} from "../constants";
|
||||
import {Signature} from "./signature";
|
||||
import {bytesToHex, hexToBytes, isEqualBytes} from "../helpers";
|
||||
import {IPublicKey} from "../interface";
|
||||
|
||||
|
@ -41,16 +40,6 @@ export class PublicKey implements IPublicKey {
|
|||
return agg;
|
||||
}
|
||||
|
||||
add(other: PublicKey): PublicKey {
|
||||
const agg = new PublicKey(this.value.clone());
|
||||
agg.value.add(other.value);
|
||||
return agg;
|
||||
}
|
||||
|
||||
verifyMessage(signature: Signature, message: Uint8Array): boolean {
|
||||
return this.value.verify(signature.value, message);
|
||||
}
|
||||
|
||||
toBytes(): Uint8Array {
|
||||
return this.value.serialize();
|
||||
}
|
||||
|
|
|
@ -44,12 +44,6 @@ export class Signature implements ISignature {
|
|||
return new Signature(signature);
|
||||
}
|
||||
|
||||
add(other: Signature): Signature {
|
||||
const agg = this.value.clone();
|
||||
agg.add(other.value);
|
||||
return new Signature(agg);
|
||||
}
|
||||
|
||||
verify(publicKey: PublicKey, message: Uint8Array): boolean {
|
||||
return publicKey.value.verify(this.value, message);
|
||||
}
|
||||
|
|
Reference in New Issue