Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
CR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jelacamarko committed Aug 31, 2023
1 parent e12ee06 commit 1703974
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions command/bridge/common/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ func (bp *ERC1155BridgeParams) Validate() error {
return nil
}

// ExtractExitEventID tries to extract exit event id from provided receipt
func ExtractExitEventID(receipt *ethgo.Receipt) ([]*big.Int, error) {
var exitEvent contractsapi.L2StateSyncedEvent

// ExtractExitEventIDs tries to extract all exit event ids from provided receipt
func ExtractExitEventIDs(receipt *ethgo.Receipt) ([]*big.Int, error) {
exitEventIDs := make([]*big.Int, 0, len(receipt.Logs))

for _, log := range receipt.Logs {
var exitEvent contractsapi.L2StateSyncedEvent

doesMatch, err := exitEvent.ParseLog(log)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion command/bridge/deposit/erc1155/deposit_erc1155.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func runCommand(cmd *cobra.Command, _ []string) {
}

if dp.ChildChainMintable {
exitEventIDs, err := common.ExtractExitEventID(receipt)
exitEventIDs, err := common.ExtractExitEventIDs(receipt)
if err != nil {
outputter.SetError(fmt.Errorf("failed to extract exit event: %w", err))

Expand Down
2 changes: 1 addition & 1 deletion command/bridge/deposit/erc20/deposit_erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func runCommand(cmd *cobra.Command, _ []string) {
var exitEventIDs []*big.Int

if dp.ChildChainMintable {
if exitEventIDs, err = common.ExtractExitEventID(receipt); err != nil {
if exitEventIDs, err = common.ExtractExitEventIDs(receipt); err != nil {
return fmt.Errorf("failed to extract exit event: %w", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion command/bridge/deposit/erc721/deposit_erc721.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func runCommand(cmd *cobra.Command, _ []string) {
}

if dp.ChildChainMintable {
exitEventIDs, err := common.ExtractExitEventID(receipt)
exitEventIDs, err := common.ExtractExitEventIDs(receipt)
if err != nil {
outputter.SetError(fmt.Errorf("failed to extract exit event: %w", err))

Expand Down
2 changes: 1 addition & 1 deletion command/bridge/withdraw/erc1155/withdraw_erc1155.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func runCommand(cmd *cobra.Command, _ []string) {
}

if !wp.ChildChainMintable {
exitEventIDs, err := common.ExtractExitEventID(receipt)
exitEventIDs, err := common.ExtractExitEventIDs(receipt)
if err != nil {
outputter.SetError(fmt.Errorf("failed to extract exit event: %w", err))

Expand Down
2 changes: 1 addition & 1 deletion command/bridge/withdraw/erc20/withdraw_erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func runCommand(cmd *cobra.Command, _ []string) {
}

if !wp.ChildChainMintable {
extractedExitEventIDs, err := common.ExtractExitEventID(receipt)
extractedExitEventIDs, err := common.ExtractExitEventIDs(receipt)
if err != nil {
outputter.SetError(fmt.Errorf("failed to extract exit event: %w", err))

Expand Down
2 changes: 1 addition & 1 deletion command/bridge/withdraw/erc721/withdraw_erc721.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func run(cmd *cobra.Command, _ []string) {
}

if !wp.ChildChainMintable {
exitEventIDs, err := common.ExtractExitEventID(receipt)
exitEventIDs, err := common.ExtractExitEventIDs(receipt)
if err != nil {
outputter.SetError(fmt.Errorf("failed to extract exit event: %w", err))

Expand Down
2 changes: 1 addition & 1 deletion command/sidechain/withdraw/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("could not find an appropriate log in receipt that withdraw happened on ValidatorSet")
}

exitEventIDs, err := common.ExtractExitEventID(receipt)
exitEventIDs, err := common.ExtractExitEventIDs(receipt)
if err != nil {
return fmt.Errorf("withdrawal failed: %w", err)
}
Expand Down

0 comments on commit 1703974

Please sign in to comment.