3

I'm trying to add verifyTransactionBytes to my app. I am currently stuck because of transaction.recipient !== data.recipient. I don't understand how transaction.recipient will ever equal data.recipient.

data.recipient equals ARDOR-64L4-C4H9-Z9PU-9YKDT

However, transaction.recipient equals 12686039152117651770352583052021228896653772998482022211948610002430512793010043372255281183988421160450227631016638876582933743874739812608892576232835541561180017189881475915550182092483428449468438018195304514943626747005224233901130236596723251118266281272406204049816147466250586545776300564249483796886483621200942491492199171631589798205980673

This doesn't really surprise me, because I don't see how an ARDOR address gets generated from transaction.recipient = String(helpers.byteArrayToBigInteger(byteArray, pos));

Which looks like it should return a number, not a string. What am I missing

2

You need to either convert data.recipient from RS format to numeric format or convert transaction.recipient from numeric format to RS format using NRS.convertNumericToRSAccountFormat(id)

  • 1
    So transaction.recipient should be the numeric format of the recipient addresses? – MrV Oct 6 '18 at 19:46
  • 1
    Right, you can convert the public key to numeric account then convert it to RS format using NRS.convertNumericToRSAccountFormat(id) – lyaffe Oct 6 '18 at 20:42
  • 2
    I found my error. My byteArrayToBigInteger function was incorrect. Your answer helped me though, as I new what outcome I should expect with the numeric address. Thank you! – MrV Oct 6 '18 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.