67P / kredits-contracts-legacy

[DEPRECATED] Smart contracts for Kosmos Kredits
5 stars 3 forks source link

Add seeding script #4

Closed bumi closed 7 years ago

bumi commented 7 years ago

the seed script allows to execute certain contract function to easily setup testing data for locally deployed contracts to a development chain.

bumi commented 7 years ago

@skddc I need to run that async contract calls sequential. Can I do that somehow differnetly, without the asyc dependency?

galfert commented 7 years ago

@bumi do the contract calls return Promises?

bumi commented 7 years ago

no, they use callbacks, like:

Kredits.contractMethod(argumens, function(err, response) {
  console.log(response);
});

I've tried to wrap that in a Promise but could not get it work to run sequentially.

galfert commented 7 years ago

I think it's possible with some recursive function calling, but it wouldn't look remotely as simple as with async :)

If you really want to get rid of the dependency, I would be happy to give it a try.

bumi commented 7 years ago

nah, I've spent enough time on that. :) thanks! also thought it might work with async/await - but could not get that working either.

bumi commented 7 years ago

I am merging this then.

galfert commented 7 years ago

also thought it might work with async/await - but could not get that working either.

I think that only works with Promises.