This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
API change: substitute env
, context
, and msg
for tx
#484
Labels
Depends on #458
On issue #458, we've extended the
svm-codec
to be aware of theEnvelope
.We'll adapt both the
Runtime
and the C-API require aTransaction
instead ofEnvelope
andMessage
.As an example, here we have the
svm_deploy
under the FFI API:svm/crates/runtime-ffi/src/api.rs
Line 262 in 6edb73d
We'll modify the API to look as the following:
Consequently, we'll change the
Runtime
.In the
Deploy
context, we've this link:svm/crates/runtime/src/runtime/runtime.rs
Line 548 in 6edb73d
it'll be modified to something similar to this:
Now, we want to keep the
raw_tx
since we'll need it for further usage.In the
Deploy
transaction, it'll be used for deriving theTemplate Address
.We'll need the' raw_tx' for
Spawn
,Call
, andVerify
we'll need theraw_tx
for executing code.(the raw transaction will be copied to the Wasm Instance Memory - see issue #462).
In similar fashion, we need to update the
spawn
,call
andverify
to require only the raw transaction.The
svm_codec
should expose:svm_codec::decode_deploy
- to be used bydeploy
.note that, right now we have
svm_codec::template::decode
but it only addresses theMessage
part.svm_codec::decode_spawn
- to be used byspawn
.svm_codec::decode_call
- to be used bycall
.svm_codec::decode_tx
- to be used byverify
.Notes
For
verify
we could probably manage only with decoding theEnvelope
part.So we can have instead
svm_codec::decode_env
.The validations method (i.e
validate_deploy/validate_spawn/validate_call
should expect the whole raw transactions as a parameter.For example, this code:
svm/crates/runtime/src/runtime/runtime.rs
Line 521 in 6edb73d
It should be modified to validate the whole transaction instead of only the
Message
part of aDeploy Transaction
.The text was updated successfully, but these errors were encountered: