Skip to content

Commit

Permalink
conforming with deprecated props removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf committed Jan 6, 2025
1 parent 156d5f0 commit e586a4d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export function getDecodedLogs<T = unknown>(

const data =
receipt.type === ReceiptType.Log
? new BigNumberCoder('u64').encode(receipt.val0)
? new BigNumberCoder('u64').encode(receipt.ra)
: receipt.data;

const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toString());
const [decodedLog] = interfaceToUse.decodeLog(data, receipt.rb.toString());
logs.push(decodedLog);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function extractTransferOperationFromReceipt(
changeOutputs: OutputChange[]
) {
const { to: toAddress, assetId, amount } = receipt;
let { from: fromAddress } = receipt;
let { id: fromAddress } = receipt;

const toType = contractInputs.some((input) => input.contractID === toAddress)
? AddressType.contract
Expand Down
9 changes: 0 additions & 9 deletions packages/account/src/providers/utils/receipts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function assembleReceiptByType(receipt: GqlReceiptFragment) {
const callReceipt: ReceiptCall = {
type: ReceiptType.Call,
id,
from: id,
to: hexOrZero(receipt?.to),
amount: bn(receipt.amount),
assetId: hexOrZero(receipt.assetId),
Expand Down Expand Up @@ -148,10 +147,6 @@ export function assembleReceiptByType(receipt: GqlReceiptFragment) {
rb,
rc,
rd,
val0: ra,
val1: rb,
val2: rc,
val3: rd,
pc: bn(receipt.pc),
is: bn(receipt.is),
};
Expand All @@ -167,8 +162,6 @@ export function assembleReceiptByType(receipt: GqlReceiptFragment) {
id: hexOrZero(receipt.id || receipt.contractId),
ra,
rb,
val0: ra,
val1: rb,
ptr: bn(receipt.ptr),
len: bn(receipt.len),
digest: hexOrZero(receipt.digest),
Expand All @@ -184,7 +177,6 @@ export function assembleReceiptByType(receipt: GqlReceiptFragment) {
const transferReceipt: ReceiptTransfer = {
type: ReceiptType.Transfer,
id,
from: id,
to: hexOrZero(receipt.toAddress || receipt?.to),
amount: bn(receipt.amount),
assetId: hexOrZero(receipt.assetId),
Expand All @@ -200,7 +192,6 @@ export function assembleReceiptByType(receipt: GqlReceiptFragment) {
const transferOutReceipt: ReceiptTransferOut = {
type: ReceiptType.TransferOut,
id,
from: id,
to: hexOrZero(receipt.toAddress || receipt.to),
amount: bn(receipt.amount),
assetId: hexOrZero(receipt.assetId),
Expand Down
4 changes: 2 additions & 2 deletions packages/program/src/contract-call-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ const getMainCallReceipt = (
contractId: string
): TransactionResultCallReceipt | undefined =>
receipts.find(
({ type, from, to }) =>
type === ReceiptType.Call && from === SCRIPT_WRAPPER_CONTRACT_ID && to === contractId
({ type, id, to }) =>
type === ReceiptType.Call && id === SCRIPT_WRAPPER_CONTRACT_ID && to === contractId
);

const scriptResultDecoder = (contractId: AbstractAddress) => (result: ScriptResult) => {
Expand Down

0 comments on commit e586a4d

Please sign in to comment.