Closed zquestz closed 4 years ago
I also noticed the consensus ID is wrong...
{
/*.nBranchId =*/ 0xf5b9230b,
/*.strName =*/ "Heartwood",
/*.strInfo =*/ "See https://z.cash/upgrade/heartwood/ for details.",
},
For v4 txs on testnet it should now be 0xf5b9230b
.
For now I have patched my network lookup method.
/**
* Returns the network object from the zcash library
* @param input.network Network string passed into coin-ops
* @returns the zcash network
*/
function zecNetwork({ network }: ZecNetworkInput): any {
var net = null;
switch (network) {
case "zcash-mainnet":
net = bitgo.networks.zcash;
break;
case "zcash-testnet":
net = bitgo.networks.zcashTest;
net.consensusBranchId['4'] = 0xf5b9230b
break;
default:
throw new ValidationError(`invalid network`);
}
return net
}
However the resulting tx still doesn't broadcast. =\
0400008085202f89018379bd136089765ee9b47504540619b0cf3a8e481659551a06fc875db14ff9e2000000006b483045022100a01fcec97fb383bc5fee536893479be0bb34744abdfa44efcdb7c9b9b39d858602200e8c0b75acabbed1e56d5e465f1850731d813421936bf8e7fe5be6bbc6c1c0d3032102594fdae20bf32bce9d3d072813d7e5475d56a13134baa63650916d07b7985dc5ffffffff0100e1f505000000001976a914e44661aa9f4ffbe9066f90283078adf3a896b6d388ac00000000000000000000000000000000000000
Got it working. Going to close this ticket, but you should really fix the other zcash issue in issue #61.
I am attempting to build 2 functions with this library, one that constructs an unsigned transaction, and another that takes that unsigned transaction and signs it then returns the needed hex.
After some playing around, I got it to produce a transaction the library thinks is valid, but doesn't broadcast on the network. =\
NOTE: I am doing this for TESTNET!
I am probably just missing something simple... so figured I could share some code. =)
When I submit the final tx to the network I get
Here is the final signed tx hex:
The decoded transaction in json: