Skip to content

Commit

Permalink
Merge pull request #98 from cryptape/update-proto
Browse files Browse the repository at this point in the history
feat(signer): update cita-proto
  • Loading branch information
Keith-CY authored Jan 23, 2019
2 parents 559d6ed + cc1d02a commit 1da259f
Show file tree
Hide file tree
Showing 6 changed files with 483 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/cita-sdk/lib/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cita-signer/cita-proto
2 changes: 1 addition & 1 deletion packages/cita-signer/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const signer = ({ from, privateKey, data = '', nonce = exports.getNonce(), quota
sigBytes[64] = sign.recoveryParam;
const unverifiedTx = new blockchainPb.UnverifiedTransaction();
unverifiedTx.setTransaction(tx);
unverifiedTx.setCrypto(blockchainPb.Crypto.SECP);
unverifiedTx.setCrypto(blockchainPb.Crypto.DEFAULT);
unverifiedTx.setSignature(sigBytes);
const serializedUnverifiedTx = unverifiedTx.serializeBinary();
const hexUnverifiedTx = utils.bytesToHex(serializedUnverifiedTx);
Expand Down
60 changes: 58 additions & 2 deletions packages/cita-signer/proto-js/blockchain_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,30 @@ export namespace BlockBody {
}
}

export class CompactBlockBody extends jspb.Message {
clearTxHashesList(): void;
getTxHashesList(): Array<Uint8Array | string>;
getTxHashesList_asU8(): Array<Uint8Array>;
getTxHashesList_asB64(): Array<string>;
setTxHashesList(value: Array<Uint8Array | string>): void;
addTxHashes(value: Uint8Array | string, index?: number): Uint8Array | string;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CompactBlockBody.AsObject;
static toObject(includeInstance: boolean, msg: CompactBlockBody): CompactBlockBody.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: CompactBlockBody, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): CompactBlockBody;
static deserializeBinaryFromReader(message: CompactBlockBody, reader: jspb.BinaryReader): CompactBlockBody;
}

export namespace CompactBlockBody {
export type AsObject = {
txHashesList: Array<Uint8Array | string>,
}
}

export class Block extends jspb.Message {
getVersion(): number;
setVersion(value: number): void;
Expand Down Expand Up @@ -380,6 +404,38 @@ export namespace Block {
}
}

export class CompactBlock extends jspb.Message {
getVersion(): number;
setVersion(value: number): void;

hasHeader(): boolean;
clearHeader(): void;
getHeader(): BlockHeader | undefined;
setHeader(value?: BlockHeader): void;

hasBody(): boolean;
clearBody(): void;
getBody(): CompactBlockBody | undefined;
setBody(value?: CompactBlockBody): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CompactBlock.AsObject;
static toObject(includeInstance: boolean, msg: CompactBlock): CompactBlock.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: CompactBlock, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): CompactBlock;
static deserializeBinaryFromReader(message: CompactBlock, reader: jspb.BinaryReader): CompactBlock;
}

export namespace CompactBlock {
export type AsObject = {
version: number,
header?: BlockHeader.AsObject,
body?: CompactBlockBody.AsObject,
}
}

export class BlockWithProof extends jspb.Message {
hasBlk(): boolean;
clearBlk(): void;
Expand Down Expand Up @@ -493,7 +549,7 @@ export enum ProofType {
}

export enum Crypto {
SECP = 0,
SM2 = 1,
DEFAULT = 0,
RESERVED = 1,
}

Loading

0 comments on commit 1da259f

Please sign in to comment.