Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Add Mint and Burn receipts to fuel-explorer (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
deekerno authored Sep 11, 2023
1 parent 8a2636e commit a4e5159
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,23 @@ type MessageOutReceipt @entity(virtual: true) {
is_message_out: Boolean!
}

type MintReceipt @entity(virtual: true) {
sub_id: Bytes32!
contract_id: ContractId!
val: UInt8!
pc: UInt8!
isr: UInt8!
}


type BurnReceipt @entity(virtual: true) {
sub_id: Bytes32!
contract_id: ContractId!
val: UInt8!
pc: UInt8!
isr: UInt8!
}

union Receipt =
CallReceipt
| ReturnReceipt
Expand All @@ -370,6 +387,8 @@ union Receipt =
| TransferOutReceipt
| ScriptResultReceipt
| MessageOutReceipt
| MintReceipt
| BurnReceipt

type VariableOutput @entity {
id: ID!
Expand Down
35 changes: 34 additions & 1 deletion examples/fuel-explorer/fuel-explorer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,40 @@ impl From<fuel::Receipt> for Receipt {

Self::from(receipt)
}
fuel::Receipt::Mint { .. } | fuel::Receipt::Burn { .. } => todo!(),
fuel::Receipt::Mint {
sub_id,
contract_id,
val,
pc,
is,
} => {
let receipt = MintReceipt {
sub_id,
contract_id,
val,
pc,
isr: is,
};

Self::from(receipt)
}
fuel::Receipt::Burn {
sub_id,
contract_id,
val,
pc,
is,
} => {
let receipt = BurnReceipt {
sub_id,
contract_id,
val,
pc,
isr: is,
};

Self::from(receipt)
}
}
}
}
Expand Down

0 comments on commit a4e5159

Please sign in to comment.