thehubbleproject / contracts

Smart contracts for OPRHub protocol ✌🏻
12 stars 10 forks source link

Cleanup tests a little bit #75

Closed ChihChengLiang closed 4 years ago

ChihChengLiang commented 4 years ago

I'm trying to make writing tests happier. A low hanging fruit is to create more TypeScript interfaces.

Since the Typechain struct doesn't work, we currently manually deconstruct many data structures everywhere. That increased line of code and bad for readability. We should us TypeScript interfaces more in the tests itself and move deconstruction to utils.

In this PR I created the interface of Account and Transaction.

vaibhavchellani commented 4 years ago

Love it! I am very new to JS and typescript and hence didn't venture into this, but this is def the direction we should pursue.

vaibhavchellani commented 4 years ago

@ChihChengLiang I would love to merge this, any idea why the CI is failing?

ChihChengLiang commented 4 years ago

@vaibhavchellani The CI recently failed at the npm install steps a lot. Usually, I rerun the CI. Can you hit the rerun button for me?

vaibhavchellani commented 4 years ago

Sure, done!

Can you confirm that the npm run tests works for you locally?

ChihChengLiang commented 4 years ago

Thanks. npm run tests works locally for me. But I'm happy to wait for the CI to complete.