Skip to content
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

WriteOperation.transaction ignores ERC*.transaction settings #712

Closed
yaroslavyaroslav opened this issue Dec 15, 2022 · 0 comments · Fixed by #715
Closed

WriteOperation.transaction ignores ERC*.transaction settings #712

yaroslavyaroslav opened this issue Dec 15, 2022 · 0 comments · Fixed by #715
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@yaroslavyaroslav
Copy link
Collaborator

yaroslavyaroslav commented Dec 15, 2022

What happened?

This issue is a more general representation of #711 one.

ERC*.transaction never assigns to Contract.transaction for any given method that writes on chain with WriteOperation.

So the fix is as easy as modifying each method that returns WriteOperation as follow:

/// This line is at the very beginning of any `ERC*` method
let contract = self.contract // this line should be deleted.
/* 
a method implementation
*/
contract.transaction = transaction
/// this line is already exists
let tx = contract.createWriteOperation("transferFrom", parameters: [originalOwner, to, value] as [AnyObject] )!

The #713 PR is fixing the only ERC20 case of this issue, but this fix highly likely could be scaled to all ERC* implementations.

What are the steps to reproduce?

See #711

What is the expected behavior?

ERC*.transaction settings should be preserved in WriteOperation.transaction returned by whatever ERC* method that returns such.

What is the error thrown?

There's no error it fails silently.

What's the stack trace said?

There's no error it fails silently.

OS version

Unrelated.

Library version

3.0.6

@yaroslavyaroslav yaroslavyaroslav added the bug Something isn't working label Dec 15, 2022
yaroslavyaroslav added a commit to yaroslavyaroslav/web3swift that referenced this issue Dec 15, 2022
…n` never assigns to `Contract.transaction` for any given method that writes on chain.

Obviously it's a bug spreading all over the `Token` implementation. So this fix should be applied to all `ERC*.swift` methods that returns `WriteOperation`.

This is the special case of web3swift-team#712.

Closes web3swift-team#711
@yaroslavyaroslav yaroslavyaroslav added the good first issue Good for newcomers label Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant