Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
clear compiler complaints: Property 'value' does not exist on type 'M…
…ultiEd25519Signature' and 'MultiEd25519PublicKey'.
  • Loading branch information
wk3368 committed Oct 26, 2021
1 parent e19d61f commit ece44da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/encoding/index.ts
Expand Up @@ -59,8 +59,8 @@ export function decodeSignedUserTransaction(
authenticator = { Ed25519: { public_key: publicKey, signature } };
} else {
const auth = scsData.authenticator as starcoin_types.TransactionAuthenticatorVariantMultiEd25519;
const publicKey = hexlify(auth.public_key.value);
const signature = hexlify(auth.signature.value);
const publicKey = hexlify(auth.public_key.value());
const signature = hexlify(auth.signature.value());
authenticator = { MultiEd25519: { public_key: publicKey, signature } };
}
const rawTxn = scsData.raw_txn;
Expand Down
9 changes: 7 additions & 2 deletions src/lib/runtime/starcoin_types/index.ts
Expand Up @@ -503,7 +503,7 @@ export class MultiEd25519PublicKey {
return new MultiEd25519PublicKey(public_keys, threshold);
}

public into(): Uint8Array {
public value(): Uint8Array {
const arrPub = []
this.public_keys.forEach((pub) => {
arrPub.push(pub.value)
Expand Down Expand Up @@ -564,8 +564,13 @@ export class MultiEd25519Signature {
const bitmap = deserializer.deserializeU8();
return new MultiEd25519Signature(signatures, bitmap);
}
}

public value(): Uint8Array {
const se = new BcsSerializer();
this.serialize(se);
return se.getBytes();
}
}

export class MultiEd25519SignatureShard {
constructor(public signature: MultiEd25519Signature, public threshold: uint8) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/account.ts
Expand Up @@ -45,7 +45,7 @@ export function showMultiEd25519Account(shard: MultiEd25519KeyShard): Record<str

const multiEd25519PublicKey = shard.publicKey()

const publicKey = hexlify(multiEd25519PublicKey.into())
const publicKey = hexlify(multiEd25519PublicKey.value())

const authKey = publicKeyToAuthKey(publicKey, accountType.MULTI)

Expand Down

0 comments on commit ece44da

Please sign in to comment.