fix send tx

This commit is contained in:
Anh Minh 2025-10-07 22:24:54 +07:00
parent d5e89c757d
commit f9a0c861fb
3 changed files with 12 additions and 4 deletions

View File

@ -126,6 +126,7 @@ func (nc *NockchainClient) WalletSendTransaction(tx *nockchain.RawTx) (*nockchai
req := nockchain.WalletSendTransactionRequest{ req := nockchain.WalletSendTransactionRequest{
TxId: ParseHash(tx.TxId), TxId: ParseHash(tx.TxId),
RawTx: &nockchain.RawTransaction{ RawTx: &nockchain.RawTransaction{
Id: ParseHash(tx.TxId),
NamedInputs: inputs, NamedInputs: inputs,
TotalFees: &nockchain.Nicks{Value: tx.TotalFees}, TotalFees: &nockchain.Nicks{Value: tx.TotalFees},
TimelockRange: &nockchain.TimeLockRangeAbsolute{ TimelockRange: &nockchain.TimeLockRangeAbsolute{

View File

@ -455,7 +455,10 @@ func (h *GprcHandler) CreateTx(ctx context.Context, req *nockchain.CreateTxReque
var timelockRange *nockchain.TimelockRange var timelockRange *nockchain.TimelockRange
if req.TimelockIntent == nil { if req.TimelockIntent == nil {
timelockRange = nil timelockRange = &nockchain.TimelockRange{
Min: nil,
Max: nil,
}
} else { } else {
if req.TimelockIntent.Absolute != nil { if req.TimelockIntent.Absolute != nil {
timelockRange = req.TimelockIntent.Absolute timelockRange = req.TimelockIntent.Absolute

View File

@ -120,13 +120,17 @@ func ConvertInput(input *nockchain.NockchainInput) (*nockchain.NamedInput, error
} }
pks = append(seedPks, pk) pks = append(seedPks, pk)
} }
seeds = append(seeds, &nockchain.Seed{ var source *nockchain.OutputSource
OutputSource: &nockchain.OutputSource{ if seed.OutputSource != nil {
source = &nockchain.OutputSource{
Source: &nockchain.Source{ Source: &nockchain.Source{
Hash: ParseHash(seed.OutputSource.Source), Hash: ParseHash(seed.OutputSource.Source),
Coinbase: input.Note.Source.IsCoinbase, Coinbase: input.Note.Source.IsCoinbase,
}, },
}, }
}
seeds = append(seeds, &nockchain.Seed{
OutputSource: source,
Recipient: &nockchain.Lock{ Recipient: &nockchain.Lock{
KeysRequired: uint32(seed.Recipient.KeysRequired), KeysRequired: uint32(seed.Recipient.KeysRequired),
SchnorrPubkeys: seedPks, SchnorrPubkeys: seedPks,