onflow / onflow/flowkit

[BUG] file based key panics

Open
#81 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
8
Forks
11
Avg merge
5d 59m
Merged PRs (30d)
1

Description

Current Behavior

When i have a flow.json with a file based key this code panics

//accounts here is accounts.Accounts that is gotten from flowkit.State
	for _, account := range acct {
	  account.Key.ToConfig().PrivateKey.PublicKey(),
        }

see source here https://github.com/bjartek/overflow/blob/a97abbd88656a7910be110e3a8226a80afcdf582/state.go#L446

Expected Behavior

I expect to get the public key, the key need here though is to just create a new user using the key that is provided in flow.json. Maybe a method to return a accounts.PublicKey from an account.Accounts would be better?

Steps To Reproduce
  1. create a flow.json with a file based key
  2. use https://github.com/bjartek/aether
Environment
- OS: mac
What are you currently working on that this is blocking?

Aether

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at state.go line 446 and reproduce the panic with a flow.json containing a file-based key, using aether as described. Trace how flowkit.State provides accounts.Accounts and how the key is converted, then verify that the file-based key no longer panics and supports retrieving the public key for the stated use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cryptography
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.