Skip to content

Commit 701521a

Browse files
authored
Merge pull request #16 from OpenFuturePlatform/minor-changes
Minor changes
2 parents 3f0621c + d9ec408 commit 701521a

File tree

5 files changed

+4
-5
lines changed

5 files changed

+4
-5
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Input arguments:
1717
* `-c, --contract` Address of token Smart contract [_required_]
1818
* `-f, --from` Start block number [_optional_, default is 0]
1919
* `-t, --to` End block number [_optional, default is **latest block**_]
20-
* `-d, --decimals` Snapshot decimals value [_optional_, default is **8**]
2120
* `-o, --output` Name of csv file to save [_optional_, default is **snapshot_at_block_toBlocknumber**]
2221
* `-m, --mode` Snapshot mode [_optional_, possible values are ARCHIVED and EVENT, default is **EVENT**]
2322
* `-h, --help` Show available options and exit

src/main/kotlin/io/openfuture/snapshot/exporter/CsvSnapshotExporter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import java.io.PrintWriter
55

66
class CsvSnapshotExporter : FileExporter {
77

8-
override fun export(fileName: String, walletStates: List<WalletState>) {
8+
override fun export(fileName: String, walletStates: Collection<WalletState>) {
99
val writer = PrintWriter(fileName, "UTF-8")
1010
writer.println(HEADERS)
1111
walletStates.forEach {

src/main/kotlin/io/openfuture/snapshot/exporter/FileExporter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import io.openfuture.snapshot.domain.WalletState
44

55
interface FileExporter {
66

7-
fun export(fileName: String, walletStates: List<WalletState>)
7+
fun export(fileName: String, walletStates: Collection<WalletState>)
88

99
}

src/main/kotlin/io/openfuture/snapshot/snapshot/ArchivedNodeBasedSnapshotCreator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ArchivedNodeBasedSnapshotCreator(nodeAddress: String) : SnapshotCreator {
3232

3333
println("Batch fetching addresses from $blockNumber to $nextBatch blocks")
3434
val transfers = web3jHelper.getTransfers(contractAddress, blockNumber, nextBatch)
35-
val fetchedAddresses = transfers.map { it.fromAddress }
35+
val fetchedAddresses = transfers.map { it.toAddress }
3636

3737
addresses.addAll(fetchedAddresses)
3838
}

src/main/kotlin/io/openfuture/snapshot/snapshot/EventBasedSnapshotCreator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class EventBasedSnapshotCreator(nodeAddress: String) : SnapshotCreator {
3737
}
3838

3939
val fromAmount = walletStateMap.getOrDefault(transfer.fromAddress, BigDecimal.ZERO)
40-
walletStateMap.replace(transfer.fromAddress, fromAmount.minus(transfer.amount))
40+
walletStateMap[transfer.fromAddress] = fromAmount.minus(transfer.amount)
4141
}
4242
}
4343

0 commit comments

Comments
 (0)