-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb28335
commit e1bcf3a
Showing
10 changed files
with
5,439 additions
and
58 deletions.
There are no files selected for viewing
5,012 changes: 5,012 additions & 0 deletions
5,012
core/gethwrappers/dual-transmission/dual_aggregator.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package actions | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
|
||
"github.com/smartcontractkit/chainlink-testing-framework/seth" | ||
"github.com/smartcontractkit/chainlink/integration-tests/contracts" | ||
gethwrappers "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/dual-transmission" | ||
) | ||
|
||
type Input struct { | ||
URL string `toml:"url"` | ||
Out *Output `toml:"out"` | ||
} | ||
|
||
type Output struct { | ||
UseCache bool `toml:"use_cache"` | ||
Addresses []common.Address `toml:"addresses"` | ||
} | ||
|
||
func NewDualAggregatorDeployment(c *seth.Client, in *Input, linkContractAddress string, offchainOptions contracts.OffchainOptions) (*Output, error) { | ||
if in.Out != nil && in.Out.UseCache { | ||
return in.Out, nil | ||
} | ||
abi, err := gethwrappers.DualAggregatorMetaData.GetAbi() | ||
if err != nil { | ||
return nil, err | ||
} | ||
dd, err := c.DeployContract(c.NewTXOpts(), | ||
"DualAggregator", | ||
*abi, | ||
common.FromHex(gethwrappers.DualAggregatorMetaData.Bin), | ||
common.HexToAddress(linkContractAddress), | ||
offchainOptions.MinimumAnswer, | ||
offchainOptions.MaximumAnswer, | ||
offchainOptions.BillingAccessController, // billingAccessController | ||
offchainOptions.RequesterAccessController, // requesterAccessController | ||
offchainOptions.Decimals, | ||
offchainOptions.Description, | ||
"0x0000000000000000000000000000000000000000", // secondary proxy | ||
30, // cutOffTime | ||
20, // maxSyncIterations | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
out := &Output{ | ||
UseCache: true, | ||
// save all the addresses to output, so it can be cached | ||
Addresses: []common.Address{dd.Address}, | ||
} | ||
in.Out = out | ||
return out, nil | ||
} |
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
Oops, something went wrong.