Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
backsapc committed Oct 22, 2024
1 parent ca0f958 commit db9f141
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions keychain-sdk/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (a *App) ConnectionState() map[string]connectivity.State {
}

func (a *App) initConnections() error {
initConnection := func(logger *slog.Logger, grpcNodeConfig GrpcNodeConfig, config BasicConfig) (*AppClient, error) {
initConnection := func(logger *slog.Logger, grpcNodeConfig GrpcNodeConfig, config BasicConfig, identity client.Identity) (*AppClient, error) {
appClient := &AppClient{
batchSize: config.BatchSize,
keychainId: config.KeychainID,
Expand All @@ -155,20 +155,20 @@ func (a *App) initConnections() error {

conn := query.Conn()

identity, err := client.NewIdentityFromSeed(a.config.Mnemonic)
if err != nil {
return nil, fmt.Errorf("failed to create identity: %w", err)
}

logger.Info("keychain writer identity", "address", identity.Address.String())

appClient.txClient = client.NewTxClient(identity, config.ChainID, conn, query)

return appClient, nil
}

identity, err := client.NewIdentityFromSeed(a.config.Mnemonic)
if err != nil {
return fmt.Errorf("failed to create identity: %w", err)
}

for _, grpcUrl := range a.config.GRPCConfigs {
appClient, err := initConnection(a.logger(), grpcUrl, a.config.BasicConfig)
appClient, err := initConnection(a.logger(), grpcUrl, a.config.BasicConfig, identity)
if err != nil {
return err
}
Expand Down

0 comments on commit db9f141

Please sign in to comment.