Skip to content

Commit

Permalink
fix: Cmd config and mempool bug
Browse files Browse the repository at this point in the history
--bug=1
  • Loading branch information
studyzy committed Apr 28, 2024
1 parent 5a49c30 commit caf0a90
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cmd/runestonecli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (c Config) GetEtching() (*runestone.Etching, error) {
etching.Spacers = &r.Spacers
if c.Etching.Symbol != nil {
symbolStr := *c.Etching.Symbol
symbol := rune(symbolStr[0])
symbol := ([]rune(symbolStr))[0]
etching.Symbol = &symbol
}
if c.Etching.Premine != nil {
Expand Down
16 changes: 8 additions & 8 deletions cmd/runestonecli/config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PrivateKey: "1234567890"
PrivateKey: "b3a6727304df7ce886b678c8cca6a29d443fecd78f6913bc9d923657416ff100"
Network: "testnet" # mainnet or testnet
RpcUrl: "https://blockstream.info/testnet/api" #https://mempool.space/api https://mempool.space/testnet/api
FeePerByte: 5
UtxoAmount: 1000
RpcUrl: "https://mempool.space/testnet/api" #https://mempool.space/api https://mempool.space/testnet/api
FeePerByte: 10
UtxoAmount: 666
Etching:
Rune: "STUDYZY"
Symbol: ""
Rune: "GOOD.LUCK.COIN"
Symbol: "🪙"
Premine: 1000000
Amount: 1000
Cap: 20000
# Divisibility: 0
# HeightStart: 0
# HeightEnd: 0
# HeightOffsetStart: 0
# HeightOffsetEnd: 0
HeightOffsetStart: 0
HeightOffsetEnd: 100000
Mint:
RuneId: "2609649:946"
2 changes: 1 addition & 1 deletion cmd/runestonecli/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func getDefaultLanguage() language.Tag {
langTag := strings.Split(langEnv, ".")[0]
tag, err := language.Parse(langTag)
if err != nil {
return language.Chinese
return language.English
}
return tag
}
17 changes: 10 additions & 7 deletions cmd/runestonecli/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,16 @@ func (m MempoolConnector) GetTxByHash(hash string) (*BtcTxInfo, error) {
if err != nil {
return nil, err
}
txInfo := &BtcTxInfo{
Tx: nil,
BlockHeight: resp.Status.BlockHeight,
BlockHash: HexToHash(resp.Status.BlockHash),
BlockTime: uint64(resp.Status.BlockTime),
Confirmations: 0,
TxIndex: 0,
txInfo := &BtcTxInfo{}
if resp.Status.Confirmed {
txInfo.BlockHeight = resp.Status.BlockHeight
txInfo.BlockHash = HexToHash(resp.Status.BlockHash)
txInfo.BlockTime = uint64(resp.Status.BlockTime)
latest, err := m.GetBlockHeight()
if err != nil {
return nil, err
}
txInfo.Confirmations = latest - txInfo.BlockHeight + 1
}
tx, err := m.GetRawTxByHash(hash)
if err != nil {
Expand Down

0 comments on commit caf0a90

Please sign in to comment.