-
Notifications
You must be signed in to change notification settings - Fork 0
Problem with signing/sending transactions #8
Comments
Hello @CrisESC93 I see that a signature was done correctly, although no response was received after sending raw transaction. Would you try to put a debug breakpoint there and see what actually happens. Also, what Ethereum node do you use for testing? Chain ID of 33333 is quite high, and web3swift enforces EIP155, so may be the node just rejects such transaction. Sincerely, Alexander |
Hello @shamatar Thanks for answer me. Now I'm working with a private node created by the blockchain developers with which I'm working now, so I don't know if that make problems? Also I commented to them your observation about the Chain ID, they gonna change this value and we try again another tests. Update: let params = [accountAddress] as [AnyObject]
guard
let contract = web3.contract(abi, at: contractAddress),
let intermediate = contract.method("balanceOf", parameters: params, options: options)
else {
return
}
if let response = intermediate.call(options: nil) {
print("Response:\n\(response)")
}
else {
print("No Response")
} I receive a response: ["id": 1518025152, "result": 0x00000000000000000000000000000000000000000000000000000000000f4240, "jsonrpc": 2.0]
Response:
["0": 0, "balance": 1000000] Thanks. |
Hello @CrisESC93 From "call" test I'd say parameters are encoded and processed correctly (I assume you are running on the same network/node). If EIP155 is not supported on your local test net - it can be an issue, what you can do is try to set web3.provider.network = nil. I see a problem in my dependency chaining for transactions, and I'll make it easier to disable of EIP155, but will take a day or two. Sincerely, Alexander |
Hello @shamatar Thanks for answer. The blockchain developers tells me it's probably that not configured (and maybe they will not try to use it because they wanna create a private blockchain). Also I have a another doubt, how can get the decoded private key? Because they wanna implement the import/export from this key. Thanks for your help. |
Hello @CrisESC93 Unsafe functions (like exposing unencrypted key for any time other than signing) were forbidden and not implemented by design. For your particular dial I'd recommend to either export a keystore JSON file to your computer and unarchive it using one of the public utilities, it's a standard Geth keystore format, version 3. Otherwise you can edit the source and make a decryption function declaration public. Sincerely, Alexander |
Hello @shamatar Thanks for the advice, so for now I'm will start to work with the function to get the private key. I hope the new version of the library can be works with our node, meanwhile I convinced to the blockchain developers to try implement the EIP155 and let me do tests. As soon as I get the results I'll post them here. Thanks for your help. |
Hello @CrisESC93 I've decided to implement this UNSAFE method for user convenience, as well as an ability to disable EIP155 by an extra call. It'll come with a massive overhaul of 0.3 release in the next week. Sincerely, Alexander |
Hello @shamatar After having done many tests, the transactions work. We discovered that there were problems with the node, which we are still solving (for example we continue to find out about sending errors). The only problem I had when sending transactions with the method: intermediate.send(password: "MyPassword", options: nil) is that it no longer signs more than one transaction per account, so I decided to sign with the method: keystoreManager.signTX(transaction: &intermediate.transaction, password: "MyPassword", account: EthereumAddress("0x...")) and send the transaction with the method: intermediate.sendSigned() And with these steps the transactions are signed and sent correctly. Thanks Alexander. |
Hello!!!
I have some doubts how sign and send transactions, for example I have something like this:
But the console show me:
I saw the example (Send on Rinkeby) and this issue but when I try to implement something like that doesn't works.
I hope can you help me.
Thanks.
The text was updated successfully, but these errors were encountered: