mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-26 11:51:13 +00:00
feat(tx)!: signed fee fields and payer authorization on public and deployment txs
This commit is contained in:
@@ -53,7 +53,14 @@ async fn main() {
|
||||
// `run_hello_world_with_authorization` on how to use them.
|
||||
let nonces = vec![];
|
||||
let signing_keys = [];
|
||||
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
|
||||
let message = Message::try_new(
|
||||
program.id(),
|
||||
vec![account_id],
|
||||
nonces,
|
||||
greeting,
|
||||
lee::FeeFields::ZERO,
|
||||
)
|
||||
.unwrap();
|
||||
let witness_set = WitnessSet::for_message(&message, &signing_keys);
|
||||
let tx = PublicTransaction::new(message, witness_set);
|
||||
|
||||
|
||||
@@ -48,8 +48,14 @@ async fn main() {
|
||||
let instruction_data = ();
|
||||
let nonces = vec![];
|
||||
let signing_keys = [];
|
||||
let message =
|
||||
Message::try_new(program.id(), vec![account_id], nonces, instruction_data).unwrap();
|
||||
let message = Message::try_new(
|
||||
program.id(),
|
||||
vec![account_id],
|
||||
nonces,
|
||||
instruction_data,
|
||||
lee::FeeFields::ZERO,
|
||||
)
|
||||
.unwrap();
|
||||
let witness_set = WitnessSet::for_message(&message, &signing_keys);
|
||||
let tx = PublicTransaction::new(message, witness_set);
|
||||
|
||||
|
||||
@@ -65,7 +65,14 @@ async fn main() {
|
||||
.await
|
||||
.expect("Node should be reachable to query account data");
|
||||
let signing_keys = [&signing_key];
|
||||
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
|
||||
let message = Message::try_new(
|
||||
program.id(),
|
||||
vec![account_id],
|
||||
nonces,
|
||||
greeting,
|
||||
lee::FeeFields::ZERO,
|
||||
)
|
||||
.unwrap();
|
||||
// Pass the signing key to sign the message. This will be used by the node
|
||||
// to flag the pre_state as `is_authorized` when executing the program
|
||||
let witness_set = WitnessSet::for_message(&message, &signing_keys);
|
||||
|
||||
+8
-1
@@ -51,7 +51,14 @@ async fn main() {
|
||||
let instruction_data = ();
|
||||
let nonces = vec![];
|
||||
let signing_keys = [];
|
||||
let message = Message::try_new(program.id(), account_ids, nonces, instruction_data).unwrap();
|
||||
let message = Message::try_new(
|
||||
program.id(),
|
||||
account_ids,
|
||||
nonces,
|
||||
instruction_data,
|
||||
lee::FeeFields::ZERO,
|
||||
)
|
||||
.unwrap();
|
||||
let witness_set = WitnessSet::for_message(&message, &signing_keys);
|
||||
let tx = PublicTransaction::new(message, witness_set);
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ async fn main() {
|
||||
vec![account_id],
|
||||
nonces,
|
||||
instruction,
|
||||
lee::FeeFields::ZERO,
|
||||
)
|
||||
.unwrap();
|
||||
let witness_set = public_transaction::WitnessSet::for_message(&message, &[]);
|
||||
@@ -120,6 +121,7 @@ async fn main() {
|
||||
vec![from, to],
|
||||
nonces,
|
||||
instruction,
|
||||
lee::FeeFields::ZERO,
|
||||
)
|
||||
.unwrap();
|
||||
let witness_set = public_transaction::WitnessSet::for_message(&message, &[]);
|
||||
|
||||
Reference in New Issue
Block a user