Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 20ce0ab

Browse files
committed
Revert "option to write the plugin .go file and run the plugin migrations without building the .so file so that it can be done from the shell instead to afford complete error messages"
This reverts commit 9bb2f27.
1 parent 9bb2f27 commit 20ce0ab

File tree

8 files changed

+10
-124
lines changed

8 files changed

+10
-124
lines changed

cmd/compose.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,5 @@ func prepConfig() {
188188
FileName: viper.GetString("exporter.name"),
189189
Save: viper.GetBool("exporter.save"),
190190
Home: viper.GetString("exporter.home"),
191-
WriteOnly: viper.GetBool("exporter.writeOnly"),
192191
}
193192
}

cmd/contractWatcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ package cmd
1818

1919
import (
2020
"fmt"
21+
"github.com/vulcanize/vulcanizedb/pkg/config"
2122
"time"
2223

2324
log "github.com/sirupsen/logrus"
2425
"github.com/spf13/cobra"
2526

2627
st "github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
27-
"github.com/vulcanize/vulcanizedb/pkg/config"
2828
ft "github.com/vulcanize/vulcanizedb/pkg/contract_watcher/full/transformer"
2929
ht "github.com/vulcanize/vulcanizedb/pkg/contract_watcher/header/transformer"
3030
"github.com/vulcanize/vulcanizedb/utils"

pkg/config/contract.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
package config
1818

1919
import (
20-
"strings"
21-
2220
log "github.com/sirupsen/logrus"
2321
"github.com/spf13/viper"
24-
2522
"github.com/vulcanize/vulcanizedb/pkg/geth"
23+
"strings"
2624
)
2725

2826
// Config struct for generic contract transformer

pkg/config/plugin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ type Plugin struct {
3131
FileName string
3232
Save bool
3333
Home string
34-
WriteOnly bool
3534
}
3635

3736
type Transformer struct {

pkg/config/plugin_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717
package config_test
1818

1919
import (
20-
"os"
21-
"path/filepath"
22-
2320
. "github.com/onsi/ginkgo"
2421
. "github.com/onsi/gomega"
25-
2622
"github.com/vulcanize/vulcanizedb/pkg/config"
23+
"os"
24+
"path/filepath"
2725
)
2826

2927
var allDifferentPathsConfig = config.Plugin{

pkg/plugin/composer/composer.go

Lines changed: 0 additions & 100 deletions
This file was deleted.

pkg/plugin/generator.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ package plugin
1818

1919
import (
2020
"errors"
21-
2221
"github.com/vulcanize/vulcanizedb/pkg/config"
2322
"github.com/vulcanize/vulcanizedb/pkg/plugin/builder"
24-
"github.com/vulcanize/vulcanizedb/pkg/plugin/composer"
2523
"github.com/vulcanize/vulcanizedb/pkg/plugin/manager"
2624
"github.com/vulcanize/vulcanizedb/pkg/plugin/writer"
2725
)
@@ -42,16 +40,11 @@ func NewGenerator(gc config.Plugin, dbc config.Database) (*generator, error) {
4240
if len(gc.Transformers) < 1 {
4341
return nil, errors.New("plugin generator is not configured with any transformers")
4442
}
45-
gen := &generator{
43+
return &generator{
4644
PluginWriter: writer.NewPluginWriter(gc),
45+
PluginBuilder: builder.NewPluginBuilder(gc),
4746
MigrationManager: manager.NewMigrationManager(gc, dbc),
48-
}
49-
if gc.WriteOnly {
50-
gen.PluginBuilder = composer.NewPluginComposer(gc)
51-
} else {
52-
gen.PluginBuilder = builder.NewPluginBuilder(gc)
53-
}
54-
return gen, nil
47+
}, nil
5548
}
5649

5750
// Generates plugin for the transformer initializers specified in the generator config

pkg/plugin/manager/manager.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ import (
2020
"database/sql"
2121
"errors"
2222
"fmt"
23-
"io/ioutil"
24-
"os"
25-
"path/filepath"
26-
2723
"github.com/lib/pq"
2824
"github.com/pressly/goose"
2925
"github.com/vulcanize/vulcanizedb/pkg/config"
3026
"github.com/vulcanize/vulcanizedb/pkg/plugin/helpers"
27+
"io/ioutil"
28+
"os"
29+
"path/filepath"
3130
)
3231

3332
// Interface for managing the db migrations for plugin transformers

0 commit comments

Comments
 (0)