bridge: always gate Terra features on the main feature flag
This commit is contained in:
parent
a77f89f646
commit
106fecca00
|
@ -347,7 +347,24 @@ func runBridge(cmd *cobra.Command, args []string) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
p := processor.NewProcessor(ctx, lockC, setC, sendC, obsvC, solanaVaaC, injectC, gk, *unsafeDevMode, *devNumGuardians, *ethRPC, *terraLCD, *terraChaidID, *terraContract, *terraFeePayer)
|
// TODO: this thing has way too many arguments at this point - make it an options struct
|
||||||
|
p := processor.NewProcessor(ctx,
|
||||||
|
lockC,
|
||||||
|
setC,
|
||||||
|
sendC,
|
||||||
|
obsvC,
|
||||||
|
solanaVaaC,
|
||||||
|
injectC,
|
||||||
|
gk,
|
||||||
|
*unsafeDevMode,
|
||||||
|
*devNumGuardians,
|
||||||
|
*ethRPC,
|
||||||
|
*terraSupport,
|
||||||
|
*terraLCD,
|
||||||
|
*terraChaidID,
|
||||||
|
*terraContract,
|
||||||
|
*terraFeePayer,
|
||||||
|
)
|
||||||
if err := supervisor.Run(ctx, "processor", p.Run); err != nil {
|
if err := supervisor.Run(ctx, "processor", p.Run); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ func (p *Processor) terraVAASubmission(ctx context.Context, signed *vaa.VAA, has
|
||||||
// - https://github.com/certusone/wormhole/issues/97
|
// - https://github.com/certusone/wormhole/issues/97
|
||||||
//
|
//
|
||||||
// Roadmap: https://github.com/certusone/wormhole/milestone/4
|
// Roadmap: https://github.com/certusone/wormhole/milestone/4
|
||||||
if !p.devnetMode || p.terraChaidID == "" {
|
if !p.devnetMode || !p.terraEnabled {
|
||||||
p.logger.Warn("ignoring terra VAA submission",
|
p.logger.Warn("ignoring terra VAA submission",
|
||||||
zap.String("digest", hash))
|
zap.String("digest", hash))
|
||||||
return
|
return
|
||||||
|
|
|
@ -62,6 +62,7 @@ type Processor struct {
|
||||||
devnetNumGuardians uint
|
devnetNumGuardians uint
|
||||||
devnetEthRPC string
|
devnetEthRPC string
|
||||||
|
|
||||||
|
terraEnabled bool
|
||||||
terraLCD string
|
terraLCD string
|
||||||
terraChaidID string
|
terraChaidID string
|
||||||
terraContract string
|
terraContract string
|
||||||
|
@ -93,6 +94,7 @@ func NewProcessor(
|
||||||
devnetMode bool,
|
devnetMode bool,
|
||||||
devnetNumGuardians uint,
|
devnetNumGuardians uint,
|
||||||
devnetEthRPC string,
|
devnetEthRPC string,
|
||||||
|
terraEnabled bool,
|
||||||
terraLCD string,
|
terraLCD string,
|
||||||
terraChaidID string,
|
terraChaidID string,
|
||||||
terraContract string,
|
terraContract string,
|
||||||
|
@ -110,6 +112,7 @@ func NewProcessor(
|
||||||
devnetNumGuardians: devnetNumGuardians,
|
devnetNumGuardians: devnetNumGuardians,
|
||||||
devnetEthRPC: devnetEthRPC,
|
devnetEthRPC: devnetEthRPC,
|
||||||
|
|
||||||
|
terraEnabled: terraEnabled,
|
||||||
terraLCD: terraLCD,
|
terraLCD: terraLCD,
|
||||||
terraChaidID: terraChaidID,
|
terraChaidID: terraChaidID,
|
||||||
terraContract: terraContract,
|
terraContract: terraContract,
|
||||||
|
@ -168,7 +171,7 @@ func (p *Processor) checkDevModeGuardianSetUpdate(ctx context.Context) error {
|
||||||
|
|
||||||
p.logger.Info("devnet guardian set change submitted to Ethereum", zap.Any("trx", trx), zap.Any("vaa", v))
|
p.logger.Info("devnet guardian set change submitted to Ethereum", zap.Any("trx", trx), zap.Any("vaa", v))
|
||||||
|
|
||||||
if p.terraChaidID != "" {
|
if p.terraEnabled {
|
||||||
// Submit to Terra
|
// Submit to Terra
|
||||||
trxResponse, err := terra.SubmitVAA(timeout, p.terraLCD, p.terraChaidID, p.terraContract, p.terraFeePayer, v)
|
trxResponse, err := terra.SubmitVAA(timeout, p.terraLCD, p.terraChaidID, p.terraContract, p.terraFeePayer, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue