Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
chedao_stuff committed Oct 24, 2023
1 parent c0fa815 commit c5256e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions ui/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {connect} from "@argent/get-starknet";
import {item_subtypes} from "../config/item.js";
import {formatAdventurerState, getRandomNumber, stringToFelt} from "../utils/index.js";
import {parseEvents} from "../system/parseEvents.js";
import {Contract, getChecksumAddress, hash, uint256} from 'starknet';
import {Contract, getChecksumAddress, hash, TransactionStatus, uint256} from 'starknet';


export const contract_address = "0x0524d66e57fee8ce3ac9e41c8b62eff50cfa78abb89844bdff17c9cedd4aa56b";
Expand Down Expand Up @@ -349,6 +349,7 @@ export const store = createStore({
console.log("trying to execute the transaction:", txhash, retryCount);
receipt = await context.state.account?.waitForTransaction(txhash, {
retryInterval: 3000,
successStates: [TransactionStatus.ACCEPTED_ON_L2],
});
return receipt; // 返回收据
} catch (error) {
Expand Down Expand Up @@ -419,9 +420,7 @@ export const store = createStore({

console.log("tx", tx);

let receipt = await context.state.account?.waitForTransaction(tx.transaction_hash, {
retryInterval: 2000,
});
const receipt = await context.dispatch('poolReceipt', tx.transaction_hash);

console.log('receipt', receipt);

Expand Down
2 changes: 1 addition & 1 deletion ui/src/system/parseEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export async function parseEvents(receipt) {
});
break;
default:
console.error("unknown event: " + eventName);
console.error("unknown event: " + eventName, raw.data);
break;
}

Expand Down

0 comments on commit c5256e9

Please sign in to comment.