-
Notifications
You must be signed in to change notification settings - Fork 700
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 <bigcyrill@hotmail.com>
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 |
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 <cyrill@parity.io>
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 <alex.theissen@me.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: xermicus <cyrill@parity.io>
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 <cyrill@parity.io>
@xermicus Command |
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 <bigcyrill@hotmail.com> Signed-off-by: xermicus <cyrill@parity.io> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Implement a syscall to retreive the transaction origin. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com> Signed-off-by: xermicus <cyrill@parity.io> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Implement a syscall to retreive the transaction origin.