File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @kadena/graph ' : patch
3
+ ---
4
+
5
+ Fix simulate script edge case (when it attempts cross-chain transfers to the
6
+ same chain). Add build step in start: generate script
Original file line number Diff line number Diff line change 26
26
"prisma:studio" : " prisma studio" ,
27
27
"simulate" : " ts-node -T src/devnet/simulation/index.ts traffic" ,
28
28
"start" : " npx ts-node-dev --respawn --no-notify --exit-child src/index.ts" ,
29
- "start:generate" : " pnpm run prisma:generate && npx ts-node-dev --respawn --no-notify --exit-child src/index.ts" ,
29
+ "start:generate" : " pnpm build && npx ts-node-dev --respawn --no-notify --exit-child src/index.ts" ,
30
30
"test" : " echo \" no test specified\" "
31
31
},
32
32
"dependencies" : {
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export async function simulate({
119
119
120
120
// This is to simulate cross chain transfers
121
121
if ( transferType === 'xchaintransfer' ) {
122
- while ( account . chainId === nextAccount . chainId ) {
122
+ if ( account . chainId === nextAccount . chainId ) {
123
123
nextAccount = {
124
124
...nextAccount ,
125
125
chainId : `${ getRandomNumber (
@@ -128,6 +128,12 @@ export async function simulate({
128
128
) } ` as ChainId ,
129
129
} ;
130
130
}
131
+
132
+ if ( account . chainId === nextAccount . chainId ) {
133
+ logger . info ( 'Skipping cross chain transfer to same chain' ) ;
134
+ continue ;
135
+ }
136
+
131
137
logger . info ( 'Cross chain transfer' , account , nextAccount ) ;
132
138
result = await crossChainTransfer ( {
133
139
from : account ,
You can’t perform that action at this time.
0 commit comments