Skip to content

Commit

Permalink
fix: wait for tx committed before read its data (ref: axonweb3/axon#1526
Browse files Browse the repository at this point in the history
) (#1)
  • Loading branch information
chaoticlonghair authored Nov 8, 2023
1 parent 32824b4 commit ac66a29
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/type/types_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe("type max min data test",function (){
})
let tx = await contract.typeUint8(255,[255,255,255],[255,255,255]);
console.log("typeUint8 hash :",tx.hash);
await tx.wait();
let reusltGetUint8 =await contract.getUint8();
//expected log
expect(reusltGetUint8.toString()).to.be.equal('255,255,255,255,255,255,255')
Expand Down Expand Up @@ -74,8 +75,9 @@ describe("type max min data test",function (){
})

it("typeU256 max: ", async () => {
await contract.setUint256(65535);
let x =await contract.getUint256();
let tx = await contract.setUint256(65535);
await tx.wait();
let x = await contract.getUint256();
expect(x).to.be.equal(65535)
})

Expand Down Expand Up @@ -292,7 +294,8 @@ describe("type max min data test",function (){

it("typeString:", async () => {

await contract.changName();
let tx = await contract.changName();
await tx.wait();
console.log("The new string is :", await contract.getName());
expect(await contract.getName()).to.equal("Zrptotest")

Expand Down Expand Up @@ -368,4 +371,4 @@ describe("type max min data test",function (){



});
});

0 comments on commit ac66a29

Please sign in to comment.