@@ -37,11 +37,11 @@ func (f *MockFactory) NewClient(ctx context.Context, handle string) (Client, err
37
37
38
38
// mockUser is a mock user for testing systems that use paymail.
39
39
type mockUser struct {
40
- handle string
41
- identityKey bitcoin.Key
42
- addressKey bitcoin.Key
43
- p2pTxs map [string ][]* wire.MsgTx
44
- assetAliases []AssetAlias
40
+ handle string
41
+ identityKey bitcoin.Key
42
+ addressKey bitcoin.Key
43
+ p2pTxs map [string ][]* wire.MsgTx
44
+ instrumentAliases []InstrumentAlias
45
45
}
46
46
47
47
// AddMockUser adds a new mock user.
@@ -55,15 +55,15 @@ func (f *MockFactory) AddMockUser(handle string, identityKey, addressKey bitcoin
55
55
}
56
56
57
57
// AddMockUser adds a new mock user.
58
- func (f * MockFactory ) AddMockAsset (handle string , assetAlias , assetID string ) {
58
+ func (f * MockFactory ) AddMockInstrument (handle string , instrumentAlias , instrumentID string ) {
59
59
for _ , user := range f .users {
60
60
if user .handle != handle {
61
61
continue
62
62
}
63
63
64
- user .assetAliases = append (user .assetAliases , AssetAlias {
65
- AssetAlias : assetAlias ,
66
- AssetID : assetID ,
64
+ user .instrumentAliases = append (user .instrumentAliases , InstrumentAlias {
65
+ InstrumentAlias : instrumentAlias ,
66
+ InstrumentID : instrumentID ,
67
67
})
68
68
return
69
69
}
@@ -126,11 +126,11 @@ func (c *MockClient) GetPaymentDestination(ctx context.Context, senderName, send
126
126
127
127
// GetPaymentRequest gets a payment request from the identity.
128
128
// senderHandle is required.
129
- // assetID can be empty or "BSV" to request bitcoin.
129
+ // instrumentID can be empty or "BSV" to request bitcoin.
130
130
// If senderKey is not nil then it must be associated with senderHandle and will be used to add
131
131
// a signature to the request.
132
132
func (c * MockClient ) GetPaymentRequest (ctx context.Context , senderName , senderHandle , purpose ,
133
- assetID string , amount uint64 , senderKey * bitcoin.Key ) (* PaymentRequest , error ) {
133
+ instrumentID string , amount uint64 , senderKey * bitcoin.Key ) (* PaymentRequest , error ) {
134
134
135
135
ra , err := c .user .addressKey .RawAddress ()
136
136
if err != nil {
@@ -144,10 +144,10 @@ func (c *MockClient) GetPaymentRequest(ctx context.Context, senderName, senderHa
144
144
145
145
tx := wire .NewMsgTx (1 )
146
146
147
- if assetID == "BSV" {
147
+ if instrumentID == "BSV" {
148
148
tx .AddTxOut (wire .NewTxOut (amount , script ))
149
149
} else {
150
- // Note: requires contract address of asset and possibly access to mock identity oracle
150
+ // Note: requires contract address of instrument and possibly access to mock identity oracle
151
151
// client.
152
152
return nil , errors .Wrap (ErrNotCapable , "not implemented in mock client" )
153
153
}
@@ -214,7 +214,7 @@ func (c *MockClient) CheckP2PTx(txid bitcoin.Hash32) error {
214
214
return errors .New ("Not posted" )
215
215
}
216
216
217
- // ListTokenizedAssets returns the list of asset aliases for this paymail handle.
218
- func (c * MockClient ) ListTokenizedAssets (ctx context.Context ) ([]AssetAlias , error ) {
219
- return c .user .assetAliases , nil
217
+ // ListTokenizedInstruments returns the list of instrument aliases for this paymail handle.
218
+ func (c * MockClient ) ListTokenizedInstruments (ctx context.Context ) ([]InstrumentAlias , error ) {
219
+ return c .user .instrumentAliases , nil
220
220
}
0 commit comments