Skip to content

Commit

Permalink
Replacing deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardonunesp authored and enlight committed Jan 24, 2019
1 parent 37dd907 commit 02ef5d5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/contracts/address-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export class AddressMapper extends Contract {
)

return {
from: Address.UmarshalPB(result.getFrom()!),
to: Address.UmarshalPB(result.getTo()!)
from: Address.UnmarshalPB(result.getFrom()!),
to: Address.UnmarshalPB(result.getTo()!)
} as IAddressMapping
}
}
2 changes: 1 addition & 1 deletion src/contracts/dpos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class DPOS extends Contract {

return result.getCandidatesList().map((canditate: Candidate) => {
return {
address: Address.UmarshalPB(canditate.getAddress()!),
address: Address.UnmarshalPB(canditate.getAddress()!),
pubKey: canditate.getPubKey_asU8()!
}
}) as Array<ICandidate>
Expand Down
10 changes: 5 additions & 5 deletions src/contracts/dpos2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class DPOS2 extends Contract {

return result.getCandidatesList().map((candidate: CandidateV2) => ({
pubKey: candidate.getPubKey_asU8()!,
address: Address.UmarshalPB(candidate.getAddress()!),
address: Address.UnmarshalPB(candidate.getAddress()!),
fee: new BN(candidate.getFee()!),
newFee: new BN(candidate.getNewfee()!),
feeDelayCounter: new BN(candidate.getFeedelaycounter()!),
Expand All @@ -111,7 +111,7 @@ export class DPOS2 extends Contract {
)

return result.getStatisticsList().map((validator: ValidatorStatisticV2) => ({
address: Address.UmarshalPB(validator.getAddress()!),
address: Address.UnmarshalPB(validator.getAddress()!),
pubKey: validator.getPubKey_asU8()!,
upblockCount: validator.getUpblockCount(),
blockCount: validator.getBlockCount(),
Expand Down Expand Up @@ -144,11 +144,11 @@ export class DPOS2 extends Contract {
const delegation = result.getDelegation()
return delegation
? {
validator: Address.UmarshalPB(delegation.getValidator()!),
validator: Address.UnmarshalPB(delegation.getValidator()!),
updateValidator: delegation.getUpdateValidator()
? Address.UmarshalPB(delegation.getUpdateValidator()!)
? Address.UnmarshalPB(delegation.getUpdateValidator()!)
: undefined,
delegator: Address.UmarshalPB(delegation.getDelegator()!),
delegator: Address.UnmarshalPB(delegation.getDelegator()!),
amount: delegation.getAmount() ? unmarshalBigUIntPB(delegation.getAmount()!) : new BN(0),
updateAmount: delegation.getUpdateAmount()
? unmarshalBigUIntPB(delegation.getAmount()!)
Expand Down
12 changes: 6 additions & 6 deletions src/contracts/transfer-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ export class TransferGateway extends Contract {
}

this.emit(TransferGateway.EVENT_TOKEN_WITHDRAWAL, {
tokenOwner: Address.UmarshalPB(eventData.getTokenOwner()!),
tokenContract: Address.UmarshalPB(eventData.getTokenContract()!),
tokenOwner: Address.UnmarshalPB(eventData.getTokenOwner()!),
tokenContract: Address.UnmarshalPB(eventData.getTokenContract()!),
tokenKind,
tokenId,
tokenAmount,
Expand All @@ -123,8 +123,8 @@ export class TransferGateway extends Contract {
)

this.emit(TransferGateway.EVENT_CONTRACT_MAPPING_CONFIRMED, {
foreignContract: Address.UmarshalPB(contractMappingConfirmed.getForeignContract()!),
localContract: Address.UmarshalPB(contractMappingConfirmed.getLocalContract()!)
foreignContract: Address.UnmarshalPB(contractMappingConfirmed.getForeignContract()!),
localContract: Address.UnmarshalPB(contractMappingConfirmed.getLocalContract()!)
} as IContractMappingConfirmedEventArgs)
}
})
Expand Down Expand Up @@ -295,8 +295,8 @@ export class TransferGateway extends Contract {
break
}
return {
tokenOwner: Address.UmarshalPB(receipt.getTokenOwner()!),
tokenContract: Address.UmarshalPB(receipt.getTokenContract()!),
tokenOwner: Address.UnmarshalPB(receipt.getTokenOwner()!),
tokenContract: Address.UnmarshalPB(receipt.getTokenContract()!),
tokenKind,
tokenId,
tokenAmount,
Expand Down
4 changes: 2 additions & 2 deletions src/plasma-cash/plasma-cash-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ export function unmarshalPlasmaTxPB(rawTx: PlasmaTx): PlasmaCashTx {
denomination: rawTx.hasDenomination()
? unmarshalBigUIntPB(rawTx.getDenomination()!)
: new BN(0),
newOwner: Address.UmarshalPB(rawTx.getNewOwner()!).local.toString(),
newOwner: Address.UnmarshalPB(rawTx.getNewOwner()!).local.toString(),
sig: rawTx.getSignature_asU8(),
proof: rawTx.getProof_asU8()
})
const sender = rawTx.getSender()
if (sender) {
tx.prevOwner = Address.UmarshalPB(sender).local.toString()
tx.prevOwner = Address.UnmarshalPB(sender).local.toString()
}
return tx
}
Expand Down

0 comments on commit 02ef5d5

Please sign in to comment.