Skip to content

Commit

Permalink
client/asset: tweak bond data field name
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Nov 18, 2022
1 parent 485fa92 commit 86a584f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions client/asset/dcr/dcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -3199,11 +3199,11 @@ func (dcr *ExchangeWallet) EstimateRegistrationTxFee(feeRate uint64) uint64 {
// Output 2 is change, if any.
//
// The bond output's redeem script, which is needed to spend the bond output, is
// returned as the BondData field of the Bond. The bond output pays to a
// pubkeyhash script for a wallet address. Bond.RedeemTx is a backup transaction
// that spends the bond output after lockTime passes, paying to an address for
// the current underlying wallet; the bond private key (BondPrivKey) should
// normally be used to author a new transaction paying to a new address instead.
// returned as the Data field of the Bond. The bond output pays to a pubkeyhash
// script for a wallet address. Bond.RedeemTx is a backup transaction that
// spends the bond output after lockTime passes, paying to an address for the
// current underlying wallet; the bond private key (BondPrivKey) should normally
// be used to author a new transaction paying to a new address instead.
func (dcr *ExchangeWallet) MakeBondTx(ver uint16, amt uint64, lockTime time.Time,
bondKey *secp256k1.PrivateKey, acctID []byte) (*asset.Bond, error) {
if ver != 0 {
Expand Down Expand Up @@ -3317,7 +3317,7 @@ func (dcr *ExchangeWallet) MakeBondTx(ver uint16, amt uint64, lockTime time.Time
AssetID: BipID,
Amount: amt,
CoinID: toCoinID(&txid, 0),
BondData: bondScript,
Data: bondScript,
BondPrivKey: bondKey.Serialize(),
SignedTx: signedTxBytes,
UnsignedTx: unsignedTxBytes,
Expand Down
6 changes: 3 additions & 3 deletions client/asset/dcr/simnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestMakeBondTx(t *testing.T) {
t.Logf("bond txid %v\n", coinhash)
t.Logf("signed tx: %x\n", bond.SignedTx)
t.Logf("unsigned tx: %x\n", bond.UnsignedTx)
t.Logf("bond script: %x\n", bond.BondData)
t.Logf("bond script: %x\n", bond.Data)
t.Logf("redeem tx: %x\n", bond.RedeemTx)
bondMsgTx, err := msgTxFromBytes(bond.SignedTx)
if err != nil {
Expand All @@ -199,7 +199,7 @@ func TestMakeBondTx(t *testing.T) {

pkh := dcrutil.Hash160(pubkey.SerializeCompressed())

lockTimeUint, pkhPush, err := dexdcr.ExtractBondDetailsV0(bondOutVersion, bond.BondData)
lockTimeUint, pkhPush, err := dexdcr.ExtractBondDetailsV0(bondOutVersion, bond.Data)
if err != nil {
t.Fatalf("ExtractBondDetailsV0: %v", err)
}
Expand Down Expand Up @@ -238,7 +238,7 @@ func TestMakeBondTx(t *testing.T) {
waitNetwork() // wait for beta to see the new block (bond must be mined for RefundBond)

refundTxNew, err := wallet.RefundBond(context.Background(), bondVer, bond.CoinID,
bond.BondData, bond.Amount, priv)
bond.Data, bond.Amount, priv)
if err != nil {
t.Fatalf("RefundBond: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion client/asset/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ type Bond struct {
AssetID uint32
Amount uint64
CoinID []byte
BondData []byte // additional data to interpret the bond e.g. redeem script, bond contract, etc.
Data []byte // additional data to interpret the bond e.g. redeem script, bond contract, etc.
BondPrivKey []byte // caller provided, but kept with the output
// SignedTx and UnsignedTx are the opaque (raw bytes) signed and unsigned
// bond creation transactions, in whatever encoding and funding scheme for
Expand Down

0 comments on commit 86a584f

Please sign in to comment.