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

Address book #265

Merged
merged 84 commits into from
Dec 21, 2019
Merged

Conversation

hsequeda
Copy link
Collaborator

@hsequeda hsequeda commented Dec 4, 2019

Fixes #152

Changes:
-Map (Address,coinName).
-Added data package.
-Testing AddressBook methods.
-Added AddressBook into Ui.
-Added selection from AddressBook in Transactions.
-Rejected invalid address.
-Added security type selection.

Does this change need to mentioned in CHANGELOG.md?
yes

Requires testing
Requires testing
yes

Comments about testing , should you have some

… interaction with the database. The dbWrite and bRead method was created. The dbWrite and bRead test was created.
… / contact.proto, internal / config.proto, Makefile and contact.go files to the data directory. Added to .gitignore *.pb.go filetype.

Addressbook.go contains funcs: struct AddressBook{db *db.bolt.DB, dbPath string ,hasPassword bool, hash, entropy []byte}, -InsertContact, -DeleteConstact , -OpenDb ,-ListContacts, -MarshalBinaryConfig, -UnmarshalBinaryConfig, -generateHash, -verifyHash, -CloseDb, -GetConfig, -GenerateMnemonic.
Contact.go contains funcs: structContact{ID uint64, Name []byte, Address []Address}, struct Address{value,coin []byte} -MarshalBinary, -UnmarshalBinary, -encryptContact, -decryptContact, -derivePassphrase.
data_test contains tests: -TestAddressBook_generateHash, -TestAddressBook_Insert, -TestContact_MarshalBinary, -TestAddressBook_MarshalBinary, -TestAddressBook_List.
… created in src / core / storage.go. The addressBook type was changed to unexportable in addressbook.go. The global variable dbConfigDataKey was deleted. Modified the verifyHash function. Added the GetAddressBook, New, GetPath, SetPath and GetHashFromConfig functions to the addressBook type. Modified the functions Insert, Get, Delete, List of type addressBook to implement the core.AddressBook interface. Modified functions of type data.Contact to implement the core.Contact interface. Added the GetID and SetID functions to the data.Contact type. Removed the TestAddressBook_generateHash and TestAddressBook_MarshalBinary tests. Added the auxiliary function GetFilePath to generate temporary files for the tests. Modified the auxiliary function OpenAddrsBook to initialize an addressBook for each test.
… core/storage.go. Removed Encrypt and Decrypt methods of Contact interface in core/storage.go. Added no-repeat address verification to InsertContact func in data/addressbook.go. Added Encrypt and Decrypt func to addressbook. Added SearchAddress method to addressbook. Added GetAddress and SetAddress to Contact in data/contact.go. Added GetValue,GetCoinType, SetValue and SetCoinType to Address type in data/contact. Created datautils.go file in data directory.
…k interface in core/storege.go. Added doc to functions in data/addressbook.go. Rename type addressBook to AddressBookWithBolt in addressbook.go. Removed GetAddressBook func. Rename function New to Init in data/addressbook.go. Modified return errValEmpty when id is not found in DeleteContact func. Auto-generated test to data/. Created TestContact_MarshalBinary, TestContact_UnmarshalBinary and Test_addressBook_DeleteContact. Added Test_addressBook_GetContact test to data/test_data.go. Fixed error in decryptAESGCM.
…tact, Test_addressBook_ListContact test in data/data_test.go.
…adableAddress interfaces in core/storage.go. Added errParseContact in data/addressbook.go. Rename AddressBook type to DB in data/addressbook.go. Added key and hasPassword property to DB in data/addressbook.go. Remove password param from InsertContact, ListContact, GetContact and UpdateContact in data/addressbook.go. Created UpdateContact in data/addressbook.go. Created TestDB_UpdateContact test in data/data_test. Edited GetAddress and SetAddress functions of data.Address type. Removed GetAddressLen function of data.Address type. Added itob and btoi functions to data/datautils.go.
…rty of DB type. Modified verifiyHash and Open functions. Created LoadFromFile function.
…ontact functions return error if a contact's name is repeated. Created NameExists function. Modify AddressExists function. Added testcases of name-repeat to TestDB_InsertContact and TestDB_UpdateContact.
…s to core.Contact interface and data.Contact type. Created addressBook/addressbook.go into models folder. Created AddressBook.qml in ui folder. Added component addressBook into Tools menu in the UI.
…Dialogs. Create addressbook.go in models/addressBook. Created data, removeContact, addContact, editContact, loadContact, newContact slots to models/addressbook/addressbook.go .Added roles, contacts, count property to models/addressBook/addressbook.go. Implemented add contact to in ui/addressbook.qml.
…data/addressbook so that if the password is not valid closing database. Added openAddrsBook, initAddrsBook and exist slot to models/addressbook/addressbook.go. Added close, exist, initAddrsBook, openAddrsBook functions to models/addressbook/addressbook.go. Added Connections between qml and model functions into init(constructor) function. Modified address book interface structure. Added password authentication to addressBook UI.
…cts testcase of Test_addressBook_ListContact test. Created ContactDelegate.qml and SectionDelegate.qml in ui/Delegates/. Added delegates SectionDelegate and ContactDelegate implementation to AddressBook.qml.
….go file. models/addressbook/addressbook.go renamed to contact.go. QAddress type moved to models/addressbook/address.go. Created AddrsBkAddressModel struct in models/addressbook/address.go. Created init, rowCount, roleNames, data, FromAddressToQAddress function in models/addressbook/address.go. Created ui/Dialogs/DialogShowContact.qml file. Created a ScrollView with addresses list for each contact in DialogShowContact.qml. Removed header from AddressBook page.
…unction in data/addressbook.go. Added sort function to fromAddressToQAddress function in models/addressBook/address.go for sort all address by coin type. Added sort function to addContact function in models/addressBook/contact.go for sort all contact by contact name. Implemented addAddress function to models/addressBook/contact.go to add many address for each contact. Create AddressListDelegate in ui/Delegates. Implemented interface to add many address in ui/Delegates/AddressListDelegate.qml. Added user-standard image to ui/Delegates/ContactDelegate.qml. Change SectionDelegate UI in ui/Delegates/SectionDelegate.qml. Modified DialogAddContact for add many address for each contact in ui/Dialogs/DialogAddContact.qml. Modified DialogShowContact to show many address for each contact in ui/Dialogs/DialogShowContact.qml. Change dimension of DialogAddContact in ui/AddressBook.qml. Change from "+" to "Add Contact" text of button to add contact.
…sBook.Init implementation. Added make -C src/data/ regenerate to Makefile to generate internal package data files. Added data package test to Makefile.
…rror to return uint64,error in core/storage.go. Added menu to select between View, Edit and remove a contact. Implement removeContact in models/addressBook/contacts.go.
…e in SetPassword and getPassword dialogs in AddressBook.qml file.
…queda_t152_AddressBook

# Conflicts:
#	.gitignore
…ss_verify' into stdevHsequeda_t152_AddressBook
…y in test-data. Added creation of /temp directory to GetFilePath in data_test.go file in data package.
…ss_verify' into stdevHsequeda_t152_AddressBook
…in data package case to test addressbook.Exist method.
…queda_t152_AddressBook

# Conflicts:
#	Makefile
#	src/coin/skycoin/models/wallet.go
#	src/coin/skycoin/models/wallet_test.go
#	src/core/main.go
#	src/core/storage.go
#	src/util/util.go
…152_AddressBook

# Conflicts:
#	src/coin/skycoin/models/wallet_test.go
#	src/util/util.go
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/data/addressbook.go Outdated Show resolved Hide resolved
src/ui/AddressBook.qml Show resolved Hide resolved
hsequeda and others added 14 commits December 10, 2019 17:54
…to "+" in AddressBook.qml. Hide Address book menubar button when address book is the current page.
… secType consts from Type1, Type2, Type3 to NoSecurity, ObfuscationSecurity and PasswordSecurity. Fixed grammatical error in errParseContact. Removed errorWrapper. Created Hash, Entropy and SecurityType const.
…DB to addrBook and dataBase in data package. Created dbLog in data package.
…packege. Added InsertValue, GetValue, ListValue, DeleteValue, UpdateValue, Path, GetConfig, InsertConfig and Close function to Storage interface. Added GetStorage function to AddressBook interface. Added IsValid function to Contact and StringAddress interfaces.
…ackage. Created boltStorage type implementing Storage interface. Implementing InsertValue, GetValue, ListValue, DeleteValue, UpdateValue, Path, GetConfig, InsertConfig and Close function in type boltStorage. Created errValueNoMatch function to handle matching type error. Implementing IsValue method in Contact and Address type. Removed db parameter from dataBase type. Renamed dataBase type to addrsBook. Reimplementing NewAddressBook function. Reimplementing Authenticate, InsertContact, GetContact, ListContact, DeleteContact, UpdateContact, HasInit, IsOpen, GetSecType, getEntropyFromConfig, getHashFromConfig, verifyHash, insertConfig, encryptAESGCM and decryptAESGCM function of addrsBook type. Reimplemented all test for data package.
…kModel in /models/addressbook/contacts.go.
…ressBook interface. Implemented ChangeSecurity method of addrsBook type in data package. Fixed error in addressExist method of addrsBook type in data package. Created Test_addrsBook_ChangeSecurity test in data_test.go in data package. Implemented ChangeSecType method in addressBook models and UI.
…age in addressbook.go file. Updated documentation of methods. Created errDatabaseNotOpen error in database.go file.
…queda_t152_AddressBook

# Conflicts:
#	Makefile
…nterface. Removed error return from GetSecType method of AddressBook interface. Changed to unexported Hash, Entropy and SecurityType constants in data package. Removed errParseContact from data package. Modified ChangeSecurity,Init, Authenticate, InsertContact, GetContact, ListContact, UpdataContact and GetSecType method of addrsBook type in data package. Removed encryptContact, decryptContact, encryptAESGCM, decryptAESGCM, genEntropy, addressExist, NameExist and verifyHash methods from addrsBook type in data package. Added validateContact method to addrsBook type in data package. Removed MarshalBinary and UnmarshalBinary methods from Contact type in data package. Implemented Encrypt and Decrypt methods of Contact interface in Contact type in data package. Changed boltStorage to exportable in data package. Created dataUtil.go file in data package. Added isRepeatAddress, isRepeatName, genEntropy, encryptAESGCM and decryptAESGCM function to dataUtil.go file in data package. Made more readable the functions in addressBook models and ui.
… Created TestBoltStorage_InsertValue, TestBoltStorage_GetValue, TestBoltStorage_ListValue, TestBoltStorage_DeleteValue, TestBoltStorage_UpdateValue test in database_test.go.
…, SetName and GetName method of Contact type in TestDB_UpdateContact test id data package.
.gitignore Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@stdevMac stdevMac merged commit 86f2d7d into fibercrypto:develop Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address book
2 participants