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

new starter file format #114

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/icons8-wallet-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/images/icons8-wallet-100.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://ur4flpu4avin"
path="res://.godot/imported/icons8-wallet-100.png-f1451533ce8867fe9dac141a0838dbe6.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/icons8-wallet-100.png"
dest_files=["res://.godot/imported/icons8-wallet-100.png-f1451533ce8867fe9dac141a0838dbe6.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added assets/images/wallet-check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/images/wallet-check.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://idhpbwi2nf2o"
path="res://.godot/imported/wallet-check.png-73faf5f04c852000fbd6f5b45366f1b4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/wallet-check.png"
dest_files=["res://.godot/imported/wallet-check.png-73faf5f04c852000fbd6f5b45366f1b4.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
4 changes: 4 additions & 0 deletions entropy_theme.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[gd_resource type="Theme" format=3 uid="uid://ddwjiywfvqp62"]

[resource]
LineEdit/colors/font_placeholder_color = Color(1, 0.427451, 0, 1)
Binary file added resource/theme/bin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions resource/theme/bin.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bxg5warvc0q60"
path="res://.godot/imported/bin.png-8e6fb9dd765b426d1ed0ed2a988104b3.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://resource/theme/bin.png"
dest_files=["res://.godot/imported/bin.png-8e6fb9dd765b426d1ed0ed2a988104b3.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
35 changes: 19 additions & 16 deletions source/application/wallet_creator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -942,27 +942,30 @@ func get_sidechain_info():
return sidechain_info

func save_sidechain_info(sidechain_data):
var user_data_dir = OS.get_user_data_dir()
var wallet_starters_dir = user_data_dir.path_join("wallet_starters")

# Save master seed file
var master_seed_file = FileAccess.open(wallet_starters_dir.path_join("wallet_master_seed.txt"), FileAccess.WRITE)
if master_seed_file:
# Assuming sidechain_data["mainchain"] contains all necessary information
master_seed_file.store_string(JSON.stringify(sidechain_data["mainchain"]))
master_seed_file.close()
else:
print("Failed to save master seed file")

# Save mainchain and sidechain files with only the mnemonic phrases
for key in sidechain_data.keys():
if key.begins_with("sidechain_"):
var slot = key.split("_")[1]
var user_data_dir = OS.get_user_data_dir()
var filename = user_data_dir.path_join("wallet_starters/sidechain_%s_starter.txt" % slot)
if key.begins_with("sidechain_") or key == "mainchain":
var filename = wallet_starters_dir.path_join(key + "_starter.txt")
var file = FileAccess.open(filename, FileAccess.WRITE)
if file:
file.store_string(JSON.stringify(sidechain_data[key]))
# Save only the mnemonic phrase as plain text
file.store_string(sidechain_data[key]["mnemonic"])
file.close()
else:
print("Failed to save sidechain starter information for slot ", slot)
elif key.begins_with("mainchain"):
var user_data_dir = OS.get_user_data_dir()
var filename = user_data_dir.path_join("wallet_starters/mainchain_starter.txt")
var file = FileAccess.open(filename, FileAccess.WRITE)
if file:
file.store_string(JSON.stringify(sidechain_data[key]))
file.close()
else:
print("Failed to save sidechain starter information for mainchain")

print("Failed to save starter information for ", key)

func reset_wallet_tab():
clear_all_output()
entropy_in.text = ""
Expand Down
Loading