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

fix: grpc inconsistent serialization of keys (see issue #4224) #4491

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
000d939
clear pending coinbase transactions now rely on utxo hashes
jorgeantonio21 Aug 3, 2022
3a93730
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 3, 2022
af7843d
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 4, 2022
d9a9d1c
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 5, 2022
468aff6
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 8, 2022
aa225a4
sync with dev
jorgeantonio21 Aug 8, 2022
68ec0b2
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 9, 2022
6edf4fb
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 9, 2022
265821d
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 11, 2022
39d3309
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 11, 2022
73bb978
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 11, 2022
aeb9184
changes
jorgeantonio21 Aug 12, 2022
2047081
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 15, 2022
839673d
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 16, 2022
053f3a7
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 16, 2022
0b75544
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 17, 2022
686719b
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 17, 2022
766e6b0
first commit
jorgeantonio21 Aug 17, 2022
e995f82
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 18, 2022
3277cd6
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 18, 2022
71a8e70
Merge branch 'development' into ja-grpc-inconsistent-serialization-of…
jorgeantonio21 Aug 18, 2022
f68ede4
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 18, 2022
79d5701
refactor cucumber tests
jorgeantonio21 Aug 18, 2022
8013468
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 18, 2022
f965c27
refactor cucumber tests
jorgeantonio21 Aug 18, 2022
2a7d221
Merge branch 'development' into ja-grpc-inconsistent-serialization-of…
jorgeantonio21 Aug 18, 2022
72d2dfd
Merge branch 'development' into ja-grpc-inconsistent-serialization-of…
jorgeantonio21 Aug 18, 2022
209926a
refactor cucumber tests
jorgeantonio21 Aug 19, 2022
85082c0
change 32-byte little endian representation of pub key to hex represe…
jorgeantonio21 Aug 19, 2022
6bf8ba6
formatting
jorgeantonio21 Aug 19, 2022
9fc96c7
add little endian representation of public key
jorgeantonio21 Aug 19, 2022
f5d5436
refactor cucumber tests
jorgeantonio21 Aug 22, 2022
2939edb
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 22, 2022
f4ddea2
Merge branch 'development' of github.com:jorgeantonio21/tari into dev…
jorgeantonio21 Aug 22, 2022
62630e8
Merge branch 'development' into ja-grpc-inconsistent-serialization-of…
jorgeantonio21 Aug 22, 2022
bba5f95
refactor cucumber tests
jorgeantonio21 Aug 22, 2022
592886e
remove undefined behavior
jorgeantonio21 Aug 22, 2022
a42a138
add toString("hex")
jorgeantonio21 Aug 22, 2022
96086a6
small changes
jorgeantonio21 Aug 22, 2022
0adbdfd
lint
jorgeantonio21 Aug 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ impl wallet_server::Wallet for WalletGrpcServer {
async fn identify(&self, _: Request<GetIdentityRequest>) -> Result<Response<GetIdentityResponse>, Status> {
let identity = self.wallet.comms.node_identity();
Ok(Response::new(GetIdentityResponse {
public_key: identity.public_key().to_string().into_bytes(),
public_key: identity.public_key().to_vec(),
public_address: identity.public_address().to_string(),
node_id: identity.node_id().to_string().into_bytes(),
node_id: identity.node_id().to_vec(),
}))
}

Expand Down
5 changes: 3 additions & 2 deletions integration_tests/features/support/ffi_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ Then("I want to get public key of ffi wallet {word}", function (name) {
let wallet = this.getWallet(name);
let public_key = wallet.identify();
expect(public_key.length).to.be.equal(
64,
32,
`Public key has wrong length : ${public_key}`
);
});
Expand Down Expand Up @@ -723,7 +723,8 @@ Then(
() => {
let publicKeys = wallet.listConnectedPublicKeys();
return (
publicKeys && publicKeys.some((p) => p === nodeIdentity.public_key)
publicKeys &&
publicKeys.some((p) => p === nodeIdentity.public_key.toString("hex"))
);
},
true,
Expand Down
10 changes: 8 additions & 2 deletions integration_tests/features/support/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@ When(

await waitForPredicate(async () => {
let peers = await firstNodeClient.listConnectedPeers();
return peers.some((p) => secondNodeIdentity.public_key === p.public_key);
return peers.some(
(p) => secondNodeIdentity.public_key.toString("hex") === p.public_key
);
}, 50 * 1000);
}
);
Expand All @@ -519,7 +521,11 @@ Then(/(.*) is connected to (.*)/, async function (firstNode, secondNode) {
const secondNodeIdentity = await secondNodeClient.identify();
let peers = await firstNodeClient.listConnectedPeers();
expect(
peers.some((p) => secondNodeIdentity.public_key === p.public_key)
peers.some(
(p) =>
secondNodeIdentity.public_key.toString("hex") ===
p.public_key.toString("hex")
)
).to.be.true;
});

Expand Down