diff --git a/package.json b/package.json index 460a440..fec932d 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "ethereumjs-util": "6.0.0", "fork-ts-checker-webpack-plugin": "^0.4.15", "jsbi-utils": "^1.0.0", - "leap-core": "0.38.0", + "leap-core": "2.0.0", "mobx": "^5.0.3", "mobx-react": "^5.2.3", "prop-types": "^15.6.1", diff --git a/src/stores/unspents.ts b/src/stores/unspents.ts index 95cc712..e8303bd 100644 --- a/src/stores/unspents.ts +++ b/src/stores/unspents.ts @@ -129,15 +129,10 @@ export class UnspentsStore { }); } - private exitDeposit( - unspentDeposit: UnspentWithTx, - fallbackPeriodData: PeriodData - ) { - return getProof( - web3PlasmaStore.instance, - unspentDeposit.transaction, - fallbackPeriodData - ).then(txProof => + private exitDeposit(unspentDeposit: UnspentWithTx) { + return getProof(web3PlasmaStore.instance, unspentDeposit.transaction, { + excludePrevHashFromProof: true, + }).then(txProof => exitHandlerStore.startExit([], txProof, unspentDeposit.outpoint.index, 0) ); } @@ -146,23 +141,19 @@ export class UnspentsStore { public exitUnspent(unspent: UnspentWithTx) { const tx = Tx.fromRaw(unspent.transaction.raw); - const { signer } = operatorStore.slots[0]; - - const fallbackPeriodData = { slotId: 0, validatorAddress: signer }; - if (tx.type === Type.DEPOSIT) { - return this.exitDeposit(unspent, fallbackPeriodData); + return this.exitDeposit(unspent); } getYoungestInputTx(web3PlasmaStore.instance, tx) .then(inputTx => Promise.all([ - getProof( - web3PlasmaStore.instance, - unspent.transaction, - fallbackPeriodData - ), - getProof(web3PlasmaStore.instance, inputTx.tx, fallbackPeriodData), + getProof(web3PlasmaStore.instance, unspent.transaction, { + excludePrevHashFromProof: true, + }), + getProof(web3PlasmaStore.instance, inputTx.tx, { + excludePrevHashFromProof: true, + }), inputTx.index, ]) ) @@ -207,7 +198,6 @@ export class UnspentsStore { @autobind private finalizeFastExit(exit) { console.log('Finalizing fast exit', exit, operatorStore.slots); - const { signer } = operatorStore.slots[0]; const { unspent, sig, rawTx, sigHashBuff } = exit; const vBuff = Buffer.alloc(32); vBuff.writeInt8(sig.v, 31); @@ -220,8 +210,12 @@ export class UnspentsStore { ]) ); return Promise.all([ - getProof(web3PlasmaStore.instance, rawTx), - getProof(web3PlasmaStore.instance, unspent.transaction), + getProof(web3PlasmaStore.instance, rawTx, { + excludePrevHashFromProof: true, + }), + getProof(web3PlasmaStore.instance, unspent.transaction, { + excludePrevHashFromProof: true, + }), 0, ]).then(([txProof, inputProof, inputIndex]) => { // call api diff --git a/yarn.lock b/yarn.lock index d70da3c..22979c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3660,6 +3660,11 @@ eventemitter3@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.1.1.tgz#47786bdaa087caf7b1b75e73abc5c7d540158cd0" +eventemitter3@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== + eventemitter3@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" @@ -5108,15 +5113,16 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -leap-core@0.38.0: - version "0.38.0" - resolved "https://registry.yarnpkg.com/leap-core/-/leap-core-0.38.0.tgz#808ddff55bb5189771e0fbc2a086210529a17b4f" - integrity sha512-mjS3UOiJp05wRKRsURI1u8XzZ/4HmScpj3cpAGRC9ls4QShu/XAf2CpK297PWAfHT+xQTLyd3OxBNujhuTXamA== +leap-core@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/leap-core/-/leap-core-2.0.0.tgz#e0ce5000bf77afd72f5a72236d6b80e82e8d3f19" + integrity sha512-DqbWSrYNz+ZGIROXfT7SBUC0FHon6rrv6I7RCrxbzqjDsHHh6lmpMW6v+kkJtYYRe6TkalxPZMz0HRgo+ndtbw== dependencies: "@types/web3" "^1.0.18" ethereumjs-util "6.0.0" jsbi-utils "^1.0.0" node-fetch "^2.3.0" + web3-core-promievent "^1.2.4" less-loader@^4.1.0: version "4.1.0" @@ -8601,6 +8607,14 @@ web3-core-promievent@1.0.0-beta.33: any-promise "1.3.0" eventemitter3 "1.1.1" +web3-core-promievent@^1.2.4: + version "1.2.6" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.6.tgz#b1550a3a4163e48b8b704c1fe4b0084fc2dad8f5" + integrity sha512-km72kJef/qtQNiSjDJJVHIZvoVOm6ytW3FCYnOcCs7RIkviAb5JYlPiye0o4pJOLzCXYID7DK7Q9bhY8qWb1lw== + dependencies: + any-promise "1.3.0" + eventemitter3 "3.1.2" + web3-core-requestmanager@1.0.0-beta.33: version "1.0.0-beta.33" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.33.tgz#7a36c40354002dfb179ca2dbdb6a6012c9f719eb"