You are viewing a single comment's thread from:

RE: Hive-PHP - A real PHP library for Hive

in HiveDevs2 years ago

Hello.
I am using your library in my project. Does my project need delegation. I tried $hive->broadcast($privateKey ...) for delegation and it didn't work when Amount delegation > 10000 VEST. The error I get is: missing required active authority:Missing Active Authority sora-haraTransaction failed to validate using both new (hf26) and legacy serialization. The key I use is Active Key private. Can you share with me why? Thank you.

Sort:  
 2 years ago  

That error can be because of wrong parameters of the transaction. Send me the full code.

Thanks for your answer. This is my code.
$ops = [
"sora-hara",
"tuanbh",
"5000.000000 VESTS"
];
$hive = new Hive();
// create Obj privateKey
$key = $hive->privateKeyFrom(HIVE_DELEGATION_KEY);
// call API
$request = $hive->broadcast($key, 'delegate_vesting_shares', $ops);
It succeeds when VEST = 2000. AND >= 5000 then error.

I checked with the js library that the sign function to create a signature is giving a different value than your library when putting in the same Transaction. But I can't tell where it's coming from because the encryption libraries of the 2 are different. You code you are correct. Can you give me more information about the sign signature? Version of the library that is associated with it.

 2 years ago  

When you create a transaction, its parameters are dynamic so the signature will be different every time you make the same exact transaction. Also, for the same exact transaction (assuming the dynamic parts are fixed), it is completely fine to have multiple unique signatures.
Make sure the account you are delegating has enough VESTS.
The code seems fine but I will do some testing later to confirm it is fine.

Can you tell me your test results with delegation > 5000 VESTS? If it's completely fine. Can you share with me the versions of the libraries involved in the sign key? thank you so much.

About testing. I got a transaction and set them directly to the param of the JS and PHP sign functions. I then used the generated signature of JS for PHP and the transaction was successful. When I pass specific param the JS signature result always returns a value so I don't think there will be any other interference resulting in the 2 different results.