Skip to content

Commit

Permalink
Small naming change
Browse files Browse the repository at this point in the history
  • Loading branch information
xssnick committed Apr 12, 2024
1 parent da6daab commit e811555
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ton/wallet/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

const DefaultSubwallet = 698983191

func AddressFromPubKey(key ed25519.PublicKey, spec VersionConfig, subwallet uint32) (*address.Address, error) {
state, err := GetStateInit(key, spec, subwallet)
func AddressFromPubKey(key ed25519.PublicKey, version VersionConfig, subwallet uint32) (*address.Address, error) {
state, err := GetStateInit(key, version, subwallet)
if err != nil {
return nil, fmt.Errorf("failed to get state: %w", err)
}
Expand Down Expand Up @@ -47,9 +47,9 @@ func GetWalletVersion(account *tlb.Account) Version {
return Unknown
}

func GetStateInit(pubKey ed25519.PublicKey, spec VersionConfig, subWallet uint32) (*tlb.StateInit, error) {
func GetStateInit(pubKey ed25519.PublicKey, version VersionConfig, subWallet uint32) (*tlb.StateInit, error) {
var ver Version
switch v := spec.(type) {
switch v := version.(type) {
case Version:
ver = v
switch ver {
Expand Down
8 changes: 4 additions & 4 deletions ton/wallet/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ func NewSeedWithPassword(password string) []string {

type VersionConfig any

func FromSeed(api TonAPI, seed []string, spec VersionConfig) (*Wallet, error) {
return FromSeedWithPassword(api, seed, "", spec)
func FromSeed(api TonAPI, seed []string, version VersionConfig) (*Wallet, error) {
return FromSeedWithPassword(api, seed, "", version)
}

func FromSeedWithPassword(api TonAPI, seed []string, password string, spec VersionConfig) (*Wallet, error) {
func FromSeedWithPassword(api TonAPI, seed []string, password string, version VersionConfig) (*Wallet, error) {
// validate seed
if len(seed) < 12 {
return nil, fmt.Errorf("seed should have at least 12 words")
Expand Down Expand Up @@ -94,7 +94,7 @@ func FromSeedWithPassword(api TonAPI, seed []string, password string, spec Versi

k := pbkdf2.Key(hash, []byte(_Salt), _Iterations, 32, sha512.New)

return FromPrivateKey(api, ed25519.NewKeyFromSeed(k), spec)
return FromPrivateKey(api, ed25519.NewKeyFromSeed(k), version)
}

var wordsArr = func() []string {
Expand Down

0 comments on commit e811555

Please sign in to comment.