Skip to content

Commit

Permalink
refactor: PR comments from dIBC
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 4, 2021
1 parent a0f4588 commit 94789a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
9 changes: 1 addition & 8 deletions golang/cosmos/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,7 @@ func (app *GaiaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
res := app.mm.InitGenesis(ctx, app.appCodec, genesisState)

// Set Historical infos in InitChain to ignore genesis params
stakingParams := app.StakingKeeper.GetParams(ctx)
stakingParams.HistoricalEntries = 10000
app.StakingKeeper.SetParams(ctx, stakingParams)

return res
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

// Commit tells the controller that the block is commited
Expand Down
2 changes: 2 additions & 0 deletions golang/cosmos/x/dibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ func (am AppModule) OnChanOpenAck(
ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
}

// We don't care if the channel was found. If it wasn't then GetChannel
// returns an empty channel object that we can still use without crashing.
channel, _ := am.keeper.GetChannel(ctx, portID, channelID)

event := channelOpenAckEvent{
Expand Down
7 changes: 4 additions & 3 deletions packages/cosmic-swingset/lib/ag-solo/vats/ibc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { makeWithQueue } from './queue';

const DEFAULT_PACKET_TIMEOUT = 1000;

// FIXME: IBC acks cannot be empty, as the Cosmos IAVL tree cannot represent
// CAVEAT: IBC acks cannot be empty, as the Cosmos IAVL tree cannot represent
// empty acknowledgements as distinct from unacknowledged packets.
const DEFAULT_ACKNOWLEDGEMENT = '\x00';

Expand Down Expand Up @@ -43,8 +43,6 @@ const DEFAULT_ACKNOWLEDGEMENT = '\x00';
* @property {IBCPortID} destination_port
*/

let lastPortID = 0;

/**
* Create a handler for the IBC protocol, both from the network
* and from the bridge.
Expand All @@ -54,6 +52,9 @@ let lastPortID = 0;
* @returns {ProtocolHandler & BridgeHandler} Protocol/Bridge handler
*/
export function makeIBCProtocolHandler(E, rawCallIBCDevice) {
// Nonce for creating port identifiers.
let lastPortID = 0;

const callIBCDevice = (method, params) => {
console.info('IBC downcall', method, params);
return rawCallIBCDevice(method, params);
Expand Down

0 comments on commit 94789a7

Please sign in to comment.