Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Dec 23, 2021
1 parent ab46044 commit 3776065
Show file tree
Hide file tree
Showing 105 changed files with 119 additions and 107 deletions.
18 changes: 15 additions & 3 deletions venus-devtool/compatible/actors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ var genFilesCmd = &cli.Command{

for _, file := range files {
path := filepath.Join(srcDir, file)
pf, err := ioutil.ReadFile(path)
f, err := ioutil.ReadFile(path)
fstr := replaceComment(string(f))

if err != nil {
return xerrors.Errorf("loading template file: %s %w", path, err)
}
Expand All @@ -244,7 +246,7 @@ var genFilesCmd = &cli.Command{
if strings.HasSuffix(file, separatedGoTemplateExt) {
for _, version := range actors.Versions {
var b bytes.Buffer
tpl := template.Must(template.New("").Funcs(template.FuncMap{}).Parse(string(pf)))
tpl := template.Must(template.New("").Funcs(template.FuncMap{}).Parse(string(fstr)))

err := tpl.Execute(&b, map[string]interface{}{
"v": version,
Expand All @@ -263,7 +265,7 @@ var genFilesCmd = &cli.Command{
// generate from xxxx.go.template
tpl := template.Must(template.New("").Funcs(template.FuncMap{
"import": func(v int) string { return importPath(v) },
}).Parse(string(pf)))
}).Parse(string(fstr)))
var b bytes.Buffer

err = tpl.Execute(&b, map[string]interface{}{
Expand All @@ -282,3 +284,13 @@ var genFilesCmd = &cli.Command{
return nil
},
}

func replaceComment(s string) string {
s = strings.Replace(s, "FETCHED", "GENERATE", 1)
s = strings.Replace(s, "LOTUS", "VENUS-SHARED", 1)
s = strings.Replace(s, "state.go.template", "state.sep.go.template", 1)
s = strings.Replace(s, "state.go.template", "state.sep.go.template", 1)
s = strings.Replace(s, "message.go.template", "message.sep.go.template", 1)

return s
}
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/actor.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/account/state.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/account/state.sep.go.template

package account

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/builtin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/builtin.go.template
// GENERATE FROM VENUS-SHARED: builtin/builtin.go.template

package builtin

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/actor.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/cron/state.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/cron/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/cron/state.sep.go.template

package cron

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/actor.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/init/state.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/init/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/init/state.sep.go.template

package init

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/actor.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/market/state.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/market/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/market/state.sep.go.template

package market

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/actor.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/miner/state.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/miner/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/miner/state.sep.go.template

package miner

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/actor.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/message.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/message.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v5.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v6.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/multisig/state.v7.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/multisig/state.go.template
// GENERATE FROM VENUS-SHARED: builtin/multisig/state.sep.go.template

package multisig

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/paych/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/paych/actor.go.template
// GENERATE FROM VENUS-SHARED: builtin/paych/actor.go.template

package paych

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/paych/message.v0.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/paych/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/paych/message.sep.go.template

package paych

Expand Down
2 changes: 1 addition & 1 deletion venus-shared/actors/builtin/paych/message.v2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FETCHED FROM LOTUS: builtin/paych/message.go.template
// GENERATE FROM VENUS-SHARED: builtin/paych/message.sep.go.template

package paych

Expand Down
Loading

0 comments on commit 3776065

Please sign in to comment.