Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • T transactionCC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • smartcontracts
  • transactionCC
  • Issues
  • #8

Closed
Open
Created Dec 02, 2017 by Ghost User@ghost

Проверить необходимость сохранения ключей криптовалюты в чейнкоде транзакции

Сейчас в функции загрузки криптовалют LoadCryptocurrency осуществляется подгрузка последних ипортированных ключей

	// получить последние импортированные ключи
	lastLoadKeys, err := txnMngr.getLastLoadKeys(adapter)
	if err != nil {
		errMsg := fmt.Sprintf("Invalid CryptocurrencyListInput input format, failed due to %s", err)
		logger.Error(errMsg)
		return nil, errors.New(errMsg)
	}

в то время как эта информация в последствии совсем не используется, т.е.

	var importCryptocurrencyResult ImportCryptocurrencyResult
	for _, cryptocurrencyStore := range cryptocurrencyStoreOutput.CryptocurrencyStore {

		err = txnMngr.depositFundsTransaction(cryptocurrencyStore, adapter)
		if err != nil {
			// Update results with an error record
			importCryptocurrencyResult.CryptocurrencyResultArray = append(importCryptocurrencyResult.CryptocurrencyResultArray, CryptocurrencyResult{
				TransactionID: cryptocurrencyStore.TransactionID,
				Status:        "ERROR",
				CommonMessage: "Can't save transaction",
				DetailMessage: err.Error(),
			})
			continue
		}
		// We succeeded to put funds on user deposits we should update
		txnMngr.Add(lastLoadKeys.MapCurrencyTypeKeys, cryptocurrencyStore.CurrencyType, cryptocurrencyStore.TransactionID)

		importCryptocurrencyResult.CryptocurrencyResultArray = append(importCryptocurrencyResult.CryptocurrencyResultArray, CryptocurrencyResult{
			TransactionID: cryptocurrencyStore.TransactionID,
			Status:        "OK",
		})
	}

	// запись последних импортированных ключейн
	err = txnMngr.SaveLastLoadKeys(lastLoadKeys, adapter)
	if err != nil {
		return nil, err
	}
Assignee
Assign to
Time tracking