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

Method compileChanges

blockproducer/metastate.go:1224–1250  ·  view source on GitHub ↗

compileChanges compiles storage procedures for changes in dirty map.

(
	dst []storageProcedure)

Source from the content-addressed store, hash-verified

1222
1223// compileChanges compiles storage procedures for changes in dirty map.
1224func (s *metaState) compileChanges(
1225 dst []storageProcedure) (results []storageProcedure,
1226) {
1227 results = dst
1228 for k, v := range s.dirty.accounts {
1229 if v != nil {
1230 results = append(results, updateAccount(v))
1231 } else {
1232 results = append(results, deleteAccount(k))
1233 }
1234 }
1235 for k, v := range s.dirty.databases {
1236 if v != nil {
1237 results = append(results, updateShardChain(v))
1238 } else {
1239 results = append(results, deleteShardChain(k))
1240 }
1241 }
1242 for k, v := range s.dirty.provider {
1243 if v != nil {
1244 results = append(results, updateProvider(v))
1245 } else {
1246 results = append(results, deleteProvider(k))
1247 }
1248 }
1249 return
1250}
1251
1252func minDeposit(gasPrice uint64, minerNumber uint64) uint64 {
1253 return gasPrice * uint64(conf.GConf.QPS) *

Callers 3

TestChainFunction · 0.80
NewChainWithContextFunction · 0.80

Calls 6

updateAccountFunction · 0.85
deleteAccountFunction · 0.85
updateShardChainFunction · 0.85
deleteShardChainFunction · 0.85
updateProviderFunction · 0.85
deleteProviderFunction · 0.85

Tested by 1

TestChainFunction · 0.64