Chainers / Ditch

Create and broadcast transactions to Graphene-based blockchains
MIT License
33 stars 26 forks source link

STEEM API change creates 2 issues with Ditch.Steem.OperationManager class #11

Closed andidrea closed 6 years ago

andidrea commented 6 years ago

It seems there was an API change on March 23:

There are 2 issue in class: Ditch.Steem.OperationManager.TryLoadChainId()

(1.) Naming change:

var scid = conf.STEEMIT_CHAIN_ID as JValue;
var smpsbd = conf.STEEMIT_MIN_PAYOUT_SBD as JValue;
var sbhv = conf.STEEMIT_BLOCKCHAIN_HARDFORK_VERSION as JValue;

STEEMIT has changed to STEEM:

var scid = conf.STEEM_CHAIN_ID as JValue;
var smpsbd = conf.STEEM_MIN_PAYOUT_SBD as JValue;
var sbhv = conf.STEEM_BLOCKCHAIN_HARDFORK_VERSION as JValue;

(2.) STEEM_MIN_PAYOUT_SBD seems to have a different result value than expected and creates an error:

var smpsbd = conf.STEEM_MIN_PAYOUT_SBD as JValue;

The new result is an array.


Because of the 2 issues the class TryLoadChainId() returns false. And because of that var url = _operationManager.TryConnectTo() is now always string.empty.

Anyway it seems every other API call still seems to work as expected.

Thank you for your work I highly appreciate it.

andidrea commented 6 years ago

I have found issues related to the above comment: Creating and broadcasting transactions is broken because it requires the STEEM_CHAIN_ID and STEEM_BLOCKCHAIN_HARDFORK_VERSION.

Example If you do a vote via

var voteOp = new VoteOperation(YouLogin, author, url, 10000);
var response = _operationManager.BroadcastOperations(YouPrivateKeys, CancellationToken.None, voteOp);

the method SerializeHelper.AddToMessageStream(Stream stream, PropertyInfo prop, object val, int hardforkVersion) requires the hardfork version (conf.STEEM_BLOCKCHAIN_HARDFORK_VERSION) as a parameter.

EDIT What I meant to say is even if you change the code to get the STEEM_BLOCKCHAIN_HARDFORK_VERSION and STEEM_CHAIN_ID the transaction won't work.

KorzunAV commented 6 years ago

Thanks for the comment. I'll take it in account and will fix in the next build.

KorzunAV commented 6 years ago

1 - Config added. Now you may specify field name manually (If needed) 2 - STEEMIT_MIN_PAYOUT_SBD and STEEMIT_BLOCKCHAIN_HARDFORK_VERSION fields are no longer used and was deleted