-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merge develop into echo_version #2
base: echo_version
Are you sure you want to change the base?
Conversation
tsconfig.json
Outdated
{ "path": "./packages/migrations" }, | ||
{ "path": "./packages/echo-migrations" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the new echo-migrations package for building with yarn build
@@ -663,6 +663,17 @@ export class Web3Wrapper { | |||
assert.isNumber('blockNumber', blockNumber); | |||
await this.sendRawPayloadAsync<void>({ method: 'debug_setHead', params: [utils.numberToHex(blockNumber)] }); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method for receiving echo account's public keys was added . it is used while check a ED25519 signature
packages/types/src/index.ts
Outdated
@@ -253,7 +253,7 @@ export enum RevertReason { | |||
LengthGreaterThan3Required = 'LENGTH_GREATER_THAN_3_REQUIRED', | |||
LengthGreaterThan131Required = 'LENGTH_GREATER_THAN_131_REQUIRED', | |||
Length0Required = 'LENGTH_0_REQUIRED', | |||
Length65Required = 'LENGTH_65_REQUIRED', | |||
Length65Required = 'LENGTH_64_REQUIRED', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the LENGTH_65_REQUIRED
constraint was changed cause a message signature's length had been changed from 65 to 64 symbols (v
parameter had been cutted)
@@ -0,0 +1,43 @@ | |||
import { JSONRPCRequestPayload } from 'ethereum-types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ProviderSubprovider (according with https://github.com/MetaMask/web3-provider-engine/blob/master/subproviders/provider.js) was added for compatibility with 0x-launck-kit-backend requests + echo-web3
requests
const prefixedMsgBuff = ethUtil.hashPersonalMessage(msgBuff); | ||
const prefixedMsgHex = ethUtil.bufferToHex(prefixedMsgBuff); | ||
const signature = await this._web3Wrapper.signMessageAsync(address, prefixedMsgHex); | ||
const signature = await this._web3Wrapper.sendRawPayloadAsync<string>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bridge provider hashes message by itself
s | ||
); | ||
bytes32 signedData = keccak256("\x19Ethereum Signed Message:\n32", hash); | ||
return edverify(signer, abi.encodePacked(signedData), abi.encodePacked(v, r, s)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the verifying of ECDSA message signature had been replced by edverify
|
||
const publicKeyBuffer = Buffer.from(publicKey, 'hex'); | ||
const msgHashBuff = Buffer.from(data.slice(2), 'hex'); | ||
const signatureHashBuff = Buffer.from(signature.slice(2), 'hex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the encoding all strings to buffer for compatibility with ed25519.js methods
@@ -184,23 +184,26 @@ export const signatureUtils = { | |||
* @param signerAddress The hex encoded address that signed the data, producing the supplied signature. | |||
* @return Whether the ECSignature is valid. | |||
*/ | |||
isValidECSignature(data: string, signature: ECSignature, signerAddress: string): boolean { | |||
async isValidECSignature(provider: ZeroExProvider, data: string, signature: string, signerAddress: string): Promise<boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to call ECHO network by provider
import * as ethUtil from 'ethereumjs-util'; | ||
import * as _ from 'lodash'; | ||
import * as ed25519 from 'ed25519.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the import ed25519.js for verifying ed25519 messages
}, | ||
"required": ["v", "r", "s"], | ||
"type": "object" | ||
"type": "string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the structure of ecSignatureSchema
had been changed from (v,r,s) object to string
@@ -135,6 +135,9 @@ const generateConfig = (dischargeTarget, heapConfigOptions, rollbarConfigOptions | |||
resolve: { | |||
extensions: ['.js', '.json', '.ts', '.tsx'], | |||
}, | |||
node: { | |||
fs: 'empty' | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the building of @0x/instant throw an error on ed25519.js package and this line helps to ignore this package while building
* upd * upd * upd * Fix "supported_asset_id"-problem * temp: eth_call's asset_id * add asset require to tokens contracts * upd ebtc withdraw Co-authored-by: NickLatkovich <[email protected]>
No description provided.