Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kongliangzhong committed Mar 9, 2019
1 parent 4cb6885 commit 03800f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protocol2-js",
"version": "0.4.5",
"version": "0.4.7",
"description": "loopring protocol simulator core lib",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/multihash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class MultiHashUtil {
sig.addNumber(algorithm, 1);
switch (+algorithm) {
case SignAlgorithm.Ethereum:
await this.signEthereumAsync(sig, hash, address);
await this.signEIP712Async(sig, hash, privateKey);
return sig.getData();
case SignAlgorithm.EIP712:
await this.signEIP712Async(sig, hash, privateKey);
Expand Down
12 changes: 10 additions & 2 deletions src/rings_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,16 @@ export class RingsGenerator {
this.insertOffset(param, param.data.addNumber(order.amountS, 32, false));
this.insertOffset(param, param.data.addNumber(order.amountB, 32, false));
this.insertOffset(param, param.data.addNumber(order.validSince, 4, false));
param.tables.addNumber(order.tokenSpendableS.index, 2);
param.tables.addNumber(order.tokenSpendableFee.index, 2);
if (order.tokenSpendableS.index) {
param.tables.addNumber(order.tokenSpendableS.index, 2);
} else {
param.tables.addNumber(0, 2);
}
if (order.tokenSpendableFee.index) {
param.tables.addNumber(order.tokenSpendableFee.index, 2);
} else {
param.tables.addNumber(0, 2);
}

if (order.dualAuthAddr) {
this.insertOffset(param, param.data.addAddress(order.dualAuthAddr, 20, false));
Expand Down

0 comments on commit 03800f3

Please sign in to comment.