-
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.
Merge pull request #14 from nervina-labs/script_id_and_tx_hash
Add lock_script_id and tx_hash
- Loading branch information
Showing
24 changed files
with
487 additions
and
189 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ | |
.idea/ | ||
storage/ | ||
bin/ | ||
test/ | ||
test/ | ||
.vscode/ |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package biz | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/nervina-labs/cota-nft-entries-syncer/internal/logger" | ||
) | ||
|
||
type WithdrawQueryInfo struct { | ||
BlockNumber uint64 | ||
OutPoint string | ||
LockHash string | ||
} | ||
|
||
type WithdrawExtraInfoRepo interface { | ||
CreateExtraInfo(ctx context.Context, outPoint string, txHash string, lockScriptId uint) error | ||
FindQueryInfos(ctx context.Context, page int, pageSize int) ([]WithdrawQueryInfo, error) | ||
FindOrCreateScript(ctx context.Context, script *Script) error | ||
} | ||
|
||
type WithdrawExtraInfoUsecase struct { | ||
repo WithdrawExtraInfoRepo | ||
logger *logger.Logger | ||
} | ||
|
||
func NewWithdrawExtraInfoUsecase(repo WithdrawExtraInfoRepo, logger *logger.Logger) *WithdrawExtraInfoUsecase { | ||
return &WithdrawExtraInfoUsecase{ | ||
repo: repo, | ||
logger: logger, | ||
} | ||
} | ||
|
||
func (uc *WithdrawExtraInfoUsecase) CreateExtraInfo(ctx context.Context, outPoint string, txHash string, lockScriptId uint) error { | ||
return uc.repo.CreateExtraInfo(ctx, outPoint, txHash, lockScriptId) | ||
} | ||
|
||
func (uc *WithdrawExtraInfoUsecase) FindQueryInfos(ctx context.Context, page int, pageSize int) ([]WithdrawQueryInfo, error) { | ||
return uc.repo.FindQueryInfos(ctx, page, pageSize) | ||
} | ||
|
||
func (uc *WithdrawExtraInfoUsecase) FindOrCreateScript(ctx context.Context, script *Script) error { | ||
return uc.repo.FindOrCreateScript(ctx, script) | ||
} |
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
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
Oops, something went wrong.