-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pallet-revive] implement tx origin API #6105
Conversation
Signed-off-by: Cyrill Leutwiler <[email protected]>
bot bench substrate-pallet --pallet=pallet_revive |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7592845 was started for your command Comment |
@xermicus Command |
/cmd prdoc --audience runtime_dev --bump minor |
Signed-off-by: Cyrill Leutwiler <[email protected]>
bot bench substrate-pallet --pallet=pallet_revive |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7593264 was started for your command Comment |
…=dev --target_dir=substrate --features=riscv --pallet=pallet_revive
@xermicus Command |
bot fmt |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7594728 was started for your command Comment |
@xermicus Command |
Signed-off-by: xermicus <[email protected]>
substrate/frame/revive/src/exec.rs
Outdated
fn origin(&self) -> Origin<T> { | ||
self.origin.clone() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not return a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy paste from fn caller
which returns a value too. But I don't see why it can't be a reference. Changed it
substrate/frame/revive/src/tests.rs
Outdated
fn origin_api_works() { | ||
let (code, _) = compile_module("origin").unwrap(); | ||
|
||
ExtBuilder::default().existential_deposit(100).build().execute_with(|| { | ||
let _ = <Test as Config>::Currency::set_balance(&ALICE, 1_000_000); | ||
|
||
// Create fixture: Constructor tests the origin to be equal the input data | ||
builder::bare_instantiate(Code::Upload(code)) | ||
.data(ALICE_ADDR.0.to_vec()) | ||
.build_and_unwrap_contract(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caller = Origin in this case. I think it should also test where this is not the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deemed it unnecessary as this is already covered by the unit tests. Changed the fixture to go through both paths.
Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: Alexander Theißen <[email protected]>
Signed-off-by: xermicus <[email protected]>
Signed-off-by: xermicus <[email protected]>
Signed-off-by: xermicus <[email protected]>
bot fmt |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7606022 was started for your command Comment |
@xermicus Command |
bot bench substrate-pallet --pallet=pallet_revive |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7652195 was started for your command Comment |
Signed-off-by: xermicus <[email protected]>
@xermicus Command |
Signed-off-by: xermicus <[email protected]>
bot bench substrate-pallet --pallet=pallet_revive |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7658445 was started for your command Comment |
…=dev --target_dir=substrate --features=riscv --pallet=pallet_revive
@xermicus Command |
Implement a syscall to retreive the transaction origin. --------- Signed-off-by: Cyrill Leutwiler <[email protected]> Signed-off-by: xermicus <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <[email protected]>
Implement a syscall to retreive the transaction origin. --------- Signed-off-by: Cyrill Leutwiler <[email protected]> Signed-off-by: xermicus <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <[email protected]>
Implement a syscall to retreive the transaction origin.