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

[ADD] Implement starknet_estimateMessageFee method #84

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

dioKaratzas
Copy link
Contributor

@dioKaratzas dioKaratzas commented Jul 17, 2023

Resolves #80

@dioKaratzas dioKaratzas changed the title [ADD] Implement starknet_estimateMessageFee method #80 [ADD] Implement starknet_estimateMessageFee method Jul 17, 2023
@@ -56,6 +56,18 @@ struct EstimateFeeParams: Encodable {
}
}

struct EstimateMessageFeeParams: Encodable {
let message: StarknetCall
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be MSG_FROM_L1 struct instead:

"MSG_FROM_L1": {
  "title": "Message from L1",
  "type": "object",
  "properties": {
      "from_address": {
          "description": "The address of the L1 contract sending the message",
          "$ref": "#/components/schemas/ETH_ADDRESS"
      },
      "to_address": {
          "title": "To address",
          "description": "The target L2 address the message is sent to",
          "$ref": "#/components/schemas/ADDRESS"
      },
      "payload": {
          "description": "The payload of the message",
          "title": "Payload",
          "type": "array",
          "items": {
              "$ref": "#/components/schemas/FELT"
          }
      }
},

Copy link
Contributor Author

@dioKaratzas dioKaratzas Jul 17, 2023

Choose a reason for hiding this comment

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

@bartekryba We need to clarify as I tried that already and was getting the following error by using our provider:

AccountTest.swift:174: error: -[StarknetTests.AccountTests testEtimateMessageFee] : failed: caught error: "jsonRpcError(-32602, "missing field `contract_address` at line 1 column 258")"
Test Case '-[StarknetTests.AccountTests testEtimateMessageFee]' failed (2.424 seconds).

Please check starkware-libs/starknet-specs@37c5ed1
It is tagged for v0.4.0-rc1.

The contract_address relates to the v0.4.0-rc1. Should we wait to tag a new release with the MSG_FROM_L1 struct change included?

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked the commit, but it was actually a part of a PR, where it was changed to MSG_FROM_L1 starkware-libs/starknet-specs#100

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok we can change, as that change will reflect to the next release

Copy link
Contributor Author

@dioKaratzas dioKaratzas Jul 18, 2023

Choose a reason for hiding this comment

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

@dioKaratzas
Copy link
Contributor Author

Reverted back to 22785ab
To support v0.3.1 schema

@bartekryba bartekryba merged commit 9fd942a into software-mansion:main Jul 18, 2023
@dioKaratzas dioKaratzas deleted the feat/estimate-message branch July 18, 2023 12:18
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.

Implement starknet_estimateMessageFee method
2 participants