Skip to content

Commit

Permalink
Add BTG hashType definition into enum TWBitcoinSigHashType
Browse files Browse the repository at this point in the history
  • Loading branch information
tolak committed Apr 28, 2020
1 parent 4c69c11 commit 6d02ae2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/TrustWalletCore/TWBitcoinSigHashType.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum TWBitcoinSigHashType {
TWBitcoinSigHashTypeNone = 0x02,
TWBitcoinSigHashTypeSingle = 0x03,
TWBitcoinSigHashTypeFork = 0x40,
TWBitcoinSigHashTypeForkBTG = 0x4f40,
TWBitcoinSigHashTypeAnyoneCanPay = 0x80
};

Expand Down
2 changes: 1 addition & 1 deletion tests/BitcoinGold/TWBitcoinGoldTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TEST(TWBitcoinGoldTxGeneration, TxGeneration) {
// Setup input
Proto::SigningInput input;
input.set_coin_type(TWCoinTypeBitcoinGold);
input.set_hash_type(TWBitcoinSigHashTypeFork | TWBitcoinSigHashTypeAll | (79 << 8));
input.set_hash_type(TWBitcoinSigHashTypeAll | TWBitcoinSigHashTypeForkBTG);
input.set_amount(amount);
input.set_byte_fee(1);
input.set_to_address("btg1qmd6x5awe4t5fjhgntv0pngzdwajjg250wxdcs0");
Expand Down
2 changes: 1 addition & 1 deletion tests/BitcoinGold/TWSignerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TEST(TWBitcoinGoldSigner, SignTransaction) {
// Setup input
Proto::SigningInput input;
input.set_coin_type(TWCoinTypeBitcoinGold);
input.set_hash_type(TWBitcoinSigHashTypeFork | TWBitcoinSigHashTypeAll | (79 << 8));
input.set_hash_type(TWBitcoinSigHashTypeAll | TWBitcoinSigHashTypeForkBTG);
input.set_amount(amount);
input.set_byte_fee(1);
input.set_to_address("btg1qmd6x5awe4t5fjhgntv0pngzdwajjg250wxdcs0");
Expand Down

0 comments on commit 6d02ae2

Please sign in to comment.