Skip to content
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

93 responder #114

Merged
merged 51 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
603f1b1
Fixes bug in asyncEmit; improved to return a promise instead of void
bigspider Apr 12, 2019
6bbdb9f
First test for the responder
bigspider Apr 12, 2019
965e8e1
Make a snapshot of the blockchain and restore it after each test
bigspider Apr 12, 2019
f133f66
Added first test on the flow of EthereumDedicatedResponder using sino…
bigspider Apr 12, 2019
2f52f17
Added additional test
bigspider Apr 12, 2019
6b8f158
Removed unnecessary time-dependency from test
bigspider Apr 15, 2019
82ec7a8
Added one more waiting guard for reliability of the test
bigspider Apr 15, 2019
df885b2
Minor code cleanup
bigspider Apr 15, 2019
3745bff
Checking contract state at the end of the test
bigspider Apr 15, 2019
84a2148
Added test for no new block received; increased no-new-block timeout …
bigspider Apr 15, 2019
061fd95
Some restructuring; added some debug info for unexpected failures.
bigspider Apr 15, 2019
6bf6821
Added more logging for unexpected incorrect snapshots
bigspider Apr 15, 2019
bbcae81
Refactored base classes for responder; created stub class for Ethereu…
bigspider Apr 16, 2019
dd26124
First (almost complete) implementation of the EthereumMultiResponder;…
bigspider Apr 17, 2019
892aaa8
Various fixes for EthereumMultiResponder; added some tests; major ref…
bigspider Apr 17, 2019
154723b
Various fixes and tests for EthereumMultiResponder
bigspider Apr 18, 2019
d017436
Modified test setup to make it possible to add options to ganache
bigspider Apr 18, 2019
6165b12
Fixes for non-auto-mining ganache
bigspider Apr 18, 2019
6705d0e
Added basic gas price management
bigspider Apr 23, 2019
1704f4d
Added test for reorgs to EthereumDedicatedResponder
bigspider Apr 23, 2019
38d376d
Removed log messages
bigspider Apr 24, 2019
4abff9d
Added basic test for stuck transaction
bigspider Apr 24, 2019
e0ab16d
Minor comment
bigspider Apr 24, 2019
3c5e0c2
Improved nonce management
bigspider Apr 25, 2019
8ae819b
Minor improvements; comments on failing test
bigspider Apr 25, 2019
9eb6a82
Removed unused interface
bigspider Apr 26, 2019
2e41621
Added explicit modifier to constructor
bigspider Apr 26, 2019
e48f89b
Refactored nonce as parameter of submitStateFunction instead of class…
bigspider Apr 26, 2019
6cb3637
Refactored setup/destroy with a lock pattern in EthereumDedicatedResp…
bigspider Apr 26, 2019
27bbe62
Removed unnecessary default values from the responders
bigspider Apr 26, 2019
a6aacee
Make sure variable are initialized when the flow is started; uniformi…
bigspider Apr 26, 2019
91c5f9c
Comment
bigspider Apr 26, 2019
d0ce74c
Removed code and tests for the multiresponder
bigspider Apr 26, 2019
f941a0d
Added CancellablePromise in utils
bigspider Apr 26, 2019
005f5a9
Improved the CancellablePromise; refactored the logic to wait for det…
bigspider Apr 26, 2019
4e19b87
Refactored the test for NoNewBlockError using CancellablePromise
bigspider Apr 26, 2019
8cd249b
Added test for rejectIfAnyBlockTimesOut
bigspider Apr 29, 2019
de0718a
Added test for rejectAfterBlocks
bigspider Apr 29, 2019
89f5650
Refactored GasPolicy out of EthereumDedicatedResponder
bigspider Apr 29, 2019
1425754
Removed ICancellable and waitFor; simplified CancellablePromise.
bigspider Apr 30, 2019
cb3b4a6
Made getIncreasedGasPrice synchronous; changed to more specific error…
bigspider Apr 30, 2019
3ea9598
Removed the attemptsDone variable in the ResponderManager; moved to a…
bigspider Apr 30, 2019
280a4db
Restructured and improved unit tests for rejectIfAnyBlockTimesOut and…
bigspider Apr 30, 2019
79bc7fd
Fix spacing
bigspider Apr 30, 2019
26690d3
Added more documentation on waitForConfirmations
bigspider Apr 30, 2019
5180b2c
Factored EthereumTransactionMiner out of the EthereumDedicatedResponder
bigspider Apr 30, 2019
7e663bd
Further refactoring of the EthereumTransactionMiner
bigspider Apr 30, 2019
b48c59e
Fixed broken test
bigspider Apr 30, 2019
8426ceb
Adding some waiting time seems to solve the test that is occasionally…
bigspider Apr 30, 2019
352fc27
Renamed GasPolicy to IGasPolicy; removed default values and unused pa…
bigspider May 1, 2019
03394fa
Removed unused defeault parameter; removed wrapping of some promises …
bigspider May 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,356 changes: 6,003 additions & 353 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
},
"homepage": "https://github.com/PISAresearch/pisa#readme",
"dependencies": {
"@types/sinon": "^7.0.11",
"ethers": "^4.0.7",
"express": "^4.16.4",
"express-http-context": "^1.2.0",
"ganache-core": "^2.5.3",
"ganache-core": "^2.5.4",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"rwlock": "^5.0.0",
Expand All @@ -49,6 +50,7 @@
"@types/express": "^4.16.0",
"@types/fs-extra": "^5.0.5",
"@types/ganache-core": "^2.1.1",
"@types/lolex": "^3.1.1",
"@types/mocha": "^5.2.5",
"@types/request-promise": "^4.1.42",
"@types/rwlock": "^5.0.2",
Expand All @@ -57,8 +59,11 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"fs-extra": "^7.0.1",
"lolex": "^4.0.1",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"sinon": "^7.3.1",
"sinon-chai": "^3.3.0",
"tree-kill": "^1.2.1",
"ts-mockito": "^2.3.1",
"ts-node": "^7.0.1",
Expand Down
8 changes: 4 additions & 4 deletions src/dataEntities/appointment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface IEthereumAppointment extends IAppointment {
formatLog(message: string): string;
getResponseFunctionName(): string;
getResponseFunctionArgs(): any[];
getResponse(): IEthereumResponse;
getResponseData(): IEthereumResponseData;
}


Expand Down Expand Up @@ -95,9 +95,9 @@ export abstract class EthereumAppointment implements IEthereumAppointment {
abstract getResponseFunctionArgs(): any[];

/**
* Returns the IEthereumResponse object for this appointment
* Returns the IEthereumResponseData object for this appointment
*/
public getResponse(): IEthereumResponse {
public getResponseData(): IEthereumResponseData {
return {
contractAddress: this.getContractAddress(),
contractAbi: this.getContractAbi(),
Expand All @@ -110,7 +110,7 @@ export abstract class EthereumAppointment implements IEthereumAppointment {
/**
* Represents the necessary data for an on-chain response from Pisa on the Ethereum blockchain.
*/
export interface IEthereumResponse {
export interface IEthereumResponseData {
contractAddress: string,
contractAbi: any,
functionName: string,
Expand Down
2 changes: 1 addition & 1 deletion src/dataEntities/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { IAppointment, IEthereumAppointment, EthereumAppointment, IEthereumResponse } from "./appointment";
export { IAppointment, IEthereumAppointment, EthereumAppointment, IEthereumResponseData } from "./appointment";
export { PublicDataValidationError, PublicInspectionError, ConfigurationError, ApplicationError } from "./errors";
export { ChannelType } from "./channelType";
export {
Expand Down
2 changes: 1 addition & 1 deletion src/integrations/kitsune/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
doesPropertyExist,
isArrayOfStrings,
PublicDataValidationError,
checkAppointment,
checkAppointment
} from "../../dataEntities";
import { Inspector } from "../../inspector";
import { PublicInspectionError, ConfigurationError } from "../../dataEntities/errors";
Expand Down
Loading