Skip to content

Commit

Permalink
update MigratedAccountStatus signature
Browse files Browse the repository at this point in the history
  • Loading branch information
soilking committed Sep 25, 2024
1 parent 0477238 commit e0b56ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
2 changes: 2 additions & 0 deletions projects/subgraph-beanstalk/manifests/arbitrum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ dataSources:
eventHandlers:
- event: AddMigratedDeposit(indexed address,indexed address,int96,uint256,uint256)
handler: handleAddMigratedDeposit
- event: MigratedAccountStatus(indexed address,uint256,uint256)
handler: handleMigratedAccountStatus
- event: MigratedPlot(indexed address,indexed uint256,uint256)
handler: handleMigratedPlot
- event: MigratedPodListing(indexed address,uint256,uint256,uint256,uint256,uint24,uint256,uint256,uint8)
Expand Down
8 changes: 2 additions & 6 deletions projects/subgraph-beanstalk/tests/Migration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,13 @@ describe("Beanstalk 3 Migration", () => {
test("MigratedAccountStatus", () => {
const stalk1 = BigInt.fromU32(100).times(BI_10.pow(16));
const roots1 = BigInt.fromU32(100).times(BI_10.pow(22));
const bdv1 = BigInt.fromU32(30).times(BI_10.pow(6));
const stem1 = BigInt.fromU32(248672);
handleMigratedAccountStatus(createMigratedAccountStatus(account, BEAN_ERC20, stalk1, roots1, bdv1, stem1));
handleMigratedAccountStatus(createMigratedAccountStatus(account, stalk1, roots1));
assert.fieldEquals("Silo", account.toHexString(), "stalk", stalk1.toString());
assert.fieldEquals("Silo", BEANSTALK.toHexString(), "stalk", stalk1.toString());

const stalk2 = BigInt.fromU32(700).times(BI_10.pow(16));
const roots2 = BigInt.fromU32(700).times(BI_10.pow(22));
const bdv2 = BigInt.fromU32(130).times(BI_10.pow(6));
const stem2 = BigInt.fromU32(2458672);
handleMigratedAccountStatus(createMigratedAccountStatus(account, UNRIPE_BEAN, stalk2, roots2, bdv2, stem2));
handleMigratedAccountStatus(createMigratedAccountStatus(account, stalk2, roots2));
assert.fieldEquals("Silo", account.toHexString(), "stalk", stalk1.plus(stalk2).toString());
assert.fieldEquals("Silo", BEANSTALK.toHexString(), "stalk", stalk1.plus(stalk2).toString());
});
Expand Down
19 changes: 3 additions & 16 deletions projects/subgraph-beanstalk/tests/event-mocking/Migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,17 @@ export function createAddMigratedDepositEvent(
return event as AddMigratedDeposit;
}

export function createMigratedAccountStatus(
account: Address,
token: Address,
stalk: BigInt,
roots: BigInt,
bdv: BigInt,
lastStem: BigInt
): MigratedAccountStatus {
export function createMigratedAccountStatus(account: Address, stalk: BigInt, roots: BigInt): MigratedAccountStatus {
let event = changetype<MigratedAccountStatus>(mockContractEvent(BEANSTALK_ARB));
event.parameters = new Array();

let param1 = new ethereum.EventParam("account", ethereum.Value.fromAddress(account));
let param2 = new ethereum.EventParam("token", ethereum.Value.fromAddress(token));
let param3 = new ethereum.EventParam("stalk", ethereum.Value.fromUnsignedBigInt(stalk));
let param4 = new ethereum.EventParam("roots", ethereum.Value.fromUnsignedBigInt(roots));
let param5 = new ethereum.EventParam("bdv", ethereum.Value.fromUnsignedBigInt(bdv));
let param6 = new ethereum.EventParam("lastStem", ethereum.Value.fromUnsignedBigInt(lastStem));
let param2 = new ethereum.EventParam("stalk", ethereum.Value.fromUnsignedBigInt(stalk));
let param3 = new ethereum.EventParam("roots", ethereum.Value.fromUnsignedBigInt(roots));

event.parameters.push(param1);
event.parameters.push(param2);
event.parameters.push(param3);
event.parameters.push(param4);
event.parameters.push(param5);
event.parameters.push(param6);

return event as MigratedAccountStatus;
}
Expand Down
18 changes: 0 additions & 18 deletions projects/subgraph-core/abis/Beanstalk/Beanstalk-BIP50.json
Original file line number Diff line number Diff line change
Expand Up @@ -11428,12 +11428,6 @@
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
Expand All @@ -11445,18 +11439,6 @@
"internalType": "uint256",
"name": "roots",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "bdv",
"type": "uint256"
},
{
"indexed": false,
"internalType": "int96",
"name": "lastStem",
"type": "int96"
}
],
"name": "MigratedAccountStatus",
Expand Down

0 comments on commit e0b56ab

Please sign in to comment.