Skip to content

Commit

Permalink
Fix side chain ID issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed Jul 18, 2022
1 parent 9c4446c commit beb5490
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions types/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ func TestSmartChainAddress(t *testing.T) {
}

func TestForBep153(t *testing.T) {
bcAddr := "tbnb1q8eh7ytly7letp6aadxmzasmrpwyalkjf3rpvn"
// 0x01f37f117f27bf95875deb4db1761b185c4efed2
bcAddr := "tbnb1pnww8kx30sz4xfcqvn8wjhrn796nf4dqshlvlg"
// 0x0cdce3d8d17c0553270064cee95c73f17534d5a0

bz, err := types.GetFromBech32(bcAddr, "tbnb")
opAddr, err := bech32.ConvertAndEncode("bva", bz)
Expand Down
6 changes: 3 additions & 3 deletions x/stake/cross_stake/cross_stake.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (app *CrossStakeApp) ExecuteSynPackage(ctx sdk.Context, payload []byte, rel
}

func (app *CrossStakeApp) handleDelegate(ctx sdk.Context, pack types.CrossStakeDelegateSynPackage, relayFee int64) (sdk.ExecuteResult, error) {
sideChainId := ctx.SideChainId()
sideChainId := app.stakeKeeper.ScKeeper.BscSideChainId(ctx)
if scCtx, err := app.stakeKeeper.ScKeeper.PrepareCtxForSideChain(ctx, sideChainId); err != nil {
return sdk.ExecuteResult{}, err
} else {
Expand Down Expand Up @@ -154,7 +154,7 @@ func (app *CrossStakeApp) handleDelegate(ctx sdk.Context, pack types.CrossStakeD
}

func (app *CrossStakeApp) handleUndelegate(ctx sdk.Context, pack types.CrossStakeUndelegateSynPackage, relayFee int64) (sdk.ExecuteResult, error) {
sideChainId := ctx.SideChainId()
sideChainId := app.stakeKeeper.ScKeeper.BscSideChainId(ctx)
if scCtx, err := app.stakeKeeper.ScKeeper.PrepareCtxForSideChain(ctx, sideChainId); err != nil {
return sdk.ExecuteResult{}, err
} else {
Expand Down Expand Up @@ -213,7 +213,7 @@ func (app *CrossStakeApp) handleUndelegate(ctx sdk.Context, pack types.CrossStak
}

func (app *CrossStakeApp) handleRedelegate(ctx sdk.Context, pack types.CrossStakeRedelegateSynPackage, relayFee int64) (sdk.ExecuteResult, error) {
sideChainId := ctx.SideChainId()
sideChainId := app.stakeKeeper.ScKeeper.BscSideChainId(ctx)
if scCtx, err := app.stakeKeeper.ScKeeper.PrepareCtxForSideChain(ctx, sideChainId); err != nil {
return sdk.ExecuteResult{}, err
} else {
Expand Down

0 comments on commit beb5490

Please sign in to comment.