-
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.
* fix configuration tests * vscode: increase default Go tests timeout to 2 min. * fix indexer tests * add address converter utility * fix client tests * fix account service tests * fix network service tests * refactor package(s) structure * fix txscript tests
- Loading branch information
Showing
36 changed files
with
423 additions
and
4,414 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"go.testTimeout": "2m" | ||
} |
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,39 @@ | ||
package address_converter | ||
|
||
// simple address converter to KMD (Komodo) address | ||
// go get github.com/btcsuite/btcutil/base58 | ||
|
||
import ( | ||
"crypto/sha256" | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/btcsuite/btcutil/base58" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) < 2 { | ||
log.Fatal("Usage: go run address-converter.go <address>") | ||
} | ||
address := os.Args[1] | ||
decoded := base58.Decode(address) | ||
if len(decoded) < 6 { | ||
log.Fatal("Invalid address length") | ||
} | ||
network_bytes_len := len(decoded) - 4 - 20 | ||
trimmed := decoded[network_bytes_len : len(decoded)-4] | ||
|
||
fmt.Printf("Trimmed 20-byte slice: %x\n", trimmed) | ||
prefixed := append([]byte{0x3C}, trimmed...) | ||
checksum := checksum(prefixed) | ||
fullAddress := append(prefixed, checksum[:4]...) | ||
finalAddress := base58.Encode(fullAddress) | ||
fmt.Println("Converted address:", finalAddress) | ||
} | ||
|
||
func checksum(input []byte) []byte { | ||
firstSHA := sha256.Sum256(input) | ||
secondSHA := sha256.Sum256(firstSHA[:]) | ||
return secondSHA[:] | ||
} |
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,4 +1,4 @@ | ||
package main | ||
package get_keys | ||
|
||
import ( | ||
"bytes" | ||
|
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.