Skip to content

Commit

Permalink
fix last contribution handling (#286)
Browse files Browse the repository at this point in the history
* fix last contribution handling

* fix last contribution encoding
  • Loading branch information
ERussel authored Jun 17, 2021
1 parent b3547c0 commit 426857a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension CrowdloanLastContribution: Codable {
}

self = .preEnding(value: value)
case Self.preEndingField:
case Self.endingField:
let intStr = try container.decode(String.self)
guard let blockNumber = UInt32(intStr) else {
throw DecodingError.dataCorruptedError(
Expand Down Expand Up @@ -58,7 +58,7 @@ extension CrowdloanLastContribution: Codable {
try container.encode(Self.preEndingField)
try container.encode(String(value))
case let .ending(blockNumber):
try container.encode(Self.preEndingField)
try container.encode(Self.endingField)
try container.encode(String(blockNumber))
}
}
Expand Down

0 comments on commit 426857a

Please sign in to comment.