Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
fc3a7010
Commit
fc3a7010
authored
1 year ago
by
Branislav Kontur
Committed by
Serban Iorga
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Backport for polkadot-sdk#1446 (#2546)
* Backport for polkadot-sdk#1446 * Cargo.toml
parent
b0041fc6
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bridges/primitives/test-utils/Cargo.toml
+1
-1
1 addition, 1 deletion
bridges/primitives/test-utils/Cargo.toml
bridges/primitives/test-utils/src/keyring.rs
+5
-19
5 additions, 19 deletions
bridges/primitives/test-utils/src/keyring.rs
with
6 additions
and
20 deletions
bridges/primitives/test-utils/Cargo.toml
+
1
−
1
View file @
fc3a7010
...
...
@@ -12,7 +12,7 @@ bp-parachains = { path = "../parachains", default-features = false }
bp-polkadot-core
=
{
path
=
"../polkadot-core"
,
default-features
=
false
}
bp-runtime
=
{
path
=
"../runtime"
,
default-features
=
false
}
codec
=
{
package
=
"parity-scale-codec"
,
version
=
"3.1.5"
,
default-features
=
false
}
ed25519-dalek
=
{
version
=
"
1
.0"
,
default-features
=
false
,
features
=
[
"u64_backend"
]
}
ed25519-dalek
=
{
version
=
"
2
.0"
,
default-features
=
false
}
finality-grandpa
=
{
version
=
"0.16.2"
,
default-features
=
false
}
sp-application-crypto
=
{
git
=
"https://github.com/paritytech/polkadot-sdk"
,
branch
=
"master"
,
default-features
=
false
}
sp-consensus-grandpa
=
{
git
=
"https://github.com/paritytech/polkadot-sdk"
,
branch
=
"master"
,
default-features
=
false
}
...
...
This diff is collapsed.
Click to expand it.
bridges/primitives/test-utils/src/keyring.rs
+
5
−
19
View file @
fc3a7010
...
...
@@ -18,7 +18,7 @@
use
bp_header_chain
::{
justification
::
JustificationVerificationContext
,
AuthoritySet
};
use
codec
::
Encode
;
use
ed25519_dalek
::{
Keypair
,
PublicKey
,
SecretKey
,
Signature
};
use
ed25519_dalek
::{
Signature
,
SigningKey
,
VerifyingKey
};
use
finality_grandpa
::
voter_set
::
VoterSet
;
use
sp_consensus_grandpa
::{
AuthorityId
,
AuthorityList
,
AuthorityWeight
,
SetId
};
use
sp_runtime
::
RuntimeDebug
;
...
...
@@ -37,29 +37,15 @@ pub const FERDIE: Account = Account(5);
pub
struct
Account
(
pub
u16
);
impl
Account
{
pub
fn
public
(
&
self
)
->
Public
Key
{
(
&
self
.
secret
())
.into
()
pub
fn
public
(
&
self
)
->
Verifying
Key
{
self
.
pair
()
.verifying_key
()
}
pub
fn
secret
(
&
self
)
->
S
ecret
Key
{
pub
fn
pair
(
&
self
)
->
S
igning
Key
{
let
data
=
self
.0
.encode
();
let
mut
bytes
=
[
0_u8
;
32
];
bytes
[
0
..
data
.len
()]
.copy_from_slice
(
&
data
);
SecretKey
::
from_bytes
(
&
bytes
)
.expect
(
"A static array of the correct length is a known good."
)
}
pub
fn
pair
(
&
self
)
->
Keypair
{
let
mut
pair
:
[
u8
;
64
]
=
[
0
;
64
];
let
secret
=
self
.secret
();
pair
[
..
32
]
.copy_from_slice
(
&
secret
.to_bytes
());
let
public
=
self
.public
();
pair
[
32
..
]
.copy_from_slice
(
&
public
.to_bytes
());
Keypair
::
from_bytes
(
&
pair
)
.expect
(
"We expect the SecretKey to be good, so this must also be good."
)
SigningKey
::
from_bytes
(
&
bytes
)
}
pub
fn
sign
(
&
self
,
msg
:
&
[
u8
])
->
Signature
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment