MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / FromAccountAndNonce

Function FromAccountAndNonce

proto/proto.go:180–184  ·  view source on GitHub ↗

FromAccountAndNonce generates databaseID from Account and its nonce.

(accountAddress AccountAddress, nonce uint32)

Source from the content-addressed store, hash-verified

178
179// FromAccountAndNonce generates databaseID from Account and its nonce.
180func FromAccountAndNonce(accountAddress AccountAddress, nonce uint32) DatabaseID {
181 addrAndNonce := fmt.Sprintf("%s%d", accountAddress.String(), nonce)
182 rawID := hash.THashH([]byte(addrAndNonce))
183 return DatabaseID(rawID.String())
184}

Callers 8

TestMetaStateFunction · 0.92
CreateFunction · 0.92
TestCreateFunction · 0.92
CreateFunction · 0.92
createDatabaseMethod · 0.92
createDatabaseFunction · 0.92
TestFromAccountAndNonceFunction · 0.85

Calls 3

THashHFunction · 0.92
DatabaseIDTypeAlias · 0.85
StringMethod · 0.45

Tested by 3

TestMetaStateFunction · 0.74
TestCreateFunction · 0.74
TestFromAccountAndNonceFunction · 0.68