aergoio / aergo

aergo blockchain kernel
http://docs.aergo.io
MIT License
214 stars 44 forks source link

schema #287

Closed rabbitprincess closed 11 months ago

rabbitprincess commented 11 months ago

What is changed?

collect key prefix and key creation functions when access to db make unit tests for key creation functions.

Is there risk of fork?

yes. there are no changes, but need to sync test.

kroggen commented 11 months ago

I like the idea of using dbkey instead of schema

Here is a comparison:

data, err := scs.GetData(dbkey.Staking(account))

and

data, err := scs.GetData(schema.StakingKey(account))

It makes it clear that is is accessing a database

kroggen commented 11 months ago

Perfect! 👏

The only thing missing is to remove the genKey() function from contract/enterprise/config.go. The EnterpriseConf() function is already using bytes.ToUpper() so no need to modify it.

rabbitprincess commented 11 months ago

Perfect! 👏

good. but it need to sync test before merge.

The only thing missing is to remove the genKey() function from contract/enterprise/config.go. The EnterpriseConf() function is already using bytes.ToUpper() so no need to modify it.

but genKey() is used about validate too. i`ll check about this.

rabbitprincess commented 11 months ago

after merge, i will make additional tests about change db key ( like #200 ), and prepare to db migration.

kroggen commented 11 months ago

I resolved conflicts after the merge of #259

kroggen commented 11 months ago

@kslee8282 Please run sync test on this as well, if not done yet

kslee8282 commented 11 months ago

@kslee8282 Please run sync test on this as well, if not done yet

Oct 16 23:44:59.433 INF ../go/aergo/cmd/aergosvr/aergosvr.go:100 > AERGO SVR STARTED branch=topic/schema module=asvr revision=73b03871

2.4.9-rc3 end sync