tronprotocol / trident

129 stars 103 forks source link

I cannot see full error message #124

Open b3lowster opened 2 months ago

b3lowster commented 2 months ago

That's my code:

ApiWrapper client = ApiWrapper.ofNile(hexPrivateKey);
ApiWrapper client = getApiWrapper(privateKeyAsHexExternal);
            Response.TransactionExtention response = client.delegateResourceV2(addressExternalWallet, 500L, 1, addressInternalWallet, false, 0L);
Chain.Transaction transaction = client.signTransaction(response);
String txid = client.broadcastTransaction(transaction);
client.close();

I can see the following piece of message: _OTHERERROR, <ByteString@7bae6e72 size=80 contents="Contract validate error : delegateBalance must ..."> But the full message is the following: "Contract validate error : delegateBalance must be greater than or equal to 1 TRX"

endiaoekoe commented 2 months ago

That's my code:

ApiWrapper client = ApiWrapper.ofNile(hexPrivateKey);
ApiWrapper client = getApiWrapper(privateKeyAsHexExternal);
            Response.TransactionExtention response = client.delegateResourceV2(addressExternalWallet, 500L, 1, addressInternalWallet, false, 0L);
Chain.Transaction transaction = client.signTransaction(response);
String txid = client.broadcastTransaction(transaction);
client.close();

I can see the following piece of message: _OTHERERROR, <ByteString@7bae6e72 size=80 contents="Contract validate error: delegateBalance must ..."> But the full message is the following: "Contract validate error: delegateBalance must be greater than or equal to 1 TRX"

hi, @b3lowster From the messages you provided above, the return message of the delegateResourceV2 RPC calling is obvious, which indicates that there is something wrong with the param 'delegateBalance' you put in. The value of delegateBalance should be >=1 TRX. here in method delegateResourceV2, the unit of param 'delegateBalance ' is sun,and 1 TRX = 1,000,000 SUN .

I think you may misunderstand the unit here and may confused with the error message. just replace the value of parm ‘delegateBalance ’ from 1 to 1000000 and try again. hope it helps.