Skip to content

Commit

Permalink
remove unintended changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dssei committed Jan 9, 2025
1 parent 6bf9415 commit 7739588
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions precompiles/confidentialtransfers/ct.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ func (p PrecompileExecutor) initializeAccount(ctx sdk.Context, method *abi.Metho
rerr = err
return
}

msg := &cttypes.MsgInitializeAccount{
FromAddress: seiAddr.String(),
Denom: denom,
Expand Down
7 changes: 7 additions & 0 deletions precompiles/confidentialtransfers/ct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ func TestPrecompileInitializeAccount_Execute(t *testing.T) {
testApp := testkeeper.EVMTestApp
ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2)
k := &testApp.EvmKeeper

err := k.BankKeeper().MintCoins(
ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(testDenom, sdk.NewInt(10000000))))
require.Nil(t, err)
Expand All @@ -692,15 +693,19 @@ func TestPrecompileInitializeAccount_Execute(t *testing.T) {
otherUserAddr, otherUserEVMAddr := testkeeper.PrivateKeyToAddresses(otherUserPrivateKey)
k.SetAddressMapping(ctx, userAddr, userEVMAddr)
k.SetAddressMapping(ctx, otherUserAddr, otherUserEVMAddr)

privHex := hex.EncodeToString(userPrivateKey.Bytes())
userKey, _ := crypto.HexToECDSA(privHex)

statedb := state.NewDBImpl(ctx, k, true)
evm := vm.EVM{
StateDB: statedb,
TxContext: vm.TxContext{Origin: userEVMAddr},
}

p, err := confidentialtransfers.NewPrecompile(ctkeeper.NewMsgServerImpl(k.CtKeeper()), k)
require.Nil(t, err)

initAccount, err := cttypes.NewInitializeAccount(
userAddr.String(),
testDenom,
Expand All @@ -711,6 +716,7 @@ func TestPrecompileInitializeAccount_Execute(t *testing.T) {
pendingBalanceHi, _ := iaProto.PendingBalanceHi.Marshal()
availableBalance, _ := iaProto.AvailableBalance.Marshal()
proofs, _ := iaProto.Proofs.Marshal()

InitializeAccountMethod, _ := p.ABI.MethodById(p.GetExecutor().(*confidentialtransfers.PrecompileExecutor).InitializeAccountID)
expectedTrueResponse, _ := InitializeAccountMethod.Outputs.Pack(true)

Expand Down Expand Up @@ -885,6 +891,7 @@ func TestPrecompileInitializeAccount_Execute(t *testing.T) {
in.PendingBalanceHi,
in.AvailableBalance,
in.proofs)

require.Nil(t, err)

resp, remainingGas, err := p.RunAndCalculateGas(
Expand Down

0 comments on commit 7739588

Please sign in to comment.