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

Feature/transaction metadata #523

Merged
merged 13 commits into from
Apr 19, 2022
Merged

Feature/transaction metadata #523

merged 13 commits into from
Apr 19, 2022

Conversation

mloit
Copy link
Contributor

@mloit mloit commented Apr 15, 2022

This PR adds a new metadata struct that captures and stores additional data that is returned by a node when getting transaction information, but is not part of the transaction itself. This was inspired by the issue of gasPrice data being present for EIP-1559 transactions, even though EIP-1559 transactions have no such field, but Oracle was written to depend on this data for its calculations. Consequently Oracle has also been updated to use the new meta field added to EthereumTransaction

@@ -117,8 +106,6 @@ extension EIP1559Envelope {
case v
case r
case s
// MARK: workaround for gasPrice coming from nodes for EIP-1159 - this allows Oracle to work for now
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 1559 mistyped to 1159

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, but it's a line being deleted, so no need to fix.

@@ -147,9 +134,6 @@ extension EIP1559Envelope {
self.to = ethAddr
}

// MARK: workaround for gasPrice coming from nodes for EIP-1159 - this allows Oracle to work for now
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 1559 mistyped to 1159

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy paste when I did the workaround... this PR is removing it

@@ -330,10 +336,7 @@ extension EthereumTransaction {
guard let env = self.envelope as? EIP2930Envelope else { preconditionFailure("Unable to downcast to EIP2930Envelope") }
return env.parameters.gasPrice ?? 0
case .eip1559:
// MARK: workaround for gasPrice coming from nodes for EIP-1159 - this allows Oracle to work for now
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 1559 mistyped to 1159

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comments

@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'web3swift'
spec.version = '2.5.1'
spec.version = '2.6.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why on earth GitHub is flagging this as a change being made here, as develop is 2.6.0 not 2.5.1. This popped up as a result of updating the PR to the latest version of develop when 2.6.0 was released.

@yaroslavyaroslav yaroslavyaroslav merged commit 4b4ab1b into web3swift-team:develop Apr 19, 2022
@mloit mloit deleted the feature/transaction-metadata branch April 25, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants