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

Commit 893409a

Browse files
author
Juuso Takalainen
committed
freeWithdraw -> !payForTransport
One is the property of the bridge, one is the property of the function call, it's like the opposite angle of looking at it. But I'll still change it so that the name is the same. So freeWithdraw -> !payForTransport everywhere. It's better that way.
1 parent 9f32fda commit 893409a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ const dataUnion = client.getDataUnion(dataUnionAddress)
360360
<!-- This stuff REALLY isn't for those who use our infrastructure, neither DU admins nor DU client devs. It's only relevant if you're setting up your own sidechain.
361361
These DataUnion-specific options can be given to `new StreamrClient` options:
362362
363-
| Property | Default | Description |
364-
| :---------------------------------- | :----------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- |
365-
| dataUnion.minimumWithdrawTokenWei | 1000000 | Threshold value set in AMB configs, smallest token amount that can pass over the bridge |
366-
| dataUnion.freeWithdraw | false | true = someone else pays for the gas when transporting the withdraw tx to mainnet |
367-
| | | false = client does the transport as self-service and pays the mainnet gas costs |
363+
| Property | Default | Description |
364+
| :---------------------------------- | :----------------------------------------------------- | :----------------------------------------------------------------------------------------- |
365+
| dataUnion.minimumWithdrawTokenWei | 1000000 | Threshold value set in AMB configs, smallest token amount that can pass over the bridge |
366+
| dataUnion.payForTransport | true | true = client does the transport as self-service and pays the mainnet gas costs |
367+
| | | false = someone else pays for the gas when transporting the withdraw tx to mainnet |
368368
-->
369369

370370
### Admin Functions

src/Config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export type StrictStreamrClientOptions = {
6565
* otherwise the client does the transport as self-service and pays the mainnet gas costs
6666
*/
6767
minimumWithdrawTokenWei: BigNumber|number|string
68-
freeWithdraw: boolean
68+
payForTransport: boolean
6969
factoryMainnetAddress: EthereumAddress
7070
factorySidechainAddress: EthereumAddress
7171
templateMainnetAddress: EthereumAddress
@@ -137,7 +137,7 @@ export const STREAM_CLIENT_DEFAULTS: StrictStreamrClientOptions = {
137137
tokenSidechainAddress: '0xE4a2620edE1058D61BEe5F45F6414314fdf10548',
138138
dataUnion: {
139139
minimumWithdrawTokenWei: '1000000',
140-
freeWithdraw: false,
140+
payForTransport: true,
141141
factoryMainnetAddress: '0x7d55f9981d4E10A193314E001b96f72FCc901e40',
142142
factorySidechainAddress: '0x1b55587Beea0b5Bc96Bb2ADa56bD692870522e9f',
143143
templateMainnetAddress: '0x5FE790E3751dd775Cb92e9086Acd34a2adeB8C7b',

src/dataunion/DataUnion.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ export class DataUnion {
606606
const {
607607
pollingIntervalMs = 1000,
608608
retryTimeoutMs = 300000,
609-
// by default, transport the signatures if freeWithdraw isn't supported by the sidechain
610-
payForTransport = !this.client.options.dataUnion.freeWithdraw,
609+
// by default, transport the signatures if payForTransport=false isn't supported by the sidechain
610+
payForTransport = this.client.options.dataUnion.payForTransport,
611611
waitUntilTransportIsComplete = true,
612612
sendToMainnet = true,
613613
} = options
@@ -637,8 +637,8 @@ export class DataUnion {
637637

638638
const messageHash = ambHashes[0]
639639

640+
// expect someone else to do the transport for us
640641
if (!payForTransport) {
641-
// expect someone else to do the transport for us (corresponds to dataUnion.freeWithdraw=true)
642642
if (waitUntilTransportIsComplete) {
643643
log(`Waiting for balance=${balanceBefore.toString()} change (poll every ${pollingIntervalMs}ms, timeout after ${retryTimeoutMs}ms)`)
644644
await until(async () => !(await getBalanceFunc()).eq(balanceBefore), retryTimeoutMs, pollingIntervalMs).catch((e) => {
@@ -648,7 +648,7 @@ export class DataUnion {
648648
return null
649649
}
650650

651-
// instead of waiting, hand out the messageHash so that someone else might do the transport using it
651+
// instead of waiting, hand out the messageHash so that we can pass it on to that who does the transportMessage(messageHash)
652652
return messageHash
653653
}
654654

0 commit comments

Comments
 (0)