Update Changelogs. Rebased from development

This commit is contained in:
Jacob Evans
2018-08-03 11:53:26 +08:00
parent 9dd6ba7825
commit 5d4dd406f2
5 changed files with 35 additions and 11 deletions

View File

@@ -1,4 +1,13 @@
[
{
"version": "pending",
"changes": [
{
"pr": 914,
"note": "Update ecSignOrderHashAsync to return the signature as a string for immediate use in contracts"
}
]
},
{
"version": "1.0.1-rc.3",
"changes": [
@@ -21,9 +30,6 @@
"changes": [
{
"note": "Dependencies updated"
},
{
"note": "Update ecSignOrderHashAsync to return the signature as a string for immediate use in contracts"
}
],
"timestamp": 1532605697

View File

@@ -1,4 +1,14 @@
[
{
"version": "pending",
"changes": [
{
"pr": 914,
"note":
"Update ecSignOrderHashAsync to return signature string with signature type byte. Removes messagePrefixOpts."
}
]
},
{
"version": "1.0.1-rc.3",
"changes": [
@@ -30,9 +40,6 @@
"changes": [
{
"note": "Dependencies updated"
},
{
"note": "Update ecSignOrderHashAsync to return signature string with signature type byte"
}
],
"timestamp": 1532605697

View File

@@ -271,11 +271,11 @@ export function convertECSignatureToSignatureHex(
/**
* Combines the signature proof and the Signature Type.
* @param signature The hex encoded signature proof
* @param type The signature type, i.e EthSign, Trezor, Wallet etc.
* @param signatureType The signature type, i.e EthSign, Trezor, Wallet etc.
* @return Hex encoded string of signature proof with Signature Type
*/
export function convertToSignatureWithType(signature: string, type: SignatureType): string {
const signatureBuffer = Buffer.concat([ethUtil.toBuffer(signature), ethUtil.toBuffer(type)]);
export function convertToSignatureWithType(signature: string, signatureType: SignatureType): string {
const signatureBuffer = Buffer.concat([ethUtil.toBuffer(signature), ethUtil.toBuffer(signatureType)]);
const signatureHex = `0x${signatureBuffer.toString('hex')}`;
return signatureHex;
}
@@ -291,6 +291,7 @@ export function addSignedMessagePrefix(message: string, signerProviderType: Sign
assert.doesBelongToStringEnum('signerProviderType', signerProviderType, SignerProviderType);
switch (signerProviderType) {
case SignerProviderType.Metamask:
case SignerProviderType.Ledger:
case SignerProviderType.EthSign: {
const msgBuff = ethUtil.toBuffer(message);
const prefixedMsgBuff = ethUtil.hashPersonalMessage(msgBuff);

View File

@@ -1,4 +1,13 @@
[
{
"version": "pending",
"changes": [
{
"pr": 914,
"note": "Added SignerProviderType"
}
]
},
{
"version": "1.0.1-rc.3",
"changes": [

View File

@@ -143,11 +143,12 @@ export enum SignatureType {
}
/**
* The Signer Provider Type. Some Signer implementations use different message prefixes or implement different
* eth_sign behaviour. Note EthSign is compatible with the Ledger device.
* The Signer Provider Type. Some Signer provider implementations use different message prefixes or implement different
* eth_sign behaviour.
*/
export enum SignerProviderType {
EthSign = 'ETH_SIGN',
Ledger = 'LEDGER',
Metamask = 'METAMASK',
Trezor = 'TREZOR',
}