Created
July 22, 2021 11:49
-
-
Save mkaczanowski/4feecb1920beb278373758e4068f3400 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/client/ics-028-wasm-client/README.md b/spec/client/ics-028-wasm-client/README.md | |
index 598f067..8fb7700 100644 | |
--- a/spec/client/ics-028-wasm-client/README.md | |
+++ b/spec/client/ics-028-wasm-client/README.md | |
@@ -130,8 +130,9 @@ function initialise( | |
): ClientState { | |
codeHandle = getWasmCode(wasmCodeId) | |
assert(codeHandle.isInitializationDataValid(initializationData, consensusState)) | |
- set("clients/{identifier}/consensusStates/{height}", consensusState) | |
- return codeHandle.initialise(initializationData, consensusState) | |
+ | |
+ store = getStore("clients/{identifier}") | |
+ return codeHandle.initialise(store, initializationData, consensusState) | |
} | |
``` | |
@@ -153,11 +154,11 @@ function checkValidityAndUpdateState( | |
clientState: ClientState, | |
epoch: uint64, | |
header: Header) { | |
+ store = getStore("clients/{identifier}") | |
codeHandle = clientState.codeHandle() | |
- isValid, consensusState = codeHandle.validateHeaderAndCreateConsensusState(clientState, header, epoch) | |
- set("clients/{identifier}/consensusStates/{header.height}", consensusState) | |
- // save the client | |
- set("clients/{identifier}", clientState) | |
+ | |
+ // verify that provided header is valid and state is saved | |
+ assert(codeHandle.validateHeaderAndCreateConsensusState(store, clientState, header, epoch)) | |
} | |
``` | |
@@ -169,11 +170,9 @@ Wasm client misbehaviour checking determines whether or not two conflicting head | |
function checkMisbehaviourAndUpdateState( | |
clientState: ClientState, | |
misbehaviour: Misbehaviour) { | |
+ store = getStore("clients/{identifier}") | |
codeHandle = clientState.codeHandle() | |
- consensusState = get("clients/{identifier}/consensusStates/{misbehaviour.fromHeight}") | |
- assert(codeHandle.handleMisbehaviour(clientState, consensusState, misbehaviour)) | |
- // save the client | |
- set("clients/{identifier}", clientState) | |
+ assert(codeHandle.handleMisbehaviour(store, clientState, misbehaviour)) | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment