-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix contract bugs #682
fix contract bugs #682
Conversation
/// - sendRaw: If set to `true` transaction will be signed and sent using `eth_sendRawTransaction`. | ||
/// Otherwise, no signing attempts will take place and the `eth_sendTransaction` RPC will be used instead. | ||
/// Default value is `false`. | ||
public func writeToChain(password: String, policies: Policies = .auto, sendRaw: Bool = false) async throws -> TransactionSendingResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not sure why would we set default value for sendRaw
to false.
One issue I see clearly now with this implementation - everyone who uses the library will suddenly start sending unsigned transactions to the blockchain and that will basically break everything for those developers.
So I think in the current state this PR won't pass.
@pharms-eth Could you please either paste a link here or maybe describe once again why did you decide to set the value to false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably found it - https://github.com/web3swift-team/web3swift/pull/670/files#r1027680672
So this was the issue?
yes setting it true by default makes the tests fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea this can't be the reasoning. pharms would have to investigate why the tests fail then.
I see it like you @JeneaVranceanu we can't just change this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I will investigate the failed tests
@@ -325,7 +325,7 @@ extension ABI.Element.Function { | |||
// set a flag to detect the request succeeded | |||
} | |||
|
|||
if returnArray.isEmpty { | |||
if returnArray.isEmpty && !outputs.isEmpty { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I'm annoying with this but can we please make a test here. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will work on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wonder, does it resolved yet, @pharms-eth?
The following test fails:
@pharms-eth It appears to be that deployment of a contract in this test requires us to set |
@pharms-eth Please run all tests locally. You will need After that run |
I do not use truffle products, the quality of their work is not good, So i will not want to install locally and pollute my machine. however the errors now are vague and so may require it |
@pharms-eth There are at least 10 other tests that fail. Please open this job run and search by At the same time, I'll check why do we need |
This what I was thinking is |
I just wonder, why they fails? Is it on ganache's side or is it us? Like why it it matter on the test side? And I think it's worth to add a test to covering this new |
Just to highlight it once more: this one will be the last breaking change to be accepted within 3.*.* |
@yaroslavyaroslav @janndriessen a lot of the failures are because under this change we need the tests setup with the keystore manager. but because they are not and the default is set to use that path, it fails |
To be able to use signed transactions, shouldn't it be something like this in every test?
(Code not tested.) What do you think? @pharms-eth @JeneaVranceanu @yaroslavyaroslav |
I've tried something like that in one of the tests and it failed. Not sure if it was exactly this configuration. |
@yaroslavyaroslav @janndriessen @pharms-eth Reasoning: we are using Ganache for testing (and I think other platforms that spin up blockchains/nodes locally for testing do the same) and when it launches a network it generates a list of private keys, thus a list of addresses, that we can use. To access this list we can call So this solution with attaching key store manager would work as well but then we must use Conclusion: additionally, besides fixing tests by using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this PR except that one issue with condition enhancement without covering it by the test.
I suppose it should be either covered right here right now or issue about that has to be created.
Personally, I think it's too important part of the library to not looking into it now as it could be breaking changes too. I'm not familiar with that area but could look into it next week. Though @JeneaVranceanu told me via DM that he's looking into this as well. |
I'm writing a test for it right now. Will push it as a separate branch. |
@janndriessen I've changed the base branch of this PR so I can push the tests in a PR based on this branch without the need for re-review. |
No description provided.