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

Commit

Permalink
Revert "option to write the plugin .go file and run the plugin migrat…
Browse files Browse the repository at this point in the history
…ions without building the .so file so that it can be done from the shell instead to afford complete error messages"

This reverts commit 9bb2f27.
  • Loading branch information
grizz committed Sep 24, 2019
1 parent 9bb2f27 commit 20ce0ab
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 124 deletions.
1 change: 0 additions & 1 deletion cmd/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,5 @@ func prepConfig() {
FileName: viper.GetString("exporter.name"),
Save: viper.GetBool("exporter.save"),
Home: viper.GetString("exporter.home"),
WriteOnly: viper.GetBool("exporter.writeOnly"),
}
}
2 changes: 1 addition & 1 deletion cmd/contractWatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ package cmd

import (
"fmt"
"github.com/vulcanize/vulcanizedb/pkg/config"
"time"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

st "github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
"github.com/vulcanize/vulcanizedb/pkg/config"
ft "github.com/vulcanize/vulcanizedb/pkg/contract_watcher/full/transformer"
ht "github.com/vulcanize/vulcanizedb/pkg/contract_watcher/header/transformer"
"github.com/vulcanize/vulcanizedb/utils"
Expand Down
4 changes: 1 addition & 3 deletions pkg/config/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
package config

import (
"strings"

log "github.com/sirupsen/logrus"
"github.com/spf13/viper"

"github.com/vulcanize/vulcanizedb/pkg/geth"
"strings"
)

// Config struct for generic contract transformer
Expand Down
1 change: 0 additions & 1 deletion pkg/config/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Plugin struct {
FileName string
Save bool
Home string
WriteOnly bool
}

type Transformer struct {
Expand Down
6 changes: 2 additions & 4 deletions pkg/config/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
package config_test

import (
"os"
"path/filepath"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/vulcanize/vulcanizedb/pkg/config"
"os"
"path/filepath"
)

var allDifferentPathsConfig = config.Plugin{
Expand Down
100 changes: 0 additions & 100 deletions pkg/plugin/composer/composer.go

This file was deleted.

13 changes: 3 additions & 10 deletions pkg/plugin/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ package plugin

import (
"errors"

"github.com/vulcanize/vulcanizedb/pkg/config"
"github.com/vulcanize/vulcanizedb/pkg/plugin/builder"
"github.com/vulcanize/vulcanizedb/pkg/plugin/composer"
"github.com/vulcanize/vulcanizedb/pkg/plugin/manager"
"github.com/vulcanize/vulcanizedb/pkg/plugin/writer"
)
Expand All @@ -42,16 +40,11 @@ func NewGenerator(gc config.Plugin, dbc config.Database) (*generator, error) {
if len(gc.Transformers) < 1 {
return nil, errors.New("plugin generator is not configured with any transformers")
}
gen := &generator{
return &generator{
PluginWriter: writer.NewPluginWriter(gc),
PluginBuilder: builder.NewPluginBuilder(gc),
MigrationManager: manager.NewMigrationManager(gc, dbc),
}
if gc.WriteOnly {
gen.PluginBuilder = composer.NewPluginComposer(gc)
} else {
gen.PluginBuilder = builder.NewPluginBuilder(gc)
}
return gen, nil
}, nil
}

// Generates plugin for the transformer initializers specified in the generator config
Expand Down
7 changes: 3 additions & 4 deletions pkg/plugin/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ import (
"database/sql"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"

"github.com/lib/pq"
"github.com/pressly/goose"
"github.com/vulcanize/vulcanizedb/pkg/config"
"github.com/vulcanize/vulcanizedb/pkg/plugin/helpers"
"io/ioutil"
"os"
"path/filepath"
)

// Interface for managing the db migrations for plugin transformers
Expand Down

0 comments on commit 20ce0ab

Please sign in to comment.