kopanitsa / web3-arduino

an Arduino (or ESP32) library to use web3 on Ethereum platform.
MIT License
105 stars 45 forks source link

problem with the private key #22

Open toutou8148 opened 3 years ago

toutou8148 commented 3 years ago

the value of the private key changes after forcing it to uint8_t. In the provided example, the private key is declared as follow: const char PRIVATE_KEY[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; in my case, I set it as follow: const char PRIVATE_KEY[] = "0x.........";

In the provided example, the private key is forced to (uint8_t*). After forcing the private key, the value of the private key will be changed.

itsHaseebSaeed commented 3 years ago

Hi, there I'm having some issues running this library on my ESP32. Does it work on your esp32? If yes then I need your help. Please contact me using this email: haseebsyed30000@gmail.com. It would be huge favour

toutou8148 commented 3 years ago

Yes, It works. The library contains some error. You should make some changes to make it work. Regarding the private key, you must set it in the following format: const char PRIVATE_KEY[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };

Please send me the error you get when setting the private key in that format and I will try to help you solving the problem.