-
Notifications
You must be signed in to change notification settings - Fork 686
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
Unable to use function InMemorySigner::from_file (field names mismatch) #7030
Comments
It’s not clear to me what credential file you’re referring to. nearcore uses |
@mina86 , I mean this file: |
mina86
added a commit
to mina86/nearcore
that referenced
this issue
Jun 14, 2022
To make it easier to use credential files that near cli tool works with, introduce ‘private_key’ alias for the ‘secret_key’ field in KeyFile struct. This way, the JSON file can have either of those fields set and it’ll be read correctly. Fixes: near#7030
mina86
added a commit
to mina86/nearcore
that referenced
this issue
Jun 14, 2022
To make it easier to use credential files that near cli tool works with, introduce ‘private_key’ alias for the ‘secret_key’ field in KeyFile struct. This way, the JSON file can have either of those fields set and it’ll be read correctly. Fixes: near#7030
near-bulldozer bot
pushed a commit
that referenced
this issue
Jun 14, 2022
To make it easier to use credential files that near cli tool works with, introduce ‘private_key’ alias for the ‘secret_key’ field in KeyFile struct. This way, the JSON file can have either of those fields set and it’ll be read correctly. Fixes: #7030
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Problem:
Unable to use function
InMemorySigner::from_file
, because field names are different instruct InMemorySigner
and in credentials file.In struct we got field
secret_key
, but in credentials file we gotprivate_key
. FunctionInMemorySigner::from_file
uses serde's deserializer, so, when we try to deserializestruct InMemorySigner
, serde's deserializer doesn't find a match for the field and deserialization fails.Solution 1:
Rename
struct InMemorySigner
fieldsecret_key
toprivate_key
.Solution 2:
Rename credentials' field
private_key
tosecret_key
.Problem crate:
near-crypto
Problem file:
src/signer.rs
Versions:
The text was updated successfully, but these errors were encountered: