Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support typed data #343

Conversation

imotai
Copy link
Contributor

@imotai imotai commented Feb 26, 2023

Background

let users connect to the db3 network safely with Metamask

Why typed data

It's safe to sign none transaction data with Metamask

Integrate with Metamask

typed_data

The implementation

add a new mutation type to wrap the other mutation

enum PayloadType {
QuerySessionPayload =0;
DatabasePayload = 1;
MintCreditsPayload = 2;
// a evm chain request
TypedDataPayload = 3;
}

the types of typed data
let json = serde_json::json!({
"EIP712Domain": [
],
"Message":[
{"name":"payload", "type":"bytes"},
{"name":"payloadType", "type":"string"}
]
});

@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2023

Codecov Report

Merging #343 (887478c) into main (05edfcd) will increase coverage by 1.19%.
The diff coverage is 67.89%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
+ Coverage   63.74%   64.93%   +1.19%     
==========================================
  Files          68       67       -1     
  Lines        8570     9087     +517     
==========================================
+ Hits         5463     5901     +438     
- Misses       3107     3186      +79     
Flag Coverage Δ
rust 64.93% <67.89%> (+1.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/base/src/test_base.rs 81.48% <ø> (ø)
src/bridge/src/evm_chain_watcher.rs 0.00% <ø> (ø)
src/bridge/src/storage_chain_minter.rs 0.00% <ø> (ø)
src/cmd/src/deposit.rs 0.00% <0.00%> (ø)
src/cmd/src/show_evm_account.rs 0.00% <ø> (ø)
src/crypto/src/id.rs 95.10% <ø> (ø)
src/node/src/abci_impl.rs 0.66% <0.00%> (-0.02%) ⬇️
src/node/src/auth_storage.rs 0.68% <0.00%> (-0.01%) ⬇️
src/node/src/lib.rs 100.00% <ø> (ø)
src/node/src/storage_node_impl.rs 0.54% <0.00%> (-0.08%) ⬇️
... and 29 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

…to-notify-client-the-mutation-has-been-processed
@imotai imotai changed the title fix: replace tx with mutation Support event subscribution Mar 1, 2023
@imotai imotai changed the title Support event subscribution Support event subscribution and typed data Mar 2, 2023
@db3fans
Copy link
Collaborator

db3fans commented Mar 2, 2023

This PR exceeds the recommended size of 1200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@imotai imotai changed the title Support event subscribution and typed data Support typed data Mar 3, 2023
@db3fans
Copy link
Collaborator

db3fans commented Mar 3, 2023

This PR exceeds the recommended size of 1200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@db3fans
Copy link
Collaborator

db3fans commented Mar 3, 2023

This PR exceeds the recommended size of 1200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@db3fans
Copy link
Collaborator

db3fans commented Mar 3, 2023

This PR exceeds the recommended size of 1200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@db3fans
Copy link
Collaborator

db3fans commented Mar 4, 2023

This PR exceeds the recommended size of 1200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@db3fans
Copy link
Collaborator

db3fans commented Mar 4, 2023

This PR exceeds the recommended size of 1200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@imotai imotai merged commit 75783b3 into main Mar 4, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add subcribution to notify client the mutation has been processed
3 participants