-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(rfq-relayer): rebalancing with multiple tokens (#3003)
* WIP: rebalance candidates * WIP: impl getRebalances() * Feat: update Rebalance() interface and execution * Feat: add TokenName to rebalance models * Feat: filter pending rebalances on token name * WIP: rebalance tests * Feat: working basic tests * Feat: more rebalance tests * Cleanup: logs * Cleanup: unused ctx * Fix: build * Cleanup: lint * Cleanup: add supportsRebalanceMethod() helper * [goreleaser] * Cleanup: lint * Cleanup: lint * [goreleaser] * Feat: cleaner initial rebalance amount calculation * Feat: add documentation for getRebalanceAmount() * Cleanup: logs * Cleanup: docs * [goreleaser] * Fix: use origin initial pct * [goreleaser] * Feat: more test cases * [goreleaser] * cleanup * [goreleaser] * Fix: set TokenName when storing rebalances * [goreleaser] * Feat: check rebalance contents in e2e test * Feat: add tracing * [goreleaser] * Feat: add tracing * [goreleaser] * Feat: approval tracing * [goreleaser] * Fix: approve gateway router for scroll rebalances * [goreleaser] * Fix: get current block from dest when checking relay confirmations * [goreleaser] * Fix: add build:go directive in package.json --------- Co-authored-by: Trajan0x <[email protected]>
- Loading branch information
Showing
14 changed files
with
673 additions
and
586 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
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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
package inventory | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/synapsecns/sanguine/services/rfq/relayer/relconfig" | ||
) | ||
|
||
// GetRebalance is a wrapper around the internal getRebalance function. | ||
func GetRebalance(cfg relconfig.Config, tokens map[int]map[common.Address]*TokenMetadata, chainID int, token common.Address) (*RebalanceData, error) { | ||
return getRebalance(nil, cfg, tokens, chainID, token) | ||
} | ||
|
||
// GetRebalanceMetadatas is a wrapper around the internal getRebalanceMetadatas function. | ||
func GetRebalanceMetadatas(cfg relconfig.Config, tokens map[int]map[common.Address]*TokenMetadata, tokenName string, methods []relconfig.RebalanceMethod) (originTokenData, destTokenData *TokenMetadata, method relconfig.RebalanceMethod) { | ||
return getRebalanceMetadatas(cfg, tokens, tokenName, methods) | ||
func GetRebalances(ctx context.Context, cfg relconfig.Config, inv map[int]map[common.Address]*TokenMetadata) (rebalances map[string]*RebalanceData, err error) { | ||
return getRebalances(ctx, cfg, inv) | ||
} |
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.