Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 42d99e8

Browse files
committed
transportSignature -> payForTransport
because the method to do it is transportMessage and that's really all it means, so either it should be the SAME name, or else a bit more descriptive
1 parent 5091cf3 commit 42d99e8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ const receipt = await dataUnion.withdrawAllToSigned(memberAddress, recipientAddr
442442
The `messageHash` argument to `transportMessage` will come from the withdraw function with the specific options. The following is equivalent to the above withdraw line:
443443
```js
444444
const messageHash = await dataUnion.withdrawAllToSigned(memberAddress, recipientAddress, signature, {
445-
transportSignatures: false,
445+
payForTransport: false,
446446
waitUntilTransportIsComplete: false,
447447
}) // only pay for sidechain gas
448448
const receipt = await dataUnion.transportMessage(messageHash) // only pay for mainnet gas
@@ -477,7 +477,7 @@ The functions `withdrawAll`, `withdrawAllTo`, `withdrawAllToMember`, `withdrawAl
477477
| Name | Default | Description |
478478
| :---------------- | :-------------------- | :---------------------------------------------------------------------------------- |
479479
| sendToMainnet | true | Whether to send the withdrawn DATA tokens to mainnet address (or sidechain address) |
480-
| transportSignatures | true | Whether to pay for the withdraw transaction signature transport to mainnet over the bridge |
480+
| payForTransport | true | Whether to pay for the withdraw transaction signature transport to mainnet over the bridge |
481481
| waitUntilTransportIsComplete | true | Whether to wait until the withdrawn DATA tokens are visible in mainnet |
482482
| pollingIntervalMs | 1000 (1 second) | How often requests are sent to find out if the withdraw has completed |
483483
| retryTimeoutMs | 60000 (1 minute) | When to give up when waiting for the withdraw to complete |

src/dataunion/DataUnion.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface JoinResponse {
3939
export interface DataUnionWithdrawOptions {
4040
pollingIntervalMs?: number
4141
retryTimeoutMs?: number
42-
transportSignatures?: boolean
42+
payForTransport?: boolean
4343
waitUntilTransportIsComplete?: boolean
4444
sendToMainnet?: boolean
4545
}
@@ -144,7 +144,7 @@ export class DataUnion {
144144
/**
145145
* Withdraw all your earnings
146146
* @returns the sidechain withdraw transaction receipt IF called with sendToMainnet=false,
147-
* ELSE the message hash IF called with transportSignatures=false and waitUntilTransportIsComplete=false,
147+
* ELSE the message hash IF called with payForTransport=false and waitUntilTransportIsComplete=false,
148148
* ELSE the mainnet AMB signature execution transaction receipt IF we did the transport ourselves,
149149
* ELSE null IF transport to mainnet was done by someone else (in which case the receipt is lost)
150150
*/
@@ -181,7 +181,7 @@ export class DataUnion {
181181
/**
182182
* Withdraw earnings and "donate" them to the given address
183183
* @returns the sidechain withdraw transaction receipt IF called with sendToMainnet=false,
184-
* ELSE the message hash IF called with transportSignatures=false and waitUntilTransportIsComplete=false,
184+
* ELSE the message hash IF called with payForTransport=false and waitUntilTransportIsComplete=false,
185185
* ELSE the mainnet AMB signature execution transaction receipt IF we did the transport ourselves,
186186
* ELSE null IF transport to mainnet was done by someone else (in which case the receipt is lost)
187187
*/
@@ -410,7 +410,7 @@ export class DataUnion {
410410
* TODO: add test
411411
* @param memberAddress - the other member who gets their tokens out of the Data Union
412412
* @returns the sidechain withdraw transaction receipt IF called with sendToMainnet=false,
413-
* ELSE the message hash IF called with transportSignatures=false and waitUntilTransportIsComplete=false,
413+
* ELSE the message hash IF called with payForTransport=false and waitUntilTransportIsComplete=false,
414414
* ELSE the mainnet AMB signature execution transaction receipt IF we did the transport ourselves,
415415
* ELSE null IF transport to mainnet was done by someone else (in which case the receipt is lost)
416416
*/
@@ -443,7 +443,7 @@ export class DataUnion {
443443
* @param recipientAddress - the address to receive the tokens in mainnet
444444
* @param signature - from member, produced using signWithdrawAllTo
445445
* @returns the sidechain withdraw transaction receipt IF called with sendToMainnet=false,
446-
* ELSE the message hash IF called with transportSignatures=false and waitUntilTransportIsComplete=false,
446+
* ELSE the message hash IF called with payForTransport=false and waitUntilTransportIsComplete=false,
447447
* ELSE the mainnet AMB signature execution transaction receipt IF we did the transport ourselves,
448448
* ELSE null IF transport to mainnet was done by someone else (in which case the receipt is lost)
449449
*/
@@ -578,7 +578,7 @@ export class DataUnion {
578578
* Template for withdraw functions
579579
* @private
580580
* @returns the sidechain withdraw transaction receipt IF called with sendToMainnet=false,
581-
* ELSE the message hash IF called with transportSignatures=false and waitUntilTransportIsComplete=false,
581+
* ELSE the message hash IF called with payForTransport=false and waitUntilTransportIsComplete=false,
582582
* ELSE the mainnet AMB signature execution transaction receipt IF we did the transport ourselves,
583583
* ELSE null IF transport to mainnet was done by someone else (in which case the receipt is lost)
584584
*/
@@ -591,7 +591,7 @@ export class DataUnion {
591591
pollingIntervalMs = 1000,
592592
retryTimeoutMs = 60000,
593593
// by default, transport the signatures if freeWithdraw isn't supported by the sidechain
594-
transportSignatures = !this.client.options.dataUnion.freeWithdraw,
594+
payForTransport = !this.client.options.dataUnion.freeWithdraw,
595595
waitUntilTransportIsComplete = true,
596596
sendToMainnet = true,
597597
} = options
@@ -621,7 +621,7 @@ export class DataUnion {
621621

622622
const messageHash = ambHashes[0]
623623

624-
if (!transportSignatures) {
624+
if (!payForTransport) {
625625
// expect someone else to do the transport for us (corresponds to dataUnion.freeWithdraw=true)
626626
if (waitUntilTransportIsComplete) {
627627
log(`Waiting for balance ${balanceBefore.toString()} to change`)

0 commit comments

Comments
 (0)