-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: register2 contract with smtReplicator, move some parameters i…
…n config file, adjust signature to be compatible with the contract
- Loading branch information
Showing
10 changed files
with
1,883 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- +migrate Up | ||
|
||
ALTER TABLE state | ||
DROP COLUMN created_at; | ||
ALTER TABLE state | ||
ADD COLUMN timestamp BIGINT NOT NULL default 0; | ||
|
||
-- +migrate Down | ||
|
||
ALTER TABLE state | ||
DROP COLUMN timestamp; | ||
ALTER TABLE state | ||
ADD COLUMN created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
"gitlab.com/distributed_lab/figure/v3" | ||
"gitlab.com/distributed_lab/kit/kv" | ||
"gitlab.com/distributed_lab/logan/v3" | ||
"gitlab.com/distributed_lab/logan/v3/errors" | ||
) | ||
|
||
const ( | ||
replicatorYamlKey = "replicator" | ||
) | ||
|
||
type Replicator struct { | ||
SourceSMT common.Address `fig:"source_smt,required"` | ||
RootPrefix string `fig:"root_prefix,required"` | ||
} | ||
|
||
func (c *config) Replicator() Replicator { | ||
return c.replicator.Do(func() interface{} { | ||
var result Replicator | ||
|
||
err := figure. | ||
Out(&result). | ||
With(figure.BaseHooks, figure.EthereumHooks). | ||
From(kv.MustGetStringMap(c.getter, replicatorYamlKey)). | ||
Please() | ||
if err != nil { | ||
panic(errors.Wrap(err, "failed to figure out config", logan.F{"key": replicatorYamlKey})) | ||
} | ||
|
||
return result | ||
}).(Replicator) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters